Hi there,

while developing an external funciton library for 64-bit ooRexx (using
4.1.0) on a 64-bit Linux machine, all of a sudden I have been getting
segmentation faults in a code segment that contains no Rexx-API code.
The native code does not itself use glibc's realloc().

The statement in the native code in question (localized the spot for the
realloc segmentation with tons of fprintf's to fence the statement,
where this occurs) uses valid parameters as far as I can tell.

Here is a backtrace:

    ... cut ...


    *** glibc detected *** rexx: realloc(): invalid pointer: 0x0000000002238ca0 
***
    ======= Backtrace: =========
    /lib/libc.so.6(+0x774b6)[0x7f37c497d4b6]
    /lib/libc.so.6(realloc+0x352)[0x7f37c4984112]
    /lib/libdbus-1.so.3(+0x28fda)[0x7f37c2290fda]
    /lib/libdbus-1.so.3(+0x291a8)[0x7f37c22911a8]
    /lib/libdbus-1.so.3(+0x14843)[0x7f37c227c843]
    /lib/libdbus-1.so.3(dbus_message_iter_append_basic+0x19e)[0x7f37c228108e]
    ./libdbusoorexx.so(marshal+0x895)[0x7f37c24b104d]
    ./libdbusoorexx.so(helperCreateMessageArgs+0x214)[0x7f37c24b2d8c]
    ./libdbusoorexx.so(DbusBusSignalMessage_impl+0x54b)[0x7f37c24b34f0]
    ./libdbusoorexx.so(DbusBusSignalMessage+0x73)[0x7f37c24b2f89]
    
/usr/lib/ooRexx/librexx.so.4(_ZN20RexxNativeActivation3runEP10RexxMethodP16RexxNativeMethodP10RexxObjectP10RexxStringPS5_mR15ProtectedObject+0xce)[0x7f37c5b541ae]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxMethod3runEP12RexxActivityP10RexxObjectP10RexxStringPS3_mR15ProtectedObject+0x71)[0x7f37c5b13361]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxObject22processProtectedMethodEP10RexxStringP10RexxMethodPPS_mR15ProtectedObject+0x7d)[0x7f37c5b1ef4d]
    
/usr/lib/ooRexx/librexx.so.4(_ZN22RexxInstructionMessage7executeEP14RexxActivationP19RexxExpressionStack+0x2fd)[0x7f37c5b841fd]
    
/usr/lib/ooRexx/librexx.so.4(_ZN14RexxActivation3runEP10RexxObjectP10RexxStringPS1_mP15RexxInstructionR15ProtectedObject+0x11c)[0x7f37c5b4cc9c]
    
/usr/lib/ooRexx/librexx.so.4(_ZN8RexxCode3runEP12RexxActivityP10RexxMethodP10RexxObjectP10RexxStringPS5_mR15ProtectedObject+0x73)[0x7f37c5b50363]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxMethod3runEP12RexxActivityP10RexxObjectP10RexxStringPS3_mR15ProtectedObject+0x71)[0x7f37c5b13361]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxObject11messageSendEP10RexxStringPPS_mR15ProtectedObject+0xd3)[0x7f37c5b1f7d3]
    
/usr/lib/ooRexx/librexx.so.4(_ZN22RexxInstructionMessage7executeEP14RexxActivationP19RexxExpressionStack+0x2fd)[0x7f37c5b841fd]
    
/usr/lib/ooRexx/librexx.so.4(_ZN14RexxActivation3runEP10RexxObjectP10RexxStringPS1_mP15RexxInstructionR15ProtectedObject+0x11c)[0x7f37c5b4cc9c]
    
/usr/lib/ooRexx/librexx.so.4(_ZN12RoutineClass4callEP12RexxActivityP10RexxStringPP10RexxObjectmS3_S3_iR15ProtectedObject+0x72)[0x7f37c5b26872]
    
/usr/lib/ooRexx/librexx.so.4(_ZN14RexxActivation12externalCallEP10RexxStringmP19RexxExpressionStackS1_R15ProtectedObject+0x8d)[0x7f37c5b48d0d]
    
/usr/lib/ooRexx/librexx.so.4(_ZN19RexxInstructionCall7executeEP14RexxActivationP19RexxExpressionStack+0x39b)[0x7f37c5b7db9b]
    
/usr/lib/ooRexx/librexx.so.4(_ZN14RexxActivation3runEP10RexxObjectP10RexxStringPS1_mP15RexxInstructionR15ProtectedObject+0x11c)[0x7f37c5b4cc9c]
    
/usr/lib/ooRexx/librexx.so.4(_ZN12RoutineClass10runProgramEP12RexxActivityP10RexxStringS3_PP10RexxObjectmR15ProtectedObject+0x6b)[0x7f37c5b2670b]
    
/usr/lib/ooRexx/librexx.so.4(_ZN19RexxStartDispatcher3runEv+0x1c5)[0x7f37c5b71c15]
    
