Thread: [Orbit-python-list] Problem with parsing of recursive structs in IDL
Status: Inactive
Brought to you by:
tack
From: Brad C. <cha...@ar...> - 2001-08-29 01:55:38
|
Hello all; I ran into a problem with CORBA._load_idl() getting a Bus error and core dump while parsing an IDL that I work on. After a bit of narrowing down, it appears as if this is a minimal IDL that will cause the problem: struct RecursiveStruct { sequence <RecursiveStruct> inner_struct; }; interface ProblemInterface { attribute RecursiveStruct problem_item; }; The idea is that you have a struct that has, as one of its member, a list of itself (in the IDL that I'm working on this is used to descend a sort of "tree" of items). When a struct like this is present inside an interface, it will cause the problem. gdb gives a trace that looks like: #0 0x283c6dba in _thread_leave_cancellation_point () from /usr/lib/libc_r.so.4 #1 0x283c705d in _thread_leave_cancellation_point () from /usr/lib/libc_r.so.4 #2 0x283c7781 in malloc () from /usr/lib/libc_r.so.4 #3 0x283bf179 in calloc () from /usr/lib/libc_r.so.4 #4 0x28461dc7 in g_malloc0 () from /usr/local/lib/libglib12.so.3 #5 0x283ff8be in alloc_typecode () at idl.c:917 #6 0x28400538 in get_struct_typecode (tree=0x81af5c0) at idl.c:1172 #7 0x28401525 in get_typecode (tree=0x81af5c0) at idl.c:1431 #8 0x283ffe59 in get_ident_typecode (tree=0x81af240) at idl.c:1043 #9 0x28401565 in get_typecode (tree=0x81af240) at idl.c:1439 #10 0x2840082a in get_sequence_typecode (tree=0x81af600) at idl.c:1219 #11 0x2840158d in get_typecode (tree=0x81af600) at idl.c:1445 [...] #s 5-11 will than repeat over and over again in the backtrace, seeming to indicate that orbit-python gets itself into a loop while parsing this. This error happens for me with orbit-python 0.3.0, ORBit 0.5.8, on both FreeBSD and NetBSD machines. I hope this report gives enough info for someone with a knowledge of idl.c; please let me know if you need more information (or would rather I submit this to the bug-tracker instead of sending it here). Thanks to all for orbit-python -- it has been really great to see all the new features/improvements happening on it! Brad |
From: Jason T. <ta...@li...> - 2001-08-29 03:39:38
|
* Brad Chapman (cha...@ar...) [010828 21:57]: > I ran into a problem with CORBA._load_idl() getting a Bus error and > core dump while parsing an IDL that I work on. After a bit of > narrowing down, it appears as if this is a minimal IDL that will > cause the problem: > > struct RecursiveStruct { > sequence <RecursiveStruct> inner_struct; > }; > > interface ProblemInterface { > attribute RecursiveStruct problem_item; > }; Yep, this certainly causes nasty things. In fact, orbit-idl also segfaults on this IDL. Maybe ORBit2's IDL compiler also has this problem? I'll have a look at the nature of this problem over the weekend. If it's nothing significant then it will be fixed for 0.3.1, which should be released hopefully early next week. BTW, you shouldn't really need to use _load_idl(). The only time you need to use _load_idl() is when the preprocessor is broken, in which case that should get fixed too. (Well, another valid case to use _load_idl() is when you want to load an IDL that is new since the CORBA module was imported. Mind you, I could probably work up a hack to get around this problem too.) Cheers, Jason. |
From: Christian R. R. <ki...@as...> - 2001-08-29 03:42:34
|
On Tue, 28 Aug 2001, Jason Tackaberry wrote: > BTW, you shouldn't really need to use _load_idl(). The only time you > need to use _load_idl() is when the preprocessor is broken, in which > case that should get fixed too. (Well, another valid case to use Or when the IDL isn't in the IDLPATH, and you specify the full path. Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL |
From: Mark M. <ma...@sk...> - 2001-08-29 07:31:08
|
Hi Jason, On Tue, 28 Aug 2001, Jason Tackaberry wrote: > > struct RecursiveStruct { > > sequence <RecursiveStruct> inner_struct; > > }; > > > > interface ProblemInterface { > > attribute RecursiveStruct problem_item; > > }; > > Yep, this certainly causes nasty things. In fact, orbit-idl also > segfaults on this IDL. Maybe ORBit2's IDL compiler also has this > problem? No, ORBit2's IDL compiler has fixed this problem. If my memory serves me correctly, there's a fix for this in ORBit HEAD as well. Oh, and the Perl bindings have this problem too ;) Good Luck, Mark. |
From: Brad C. <cha...@ar...> - 2001-09-04 08:54:10
Attachments:
test_RecursiveStructs.py
|
Hey all; Thanks for the responses on this. [I talk about a seg-fault problem caused by self-referencing structs] Jason: > Yep, this certainly causes nasty things. In fact, orbit-idl also > segfaults on this IDL. Maybe ORBit2's IDL compiler also has this > problem? Doh, thanks -- I didn't even think of looking at orbit-idl. Well now it makes sense why I'm seeing the problem :-). Mark McLoughlin: > No, ORBit2's IDL compiler has fixed this problem. If my memory > serves me correctly, there's a fix for this in ORBit HEAD as well. Thanks for the info. I grabbed ORBit out of CVS (the stable revision), and it still seems to have the problem for me. Don't know if this'll help save any time looking at it with ORBit-python. Jason: > BTW, you shouldn't really need to use _load_idl(). Well, my use case is kind of what Christian was suggesting. I'm actually emulating stubs and skeletons (by hacking up __init__.py in one of my modules), so I just use the _load_idl() to grab the idl from a predefined location. It doesn't really affect my portability in this case, because I'm already going for portability between multiple ORBs. Thanks for the advice, though! [My minimal test case] Christian: > Minimal, but 3vil. Do you have a simple test script I can integrate > to the test-suite so we guarantee it's fixed and stays fixed > over versions? Hmmm, I'm not exactly sure if this is what you want, but the attached script will cause the seg-fault with the IDL I posted. I'm not sure if you want seg-faulting scripts in the Test Suite though :-) Brad |
From: Christian R. R. <ki...@as...> - 2001-09-04 09:48:37
|
On Tue, 4 Sep 2001, Brad Chapman wrote: > Hmmm, I'm not exactly sure if this is what you want, but the > attached script will cause the seg-fault with the IDL I posted. I'm > not sure if you want seg-faulting scripts in the Test Suite though It's exactly what I want. Test scripts that SEGV are the latest fashion in ORBit-Python; I've just discovered another three last week with using __import__() after an import CORBA. That's fun. Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL |
From: Christian R. R. <ki...@as...> - 2001-10-09 07:14:22
|
On Tue, 4 Sep 2001, Christian Robottom Reis wrote: > It's exactly what I want. Test scripts that SEGV are the latest fashion in > ORBit-Python; I've just discovered another three last week with using > __import__() after an import CORBA. That's fun. Summary: I want more SEGVs! I received your Any() patch for ORBit-Python, but since my refcounting skills are a drag, I would like to ask you for a favor. If you could send me a minimal testcase or a suggestion of one that triggers the problem, I can gdb through and understand what is happening? Deal? Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL |
From: Brad C. <cha...@ar...> - 2001-10-09 11:39:01
Attachments:
anytest.py
|
Christian: > Summary: I want more SEGVs! All right, if you insist. :-) > I received your Any() patch for ORBit-Python, but since my refcounting > skills are a drag, I would like to ask you for a favor. If you could send > me a minimal testcase or a suggestion of one that triggers the problem, I > can gdb through and understand what is happening? Deal? Sure, attached is a test that should cause either segfaults (does this on linux mandrake) or lots of memory errors about free() (on NetBSD). The patch I sent makes this simple test run smoothly. Let me know if you need more. Brad -- PGP public key available from http://pgp.mit.edu/ |
From: Christian R. R. <ki...@as...> - 2001-08-29 03:44:44
|
On Tue, 28 Aug 2001, Brad Chapman wrote: > narrowing down, it appears as if this is a minimal IDL that will > cause the problem: > > struct RecursiveStruct { > sequence <RecursiveStruct> inner_struct; > }; > > interface ProblemInterface { > attribute RecursiveStruct problem_item; > }; Minimal, but 3vil. Do you have a simple test script I can integrate to the test-suite so we guarantee it's fixed and stays fixed over versions? > The idea is that you have a struct that has, as one of its member, a > list of itself (in the IDL that I'm working on this is used to descend > a sort of "tree" of items). When a struct like this is present inside > an interface, it will cause the problem. gdb gives a trace that looks > like: By list of itself you mean "list of things of the same type as it", right? Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL |