After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 378454 - crash to ORBit_handle_request function
crash to ORBit_handle_request function
Status: RESOLVED FIXED
Product: ORBit2
Classification: Deprecated
Component: general
2.14.x
Other Linux
: Normal critical
: ---
Assigned To: ORBit maintainers
ORBit maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-23 11:25 UTC by Sebastien Bacher
Modified: 2007-06-30 11:53 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
suggested debugging aid (395 bytes, patch)
2007-02-09 02:33 UTC, Kees Cook
committed Details | Review
split the asserts (1.07 KB, patch)
2007-02-13 10:20 UTC, Kjartan Maraas
committed Details | Review

Description Sebastien Bacher 2006-11-23 11:25:18 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/evolution/+bug/67974

"I don't know how to reproduce this, but Evolution had crashed recently.
...
http://librarian.launchpad.net/4932391/_usr_lib_evolution_2.8_evolution-alarm-notify.1000.crash
complete report from crash utility (I thought I had debug pacakges, but don't see debug info here)

D'oh! That was the wrong crash report -- here is the right one....

  • #0 strcmp
    from /lib/tls/i686/cmov/libc.so.6
  • #1 IA__g_str_equal
    at gstring.c line 77
  • #2 IA__g_hash_table_lookup
    at ghash.c line 240
  • #3 ORBit_handle_request
    at orbit-adaptor.c line 192
  • #4 giop_connection_handle_input
    at giop-recv-buffer.c line 1288
  • #5 link_connection_io_handler
    at linc-connection.c line 1417
  • #6 link_source_dispatch
    at linc-source.c line 159
  • #7 IA__g_main_context_dispatch
    at gmain.c line 2045
  • #8 g_main_context_iterate
    at gmain.c line 2677
  • #9 IA__g_main_loop_run
    at gmain.c line 2881
  • #10 link_io_thread_fn
    at linc.c line 396
..."
Comment 1 Kjartan Maraas 2007-01-16 15:59:03 UTC
Without a way to reproduce this it's impossible to find the cause. Closing as incomplete. Please file a new bug if it happens again. Thanks for your report.
Comment 2 Sebastien Bacher 2007-01-16 18:04:56 UTC
Reopening and changing the product to ORBit2, Ubuntu got a bunch of duplicates from that crash, often on gaim. The crashes apparently happen when halting the computer with the application running
Comment 3 Michael Meeks 2007-01-17 12:01:41 UTC
very odd - of course we shouldn't crash.

Kjartan, I'm concerned about this:

g_assert(g_hash_table_remove(orb->forw_binds,
         objectId));

is it possible that assertions (or something) are being turned off in Ubuntu ? - if so, that might not get executed & cause problems later. Can we split that into 2 lines:

gboolean removed = g_hash ...
g_assert (removed);

otherwise I can't see how this could crash (cf. forw_bind)...
Comment 4 Sebastien Bacher 2007-01-20 15:08:21 UTC
The build is a normal one with no assertion change, backtrace from a debug build:

  • #0 strcmp
    from /lib/tls/i686/cmov/libc.so.6
  • #1 IA__g_str_equal
    at gstring.c line 77
  • #2 IA__g_hash_table_lookup
    at ghash.c line 240
  • #3 ORBit_demarshal_IOR
    at iop-profiles.c line 1707
  • #4 giop_recv_buffer_demarshal_locate_request_1_1
    at giop-recv-buffer.c line 313
  • #5 ORBit_poa_allow_cross_thread_call
    at poa.c line 2529
  • #6 DynamicAny_DynAny_destroy
    at dynany.c line 811
  • #7 ??

Comment 5 Sebastien Bacher 2007-02-07 12:31:44 UTC
Do you need any other information? The Ubuntu bug has over 30 duplicates which means it happen pretty often, bugzilla probably has not that many bugs about because bug-buddy doesn't dump somewhere crashes happening on logout for example
Comment 6 Kees Cook 2007-02-09 02:31:35 UTC
Seems that some other thread has shutdown that CORBA_ORB (via CORBA_ORB_destroy), and has started free'ing its memory.  In the coredumps, you can see that the lock has been dropped, and the life flags shows it as dead:

(gdb) up
  • #3 ORBit_handle_request
    at orbit-adaptor.c line 192
$1 = (CORBA_ORB) 0x8086298
(gdb) print orb->lock
$2 = (GMutex *) 0x0
(gdb) print orb->life_flags
$3 = 1024

./include/orbit/poa/poa-types.h:#define ORBit_LifeF_Destroyed           (1<<10)


Since LINK_MUTEX_LOCK only locks if !NULL, ORBit_forw_bind_find (via ORBit_handle_request), attempts to access the hash anyway.

I can't actually reproduce this crash, but perhaps adding:

  orb->forw_binds = NULL;

after the "g_hash_table_destroy (orb->forw_binds);" in CORBA_ORB_destroy may help spark some more asserts, since this code would get hit:

            tprintf ("Error: failed to find adaptor or objkey for "
                 "object while invoking method '%s'",
                 giop_recv_buffer_get_opname (recv_buffer));

Comment 7 Kees Cook 2007-02-09 02:33:27 UTC
Created attachment 82203 [details] [review]
suggested debugging aid
Comment 8 Michael Meeks 2007-02-09 10:10:02 UTC
Kees - interesting; if we shut-down the ORB I guess we should -really- wait until the incoming I/O thread has also shut-down. ORB shutdown is one of those problematic things that we never quite finished :-)

OTOH - I'm well up for your patch to help debugging, particularly if it turns a crash into a warning; can you commit ?
Comment 9 Kees Cook 2007-02-09 17:25:25 UTC
Michael, I don't have an svn account yet, but Seb said he'd do the commit for me.  I wasn't sure where the thread management was being done, so I didn't debug it any further.  Is it a simple case to flush IO and shut down those threads before shutting down ORB?  That's the "real" bug here.  :)
Comment 10 Sebastien Bacher 2007-02-09 18:24:57 UTC
debug patch commited:

2007-02-09  Sebastien Bacher  <seb128@ubuntu.com>

	* src/orb/orb-core/corba-orb.c: (CORBA_ORB_destroy):
	  - explicitly set variable for better debugging, patch by Kees Cook 
Comment 11 Kjartan Maraas 2007-02-12 12:09:59 UTC
Should we still split up the assert above?
Comment 12 Michael Meeks 2007-02-12 12:26:54 UTC
sure, why not - can't do any harm - can you handle Kjartan ? :-) [ thanks ].
Comment 13 Kjartan Maraas 2007-02-13 10:20:51 UTC
Created attachment 82450 [details] [review]
split the asserts

Does this look like it does what you intended? g_hash_table_lookup returns a gpointer so I used that instead.
Comment 14 Kjartan Maraas 2007-02-13 10:21:51 UTC
Marking the other as commited.
Comment 15 Michael Meeks 2007-02-13 11:24:33 UTC
looks lovely to me - thanks Kjartan :-)
Comment 16 Kjartan Maraas 2007-06-20 10:42:46 UTC
Has anyone seen the original problem since this was done?
Comment 17 Sebastien Bacher 2007-06-20 11:00:56 UTC
The Ubuntu bug has not recent duplicate
Comment 18 Vincent Untz 2007-06-30 11:02:23 UTC
Time to close this bug, then?
Comment 19 Sebastien Bacher 2007-06-30 11:53:46 UTC
closing, I'll reopen if there is a new duplicate