Patch for omniORBpy pyTypeCode.cc

Alex Tingle <[email protected]> Mon, 15 Mar 2004 19:56:10 +0000
Newsgroups gmane.comp.corba.omniorb.devel
Organization Broner Metals
Message-ID <[email protected]>
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);

_______________________________________________
omniORB-dev mailing list
[email protected]
http://www.omniorb-support.com/mailman/listinfo/omniorb-dev
pyTypeCode.cc.patch (application/octet-stream, 313 B)
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);