GNOME Bugzilla – Bug 326283
Invalid read in orbit-adaptor.c
Last modified: 2006-01-26 10:33:57 UTC
Valgrind reported this when running a gnome session with it: ==25705== 1 errors in context 1 of 6: ==25705== Invalid read of size 4 ==25705== at 0x4B00474: ORBit_adaptor_find (orbit-adaptor.c:164) ==25705== by 0x4B00796: ORBit_handle_request (orbit-adaptor.c:255) ==25705== by 0x4AE48AE: giop_connection_handle_input (giop-recv-buffer.c:1282) ==25705== by 0x4B07D88: link_connection_io_handler (linc-connection.c:1367) ==25705== by 0x4B0A0DA: link_source_dispatch (linc-source.c:159) ==25705== by 0x4BCA0DA: g_main_dispatch (gmain.c:1916) ==25705== by 0x4BCB5BA: g_main_context_dispatch (gmain.c:2466) ==25705== by 0x4BCBB34: g_main_context_iterate (gmain.c:2547) ==25705== by 0x4BCC306: g_main_loop_run (gmain.c:2751) ==25705== by 0x4B05DF8: link_io_thread_fn (linc.c:394) ==25705== by 0x4BE9B56: g_thread_create_proxy (gthread.c:582) ==25705== by 0x4B94261: start_thread (pthread_create.c:261) ==25705== by 0x4CF918D: clone (in /lib/libc-2.3.90.so) ==25705== Address 0x18 is not stack'd, malloc'd or (recently) free'd This is from Thread 2 in the drivemount applet from what I can tell.
This should fix it: --- src/orb/poa/orbit-adaptor.c 2 Jul 2005 11:55:25 -0000 1.27 +++ src/orb/poa/orbit-adaptor.c 9 Jan 2006 10:44:56 -0000 @@ -159,14 +159,13 @@ ORBit_adaptor_find (CORBA_ORB orb, ORBit LINK_MUTEX_LOCK (ORBit_RootObject_lifecycle_lock); { - adaptor = g_ptr_array_index (orb->adaptors, adaptorId); - - if (memcmp (objkey->_buffer, - adaptor->adaptor_key._buffer, - ORBIT_ADAPTOR_PREFIX_LEN)) - adaptor = NULL; - else - ORBit_RootObject_duplicate_T (adaptor); + if ((adaptor = g_ptr_array_index (orb->adaptors, adaptorId))) + if (memcmp (objkey->_buffer, + adaptor->adaptor_key._buffer, + ORBIT_ADAPTOR_PREFIX_LEN)) + adaptor = NULL; + else + ORBit_RootObject_duplicate_T (adaptor); } LINK_MUTEX_UNLOCK (ORBit_RootObject_lifecycle_lock); Any chance you can test / commit ? :-)
Can I drop the unneeded () in the if ((adaptor = ...)))?
Guess not since the compiler will complain then.
Commited.
*** Bug 328512 has been marked as a duplicate of this bug. ***
*** Bug 327971 has been marked as a duplicate of this bug. ***