/usr/lib/ooRexx/librexx.so.4(_ZN20RexxNativeActivation3runER18ActivityDispatcher+0x54)[0x7f37c5b51fa4]
    
/usr/lib/ooRexx/librexx.so.4(_ZN12RexxActivity3runER18ActivityDispatcher+0x7a)[0x7f37c5b7069a]
    
/usr/lib/ooRexx/librexx.so.4(_ZN18ActivityDispatcher6invokeEP10_RXSYSEXITPKc+0x25)[0x7f37c5b6b7b5]
    /usr/lib/ooRexx/librexx.so.4(RexxStart+0xb8)[0x7f37c5b3df48]
    rexx(__gxx_personality_v0+0x4a9)[0x400d61]
    /lib/libc.so.6(__libc_start_main+0xfe)[0x7f37c4924d8e]
    rexx(__gxx_personality_v0+0x51)[0x400909]
    ======= Memory map: ========
    00400000-00401000 r-xp 00000000 08:01 268671                             
/usr/bin/rexx
    00601000-00602000 rw-p 00001000 08:01 268671                             
/usr/bin/rexx
    02222000-02243000 rw-p 00000000 00:00 0                                  
[heap]
    7f37c2060000-7f37c2067000 r-xp 00000000 08:01 168727                     
/lib/librt-2.12.1.so
    7f37c2067000-7f37c2266000 ---p 00007000 08:01 168727                     
/lib/librt-2.12.1.so
    7f37c2266000-7f37c2267000 r--p 00006000 08:01 168727                     
/lib/librt-2.12.1.so
    7f37c2267000-7f37c2268000 rw-p 00007000 08:01 168727                     
/lib/librt-2.12.1.so
    7f37c2268000-7f37c22a8000 r-xp 00000000 08:01 148771                     
/lib/libdbus-1.so.3.5.2
    7f37c22a8000-7f37c24a8000 ---p 00040000 08:01 148771                     
/lib/libdbus-1.so.3.5.2
    7f37c24a8000-7f37c24a9000 r--p 00040000 08:01 148771                     
/lib/libdbus-1.so.3.5.2
    7f37c24a9000-7f37c24aa000 rw-p 00041000 08:01 148771                     
/lib/libdbus-1.so.3.5.2
    7f37c24aa000-7f37c24b7000 r-xp 00000000 00:15 74                         
/mnt/root_e/rony/dev/dbus20110602/tutorials-dbus/c-api/work/libdbusoorexx.so
    7f37c24b7000-7f37c26b7000 ---p 0000d000 00:15 74                         
/mnt/root_e/rony/dev/dbus20110602/tutorials-dbus/c-api/work/libdbusoorexx.so
    7f37c26b7000-7f37c26b8000 r--p 0000d000 00:15 74                         
/mnt/root_e/rony/dev/dbus20110602/tutorials-dbus/c-api/work/libdbusoorexx.so
    7f37c26b8000-7f37c26b9000 rw-p 0000e000 00:15 74                         
/mnt/root_e/rony/dev/dbus20110602/tutorials-dbus/c-api/work/libdbusoorexx.so
    7f37c26b9000-7f37c2aba000 rw-p 00000000 00:00 0 
    7f37c2aba000-7f37c2ac6000 r-xp 00000000 08:01 168743                     
/lib/libnss_files-2.12.1.so
    7f37c2ac6000-7f37c2cc5000 ---p 0000c000 08:01 168743                     
/lib/libnss_files-2.12.1.so
    7f37c2cc5000-7f37c2cc6000 r--p 0000b000 08:01 168743                     
/lib/libnss_files-2.12.1.so
    7f37c2cc6000-7f37c2cc7000 rw-p 0000c000 08:01 168743                     
/lib/libnss_files-2.12.1.so
    7f37c2cc7000-7f37c2cd1000 r-xp 00000000 08:01 168738                     
/lib/libnss_nis-2.12.1.so
    7f37c2cd1000-7f37c2ed0000 ---p 0000a000 08:01 168738                     
/lib/libnss_nis-2.12.1.so
    7f37c2ed0000-7f37c2ed1000 r--p 00009000 08:01 168738                     
/lib/libnss_nis-2.12.1.so
    7f37c2ed1000-7f37c2ed2000 rw-p 0000a000 08:01 168738                     
/lib/libnss_nis-2.12.1.so
    7f37c2ed2000-7f37c2ee9000 r-xp 00000000 08:01 168742                     
/lib/libnsl-2.12.1.so
    7f37c2ee9000-7f37c30e8000 ---p 00017000 08:01 168742                     
/lib/libnsl-2.12.1.so
    7f37c30e8000-7f37c30e9000 r--p 00016000 08:01 168742                     
/lib/libnsl-2.12.1.so
    7f37c30e9000-7f37c30ea000 rw-p 00017000 08:01 168742                     
