[omniORB-dev] Patch for omniORBpy pyTypeCode.cc

Alex Tingle alex.tingle at bronermetals.com
Mon Mar 15 19:56:10 GMT 2004


Hi Duncan,

Here's a patch for omniORBpy/modules/pyTypeCode.cc

The problem lies in r_unmarshalTypeCode(). When a struct/union/exception
member name is a reserved word (in pyomniORBwordMap), the name object is
replaced with the object read from the word map. However that object's
reference count is not incremented.

Cue SEGV or assertion failure (same file, line 308) some time later.

The patch adds the missing ref count increments. It's tested insofar as
it cured my SEGV & assertion failure problems (only with structs, not
tested with exceptions or unions but it seems a safe bet that they work
the same way).

Caveat: My first look at the omniORBpy code. Hope I've got the right end
of the stick!

best,

-Alex Tingle

--
Index: pyTypeCode.cc
===================================================================
RCS file: /cvsroot/omniorb/omniORBpy/modules/Attic/pyTypeCode.cc,v
retrieving revision 1.1.2.13
diff -r1.1.2.13 pyTypeCode.cc
726a727
>           Py_INCREF(word);
843a845
>           Py_INCREF(word);
1058a1061
>           Py_INCREF(word);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyTypeCode.cc.patch
Type: application/octet-stream
Size: 313 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-dev/attachments/20040315/2d9504d8/pyTypeCode.cc.obj


More information about the omniORB-dev mailing list