public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/27170] New: Deadlock in garbage collector
@ 2006-04-14 18:57 green at redhat dot com
2006-04-14 18:58 ` [Bug libgcj/27170] " green at redhat dot com
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: green at redhat dot com @ 2006-04-14 18:57 UTC (permalink / raw)
To: java-prs
I believe I've identified a deadlock that is periodically reproducible
with Eclipse running on FC5. I'll attach the stack trace to this bug
report. See threads 4 and 13.
1. Thread 4 aquires the GC lock and starts a GC
2. Thread 13 dlopens a .so, acquiring a glibc maintained lock
3. Thread 13 tries to acquire the GC lock while registering classes
4. Thread 4 tries to acquire the glibc lock in dl_iterate_phdr
...and we're deadlocked.
--
Summary: Deadlock in garbage collector
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: green at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
@ 2006-04-14 18:58 ` green at redhat dot com
2006-04-14 20:51 ` Hans dot Boehm at hp dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: green at redhat dot com @ 2006-04-14 18:58 UTC (permalink / raw)
To: java-prs
------- Comment #1 from green at redhat dot com 2006-04-14 18:58 -------
Created an attachment (id=11273)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11273&action=view)
stack traces from gdb.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
2006-04-14 18:58 ` [Bug libgcj/27170] " green at redhat dot com
@ 2006-04-14 20:51 ` Hans dot Boehm at hp dot com
2006-04-14 21:01 ` green at redhat dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Hans dot Boehm at hp dot com @ 2006-04-14 20:51 UTC (permalink / raw)
To: java-prs
------- Comment #2 from Hans dot Boehm at hp dot com 2006-04-14 20:51 -------
Based on the thread 13 stack trace, it looks to me like we're calling dlopen
directly, when we should somehow be arranging to call GC_dlopen. GC_dlopen is
included in the GC to avoid this sort of deadlock.
(The way GC_dlopen does this is by waiting for, and then disabling, GC during
dlopen. That's not a great solution, since it can cause unneeded heap growth
in the presence of frequent dlopens. It should perhaps conditionally trigger a
GC before disabling it. But in any case, calling GC_dlopen is much better than
generating a deadlock.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
2006-04-14 18:58 ` [Bug libgcj/27170] " green at redhat dot com
2006-04-14 20:51 ` Hans dot Boehm at hp dot com
@ 2006-04-14 21:01 ` green at redhat dot com
2006-04-17 14:43 ` green at redhat dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: green at redhat dot com @ 2006-04-14 21:01 UTC (permalink / raw)
To: java-prs
------- Comment #3 from green at redhat dot com 2006-04-14 21:01 -------
(In reply to comment #2)
> Based on the thread 13 stack trace, it looks to me like we're calling dlopen
> directly, when we should somehow be arranging to call GC_dlopen. GC_dlopen is
> included in the GC to avoid this sort of deadlock.
Thanks Hans. I'll try making this change to see what happens.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
` (2 preceding siblings ...)
2006-04-14 21:01 ` green at redhat dot com
@ 2006-04-17 14:43 ` green at redhat dot com
2006-04-17 14:44 ` green at redhat dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: green at redhat dot com @ 2006-04-17 14:43 UTC (permalink / raw)
To: java-prs
------- Comment #4 from green at redhat dot com 2006-04-17 14:43 -------
Created an attachment (id=11283)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11283&action=view)
Sample patch
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
` (3 preceding siblings ...)
2006-04-17 14:43 ` green at redhat dot com
@ 2006-04-17 14:44 ` green at redhat dot com
2006-04-17 16:00 ` tromey at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: green at redhat dot com @ 2006-04-17 14:44 UTC (permalink / raw)
To: java-prs
------- Comment #5 from green at redhat dot com 2006-04-17 14:44 -------
I've uploaded a patch that I've applied to the FC5 gcc RPM. I can't reproduce
the problem with this patch.
--
green at redhat dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |green at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
` (4 preceding siblings ...)
2006-04-17 14:44 ` green at redhat dot com
@ 2006-04-17 16:00 ` tromey at gcc dot gnu dot org
2006-04-20 23:48 ` bryce at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-04-17 16:00 UTC (permalink / raw)
To: java-prs
------- Comment #6 from tromey at gcc dot gnu dot org 2006-04-17 16:00 -------
We could either use <gc.h> here (see ltdl.c) or we could
use libltdl instead of directly using dlopen...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
` (5 preceding siblings ...)
2006-04-17 16:00 ` tromey at gcc dot gnu dot org
@ 2006-04-20 23:48 ` bryce at gcc dot gnu dot org
2006-04-20 23:52 ` bryce at gcc dot gnu dot org
2006-04-20 23:55 ` mckinlay at redhat dot com
8 siblings, 0 replies; 10+ messages in thread
From: bryce at gcc dot gnu dot org @ 2006-04-20 23:48 UTC (permalink / raw)
To: java-prs
------- Comment #7 from bryce at gcc dot gnu dot org 2006-04-20 23:48 -------
Subject: Bug 27170
Author: bryce
Date: Thu Apr 20 23:47:56 2006
New Revision: 113123
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113123
Log:
PR libgcj/27170
* gnu/gcj/runtime/natSharedLibLoader.cc: Include gc.h to override
dlopen(). From Anthony Green.
Modified:
trunk/libjava/ChangeLog
trunk/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
` (6 preceding siblings ...)
2006-04-20 23:48 ` bryce at gcc dot gnu dot org
@ 2006-04-20 23:52 ` bryce at gcc dot gnu dot org
2006-04-20 23:55 ` mckinlay at redhat dot com
8 siblings, 0 replies; 10+ messages in thread
From: bryce at gcc dot gnu dot org @ 2006-04-20 23:52 UTC (permalink / raw)
To: java-prs
------- Comment #8 from bryce at gcc dot gnu dot org 2006-04-20 23:52 -------
Subject: Bug 27170
Author: bryce
Date: Thu Apr 20 23:52:14 2006
New Revision: 113124
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113124
Log:
PR libgcj/27170
* gnu/gcj/runtime/natSharedLibLoader.cc: Include gc.h to override
dlopen(). From Anthony Green.
Modified:
branches/gcc-4_1-branch/libjava/ChangeLog
branches/gcc-4_1-branch/libjava/gnu/gcj/runtime/natSharedLibLoader.cc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libgcj/27170] Deadlock in garbage collector
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
` (7 preceding siblings ...)
2006-04-20 23:52 ` bryce at gcc dot gnu dot org
@ 2006-04-20 23:55 ` mckinlay at redhat dot com
8 siblings, 0 replies; 10+ messages in thread
From: mckinlay at redhat dot com @ 2006-04-20 23:55 UTC (permalink / raw)
To: java-prs
------- Comment #9 from mckinlay at redhat dot com 2006-04-20 23:55 -------
I have checked in the fix to the trunk and gcc-4_1-branch.
--
mckinlay at redhat dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27170
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-04-20 23:55 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-14 18:57 [Bug libgcj/27170] New: Deadlock in garbage collector green at redhat dot com
2006-04-14 18:58 ` [Bug libgcj/27170] " green at redhat dot com
2006-04-14 20:51 ` Hans dot Boehm at hp dot com
2006-04-14 21:01 ` green at redhat dot com
2006-04-17 14:43 ` green at redhat dot com
2006-04-17 14:44 ` green at redhat dot com
2006-04-17 16:00 ` tromey at gcc dot gnu dot org
2006-04-20 23:48 ` bryce at gcc dot gnu dot org
2006-04-20 23:52 ` bryce at gcc dot gnu dot org
2006-04-20 23:55 ` mckinlay at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).