Re: Help with core dump



Richard Andrews wrote:

--- Nick Glencross <nickg glencros demon co uk> wrote:
#6  0x401a6601 in CORBA_ORB_shutdown (orb=0x806c240,
   wait_for_completion=1 '\001', ev=0xbffff180) at corba-orb.c:1133
#7  0x401a669c in CORBA_ORB_destroy (orb=0x806c240, ev=0xbffff180)
   at corba-orb.c:1163
#8  0x401a52b2 in shutdown_orb () at corba-orb.c:255
#9  0x4034d1a0 in exit () from /lib/libc.so.6
#10 0x40337114 in __libc_start_main () from /lib/libc.so.6
#11 0x08052a61 in _start ()


Is atexit() registered to call shutdown_orb()? Looks like main() has
finished and atexit() is cleaning up.

The usual server pattern is for main() not to finish until _after_ the
ORB has been shut down.

I would suggest that shutdown_orb() is being called from two different
places, the second being via the atexit() function after main()
finishes. This could result in the second shutdown trying to deallocate
memory which is already deallocated.

If you can run the process in a debugger, I would put a breakpoint in
shutdown_orb() or downstream like ORBit_POA_deactivate() to see if this
stuff gets called twice.

I shall give that a go in the morning. I have been experimenting with simpler examples, and it looks like as soon as I start submitting the Object pointer to a thread through a queue that things break. I am attaching the example for anyone that would like to see what I've been doing.

What I've done (perhaps incorrectly) is have a method spawn the thread which waits for a task to be submitted (where the task is simply another Object pointer, which is duplicated as I believe that it should be). The thread then simply invokes 'ping' on this Object, which is where it dies.

Thanks,

Nick Glencross
Index: configure.in
===================================================================
RCS file: /cvs/gnome/orbitcpp/configure.in,v
retrieving revision 1.25
diff -r1.25 configure.in
128a129,131
>       test/cpp/helloworld-remote/Makefile
>         test/cpp/helloworld-remote/generated/Makefile
> 
Index: test/cpp/Makefile.am
===================================================================
RCS file: /cvs/gnome/orbitcpp/test/cpp/Makefile.am,v
retrieving revision 1.6
diff -r1.6 Makefile.am
1c1
< SUBDIRS = any arrays sequences structs unions helloworld struct-simple everything poa factory
---
> SUBDIRS = any arrays sequences structs unions helloworld helloworld-remote struct-simple everything poa factory
Index: test/cpp/Makefile.am_fragment
===================================================================
RCS file: /cvs/gnome/orbitcpp/test/cpp/Makefile.am_fragment,v
retrieving revision 1.3
diff -r1.3 Makefile.am_fragment
5c5
<   -Igenerated \
---
>   -Igenerated `pkg-config --cflags glibmm-2.4` \

Attachment: segfault.tar.gz
Description: GNU Zip compressed data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]