Bug 707778

Summary: Sequence indexes are incorrectly 32 bits on 64-bit machines
Product: Red Hat Enterprise Linux 5 Reporter: Garrett Holmstrom <gholms>
Component: swigAssignee: Adam Tkac <atkac>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.6CC: dmalcolm, mitr, ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-12 17:55:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 707676, 741892    

Description Garrett Holmstrom 2011-05-25 22:01:28 UTC
Description of problem:
Python switched the C type it uses for sequence indexes from int to Py_ssize_t, which is 64 bits on x86-64, with the implementation of PEP 353 [1].  RHEL 5's version of swig generates C code that always uses ints, causing register corruption when it is compiled on x86-64 with a new enough version of python.  Bug 707676 is an example of this happening with m2crypto.  This problem was fixed with a small commit, revision 9289, in upstream svn; could that fix be backported?

If you need me to create a patch, feel free to ask.

[1] http://www.python.org/dev/peps/pep-0353/

Version-Release number of selected component (if applicable):
swig-1.3.29-2.el5.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Compile m2crypto against python >= 2.5 on x86-64
2. Attempt to call m2crypto functions that pass strings to openssl (see the reproducing Python code in bug 707676)
  
Actual results:
Segmentation fault

Expected results:
<M2Crypto.X509.X509_Store instance at 0xca3878>

Comment 1 Adam Tkac 2011-06-01 11:23:56 UTC
This issue won't be fixed in RHEL 5.8.

If you use RHEL5 as a development machine I would recommend to update it to RHEL6, it's bigger chance that swig will be fixed there.

Comment 2 Dave Malcolm 2011-06-07 20:27:11 UTC
(In reply to comment #0)
> [...snip...]  This problem was fixed with a small commit, revision 9289,
> in upstream svn; [...snip...]  

For reference, upstream rev 9289 can be seen here:
http://swig.svn.sourceforge.net/viewvc/swig?view=revision&revision=9289

Comment 3 RHEL Program Management 2011-09-23 00:28:50 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 4 RHEL Program Management 2012-06-12 01:15:40 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 5 Adam Tkac 2013-03-12 17:55:21 UTC
Since RHEL 5 is now in production phase 2 (only important/critical bugs are fixed) and this is not critical bug, I'm closing this ticket. Please upgrade to RHEL-6 which has this bug fixed.