[omniORB] Segmentation fault when marshalling a string from python

Floris Bruynooghe floris.bruynooghe at gmail.com
Sun Jan 10 15:53:52 GMT 2010


Hi

When running this script in Python I get a segementation fault:
"""
import omniORB
import CORBA

omniORB.cdrMarshal(CORBA.TC_string, 'foo')
"""

The problem is in pyMarshal.cc:marshalPyObjectString(), the stream
object there has a pd_tcs_c member with NULL as value, which is what I
think causes the segfault.  But I'm afraid I don't understand enough
of the iternals to make much more out of this.  Can anybody help find
out what is going on?

Here the raw gdb output:

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/python test.py
[Thread debugging using libthread_db enabled]

Breakpoint 2, marshalPyObjectString (stream=..., d_o=0xb7c5fdcc, 
    a_o=0xb7dcfec0) at ../../modules/pyMarshal.cc:1949
1949		    ../../modules/pyMarshal.cc: No such file or directory.
		    in ../../modules/pyMarshal.cc
(gdb) bt
#0  marshalPyObjectString (stream=..., d_o=0xb7c5fdcc, a_o=0xb7dcfec0)
    at ../../modules/pyMarshal.cc:1949
#1  0xb7bd6718 in omniPy::marshalPyObject (self=0x0, args=0xb7dd43c4)
    at ../../modules/omnipy.h:530
#2  omnipy_cdrMarshal (self=0x0, args=0xb7dd43c4)
    at ../../modules/omnipy.cc:618
#3  0x080cd12a in call_function (f=0x81f29d4, throwflag=0)
    at ../Python/ceval.c:3612
#4  PyEval_EvalFrameEx (f=0x81f29d4, throwflag=0) at ../Python/ceval.c:2304
#5  0x080ce445 in PyEval_EvalCodeEx (co=0xb7dc0d58, globals=0xb7dc4b54, 
    locals=0x0, args=0x81a7d38, argcount=2, kws=0x81a7d40, kwcount=0, 
    defs=0xb7ddb198, defcount=1, closure=0x0) at ../Python/ceval.c:2875
#6  0x080ccde4 in fast_function (f=0x81a7bfc, throwflag=0)
    at ../Python/ceval.c:3708
#7  call_function (f=0x81a7bfc, throwflag=0) at ../Python/ceval.c:3633
#8  PyEval_EvalFrameEx (f=0x81a7bfc, throwflag=0) at ../Python/ceval.c:2304
#9  0x080ce445 in PyEval_EvalCodeEx (co=0xb7dc0338, globals=0xb7e11acc, 
    locals=0xb7e11acc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, 
    defcount=0, closure=0x0) at ../Python/ceval.c:2875
#10 0x080ce657 in PyEval_EvalCode (co=0xb7dc0338, globals=0xb7e11acc, 
    locals=0xb7e11acc) at ../Python/ceval.c:514
#11 0x080eb36f in run_mod (fp=0x816b008, filename=0xbffff3eb "test.py", 
    start=257, globals=0xb7e11acc, locals=0xb7e11acc, closeit=1, 
---Type <return> to continue, or q <return> to quit---q
flags=0xbffff14Quit
(gdb) pyo d_o
object  : (18, 0)
type    : tuple
refcount: 2
address : 0xb7c5fdcc
$18 = void
(gdb) pyo a_o
object  : 'foo'
type    : str
refcount: 5
address : 0xb7dcfec0
$19 = void
(gdb) p stream
$20 = (class cdrStream &) @0xbfffea78: {_vptr.cdrStream = 0xb7b99dc8, 
  pd_unmarshal_byte_swap = false, pd_marshal_byte_swap = false, 
  pd_inb_end = 0xbfffeab0, pd_inb_mkr = 0xbfffeab0, pd_outb_end = 0xbfffead0, 
  pd_outb_mkr = 0xbfffeab1, pd_tcs_c = 0x0, pd_tcs_w = 0x0, pd_ncs_c = 0x0, 
  pd_ncs_w = 0x0, pd_valueTracker = 0x0, static _classid = 0}
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0xb7bef6cb in marshalPyObjectString (stream=..., d_o=0xb7c5fdcc, 
    a_o=0xb7dcfec0) at ../../modules/pyMarshal.cc:1949
1949		    in ../../modules/pyMarshal.cc
(gdb)


Any hints appreciated.
Floris

-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org



More information about the omniORB-list mailing list