I can try that - I actually thought exit() was safe to call from a signal handler - thanks for opening my eyes. But the interesting thing is that I can also see that my program was not in the middle of any protobuf-related stuff when it was interrupted by the signal handler - it was in a sleep. This is not a MT app. Wouldn't you think that exit() / global destruction would only cause a problem in protobuf if protobuf was interrupted by the signal, but not otherwise? Any other ideas? Thanks --edan
On Wed, Oct 21, 2009 at 8:16 PM, Kenton Varda <ken...@google.com> wrote: > It looks like you are calling exit() from a signal handler. Lots of stuff > is not safe to do in signal handlers. You should perhaps use _exit() > instead to bypass destruction of global variables. > > On Wed, Oct 21, 2009 at 6:04 AM, edan <edan...@gmail.com> wrote: > >> I have a bizarre and not very reproducible segfault / core dump, that >> happens when my program exits. >> >> Here is the stack trace: >> >> #0 0xf7becf99 in __gnu_cxx::__exchange_and_add () from >> /usr/lib/libstdc++.so.6 >> #1 0xf7f1d7f0 in __gnu_cxx::hashtable<std::pair<std::string const, >> google::protobuf::FieldDescriptorProto_Type>, std::string, >> google::protobuf::hash<std::string>, std::_Select1st<std::pair<std::string >> const, google::protobuf::FieldDescriptorProto_Type> >, >> std::equal_to<std::string>, >> std::allocator<google::protobuf::FieldDescriptorProto_Type> >::clear () from >> /usr/lib/libprotobuf.so.4 >> #2 0xf7f16818 in ?? () from /usr/lib/libprotobuf.so.4 >> #3 0xf79f30a9 in __cxa_finalize () from /lib/libc.so.6 >> #4 0xf7e9a244 in ?? () from /usr/lib/libprotobuf.so.4 >> #5 0xf7f4026c in ?? () from /usr/lib/libprotobuf.so.4 >> #6 0x0000001b in ?? () >> #7 0xf7f1d93c in _fini () from /usr/lib/libprotobuf.so.4 >> #8 0xf7f687ce in _dl_fini () from /lib/ld-linux.so.2 >> #9 0xf79f2df9 in exit () from /lib/libc.so.6 >> #10 0x08136605 in sig_handler (signum=15) at ../src/pabnagd.cc:164 >> #11 <signal handler called> >> #12 0xffffe405 in __kernel_vsyscall () >> #13 0xf7a58db6 in nanosleep () from /lib/libc.so.6 >> #14 0xf7a58ca1 in sleep () from /lib/libc.so.6 >> #15 0x08134bcb in main (argc=1, argv=0xffb926c4) at ../src/pabnagd.cc:388 >> >> Has anyone seen something like this, or have any idea how to figure out >> what the problem is? >> >> Thanks >> --edan >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---