/lib/libnsl-2.12.1.so
    7f37c30ea000-7f37c30ec000 rw-p 00000000 00:00 0 
    7f37c30ec000-7f37c30f4000 r-xp 00000000 08:01 168740                     
/lib/libnss_compat-2.12.1.so
    7f37c30f4000-7f37c32f3000 ---p 00008000 08:01 168740                     
/lib/libnss_compat-2.12.1.so
    7f37c32f3000-7f37c32f4000 r--p 00007000 08:01 168740                     
/lib/libnss_compat-2.12.1.soAborted
    
wu@wu-VirtualBox:/mnt/root_e/rony/dev/dbus20110602/tutorials-dbus/c-api/work$ 
      


Another segmentation fault (after re-running a couple of times) gives
the following information:

    *** glibc detected *** rexx: free(): invalid next size (fast): 
0x0000000000659f40 ***
    ======= Backtrace: =========
    /lib/libc.so.6(+0x774b6)[0x7f5bc77b74b6]
    /lib/libc.so.6(cfree+0x73)[0x7f5bc77bdc83]
    /lib/libdbus-1.so.3(+0x29e42)[0x7f5bc50cae42]
    /lib/libdbus-1.so.3(+0x1891c)[0x7f5bc50b991c]
    /lib/libdbus-1.so.3(dbus_message_iter_close_container+0xc6)[0x7f5bc50b9a06]
    ./libdbusoorexx.so(marshalArray+0xa57)[0x7f5bc52ebae6]
    ./libdbusoorexx.so(marshal+0x12e1)[0x7f5bc52eac69]
    ./libdbusoorexx.so(helperCreateMessageArgs+0x214)[0x7f5bc52ecbf5]
    ./libdbusoorexx.so(DbusBusSignalMessage_impl+0x54b)[0x7f5bc52ed359]
    ./libdbusoorexx.so(DbusBusSignalMessage+0x73)[0x7f5bc52ecdf2]
    
/usr/lib/ooRexx/librexx.so.4(_ZN20RexxNativeActivation3runEP10RexxMethodP16RexxNativeMethodP10RexxObjectP10RexxStringPS5_mR15ProtectedObject+0xce)[0x7f5bc898e1ae]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxMethod3runEP12RexxActivityP10RexxObjectP10RexxStringPS3_mR15ProtectedObject+0x71)[0x7f5bc894d361]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxObject22processProtectedMethodEP10RexxStringP10RexxMethodPPS_mR15ProtectedObject+0x7d)[0x7f5bc8958f4d]
    
/usr/lib/ooRexx/librexx.so.4(_ZN22RexxInstructionMessage7executeEP14RexxActivationP19RexxExpressionStack+0x2fd)[0x7f5bc89be1fd]
    
/usr/lib/ooRexx/librexx.so.4(_ZN14RexxActivation3runEP10RexxObjectP10RexxStringPS1_mP15RexxInstructionR15ProtectedObject+0x11c)[0x7f5bc8986c9c]
    
/usr/lib/ooRexx/librexx.so.4(_ZN8RexxCode3runEP12RexxActivityP10RexxMethodP10RexxObjectP10RexxStringPS5_mR15ProtectedObject+0x73)[0x7f5bc898a363]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxMethod3runEP12RexxActivityP10RexxObjectP10RexxStringPS3_mR15ProtectedObject+0x71)[0x7f5bc894d361]
    
/usr/lib/ooRexx/librexx.so.4(_ZN10RexxObject11messageSendEP10RexxStringPPS_mR15ProtectedObject+0xd3)[0x7f5bc89597d3]
    
/usr/lib/ooRexx/librexx.so.4(_ZN22RexxInstructionMessage7executeEP14RexxActivationP19RexxExpressionStack+0x2fd)[0x7f5bc89be1fd]
    
/usr/lib/ooRexx/librexx.so.4(_ZN14RexxActivation3runEP10RexxObjectP10RexxStringPS1_mP15RexxInstructionR15ProtectedObject+0x11c)[0x7f5bc8986c9c]
    
/usr/lib/ooRexx/librexx.so.4(_ZN12RoutineClass4callEP12RexxActivityP10RexxStringPP10RexxObjectmS3_S3_iR15ProtectedObject+0x72)[0x7f5bc8960872]
    
/usr/lib/ooRexx/librexx.so.4(_ZN14RexxActivation12externalCallEP10RexxStringmP19RexxExpressionStackS1_R15ProtectedObjectAborted
    
wu@wu-VirtualBox:/mnt/root_e/rony/dev/dbus20110602/tutorials-dbus/c-api/work$ 
      


Going through the native code a couple of times did not reveal anything
that would cause this by the native code I have been working on, as far
as I can tell.

Any ideas what the cause might be? What could I do to try to trace down
the cause of these segmentation faults ?

TIA,

---rony


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to