Intermittently fails to load on amd64
Bug #72639 reported by
Troy James Sobotka
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GLibC |
Fix Released
|
Medium
|
|||
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Matthias Klose |
Bug Description
Binary package hint: evolution
Occasionally, when attempting to launch Evolution, the main window does not load after displaying the Evolution Starting window.
Subsequent loads might or might not work.
Eventually, you will manage to get it to load.
Changed in glibc: | |
status: | Unknown → Fix Released |
Changed in glibc: | |
assignee: | nobody → doko |
status: | Unconfirmed → In Progress |
status: | In Progress → Fix Committed |
Changed in glibc: | |
importance: | Unknown → Medium |
To post a comment you must log in.
While running some stress tests on one of our application, we encountered an
assert() in ld.so as follows:
"Inconsistency detected by ld.so: dl-open.c: 610: _dl_open: Assertion initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
`_dl_debug_
with glibc-2.4.31. This race seems to be present in the libc I got from the CVS
[at code inspection]. We were able to reproduce this consistently within 4-5hrs
of run.
Upon debugging we found that it is due to a race between two threads doing a
_dl_open().
The scenario is something like this :
In elf/dl-open.c, _dl_open:
/* Make sure we are alone. */ lock_lock_ recursive (GL(dl_load_lock));
__rtld_
[...]
int errcode = _dl_catch_error (&objname, &errstring, &malloced,
dl_ open_worker, &args);
#ifndef MAP_COPY
/* We must munmap() the cache file. */
_dl_unload_cache ();
#endif
/* Release the lock. */ lock_unlock_ recursive (GL(dl_load_lock));
__rtld_
^^^^^ This would kick any other thread waiting on the lock.
if (__builtin_expect (errstring != NULL, 0)) initialize (0, args.nsid)->r_state == RT_CONSISTENT);
{
[...]
assert (_dl_debug_
}
assert (_dl_debug_ initialize (0, args.nsid)->r_state == RT_CONSISTENT);
And, if the thread which gets woken up is playing with the same namespace, and object_ from_fd even before we reach here
sets the r_state to RT_ADD in _dl_map_
(truly possible in an SMP system), ( due to getting scheduled out ), we would
hit the assert !
So, it is not safe to believe that the r_state won't get changed once we release
the lock.