[augeas-devel] [Augeas] #165: augeas-libs crash on RHEL6 / PPC64

Augeas trac at fedorahosted.org
Mon Feb 7 19:45:08 UTC 2011


#165: augeas-libs crash on RHEL6 / PPC64
------------------------+---------------------------------------------------
  Reporter:  caioromao  |       Owner:  lutter   
      Type:  defect     |      Status:  assigned 
  Priority:  major      |   Milestone:  next     
 Component:  Augeas     |     Version:  0.7.0    
Resolution:             |    Keywords:  ppc, rhel
------------------------+---------------------------------------------------
Comment (by caioromao):

 Got an answer from Red Hat regarding the possible issue on python-ctypes
 for RHEL6 on PPC64:

 > <snip>
 > The ob_ival of a PyIntObject is 8 bytes.  However, the default arg
 handling
 > with ctypes (within the call to "free") for a python "int" is
 ffi_type_sint,
 > and my reading of <ffi.h> is that on ppc64, this is ffi_type_sint32, and
 thus
 > the pointer is truncated to a 4-byte signed int; the call to "free" thus
 > receives a corrupted 64-bit value, and glibc's attempts to update the
 heap
 > makes it write to that non-area of memory, leading to the segmentation
 fault.

 And:

 > <snip>
 > This kind of bug most often happens with changes in endianness. For
 example, on
 > a little-endian system like x86, you save a 16-bit number as raw binary
 data to
 > a file as 0x1234. Then you copy your file over to a big-endian system
 like
 > PowerPC(*) and load the raw data into a 16-bit variable and it's
 transformed to
 > 0x3412 and the program crashes or gives strange results.

 So this means that in order to properly support ppc64, safer usage of
 ctypes must be in place. My patches work correctly, yet I was suggested to
 explicitly set argtypes instead of casting. Is there interest to get this
 upstream? I'll be submitting the improved patches ASAP in case of a
 positive answer.

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/165#comment:5>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list