Re: [orbitcpp-list] segmentation faults
Status: Beta
Brought to you by:
philipd
From: Brian M. <ba...@sn...> - 2001-12-08 01:15:26
|
>>>>> "Sam" == Sam Couter <sa...@to...> writes: Sam> Brian May <ba...@sn...> wrote: >> I have looked up the C++ language mapping standard, but can't >> find anything on activating or deactivating objects. Sam> Phil got some code working before Real Life took him away Sam> from the project. His instructions are in the archive at: Sam> http://www.geocrawler.com/mail/msg.php3?msg_id=4560050&list=835 Thanks. Although now I realize that my code won't even execute up to that point :-( after much experimentation with other crashes, I seem to have fixed them for now... ...now even gdb is crashing: [544] [scrooge:bam] ~/cvswork/atcsim/src >gdb ./aircrafts GNU gdb 5.0.90-cvs (MI_OUT) Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"... (gdb) r Starting program: /home/bam/cvswork/atcsim/src/./aircrafts zsh: segmentation fault gdb ./aircrafts Oops! maybe I should have stayed in bed :-( lets try a different approach: [544] [scrooge:bam] ~/cvswork/atcsim/src >ulimit -c unlimited [547] [scrooge:bam] ~/cvswork/atcsim/src >gdb ./aircrafts core GNU gdb 5.0.90-cvs (MI_OUT) Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"... Core was generated by `./aircrafts'. Program terminated with signal 11, Segmentation fault. (gdb) bt #0 0xbffff797 in ?? () #1 0x400992c8 in _orbitcpp::release_guarded () from /usr/lib/liborbitcpp.so.0 #2 0x08069571 in CORBA::release (o=0xbffff71c) at /usr/include/orb/orbitcpp_object.hh:110 #3 0x0806a686 in _orbitcpp::ObjectPtr_var<Atcsim::A_Aircraft, _orbitcpp::stub::Atcsim::A_Aircraft *>::free (this=0xbffff634) at /usr/include/orb/orbitcpp_smartptr.hh:122 #4 0x08069bd7 in _orbitcpp::ObjectPtr_var<Atcsim::A_Aircraft, _orbitcpp::stub::Atcsim::A_Aircraft *>::~ObjectPtr_var (this=0xbffff634, __in_chrg=2) at /usr/include/orb/orbitcpp_smartptr.hh:76 #5 0x08068b2e in Aircrafts_impl::destroy (this=0xbffff95c, aref=@0xbffff6a4) at aircrafts.cc:113 This is probably one big problem with using CORBA C and C++ bindings, it is so easy to do something wrong, but the error doesn't show up until much later :-(. Anyway, the code in question at line 113 of aircrafts.cc is A_Aircraft_var aircraft_var = aref.aircraft; where aref is a CORBA structure containing a member "aircraft" which is a reference to a CORBA interface. I am trying to copy the reference to another variable. Am I doing anything wrong here? Oh, one other question, perhaps more CORBA specific, how do people choose CORBA variable/interface/type names? Traditionally, I use: type=NOUN variable=noun However, this doesn't work in CORBA, because (IIRC) some languages do not support distinguishing lower case from upper case. So I have tried: type=A_NOUN variable=noun However, not only does that look ugly, but it triggers the warning that underscores should be avoided. -- Brian May <ba...@sn...> |