[Issue 11981] unittest 'host' deadlock

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 8 18:07:17 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11981



--- Comment #5 from Stanislav Blinov <stanislav.blinov at gmail.com> 2014-02-08 18:07:14 PST ---
Ok, I've built druntime with -g -debug and built a modified host.c that runs
infinitely to eventually hit that deadlock:

--- host.c      2014-02-09 01:45:36.399539870 +0400
+++ host_.c      2014-02-09 05:40:45.885080082 +0400

@@ -5,6 +5,7 @@

 int main(int argc, char* argv[])
 {
+while(1) {
     const size_t pathlen = strrchr(argv[0], '/') - argv[0] + 1;
     char *name = malloc(pathlen + sizeof("plugin1.so"));
     memcpy(name, argv[0], pathlen);
@@ -46,5 +47,6 @@
     assert(dlclose(plugin1) == 0);

     free(name);
+}
     return EXIT_SUCCESS;
 }

Here's the stacktrace:

Thread 4 (Thread 0x7ffff6a05700 (LWP 16188)):
#0  __lll_lock_wait_private () at
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007ffff7675fcc in _L_lock_11850 () at malloc.c:5151
#2  0x00007ffff7673575 in __GI___libc_malloc (bytes=88) at malloc.c:2856
#3  0x00007ffff7ddb2cd in allocate_and_init (map=0x603610) at dl-tls.c:529
#4  tls_get_addr_tail (ti=0x7ffff73dcb28, dtv=0x611d00, the_map=0x603610) at
dl-tls.c:742
#5  0x00007ffff71816e4 in core.thread.thread_suspendHandler() (this=0x0,
sp=0x7ffff6a046c0) at src/core/thread.d:1069
#6  0x00007ffff718387f in core.thread.callWithStackShell() (fn=...) at
src/core/thread.d:2085
#7  0x00007ffff71816bd in thread_suspendHandler (sig=10) at
src/core/thread.d:411
#8  <signal handler called>
#9  0x00007ffff7673564 in __GI___libc_malloc (bytes=16) at malloc.c:2856
#10 0x00007ffff71811c7 in thread_entryPoint (arg=0x0) at src/rt/tlsgc.d:34
#11 0x00007ffff79c0f8e in start_thread (arg=0x7ffff6a05700) at
pthread_create.c:311
#12 0x00007ffff76eaa0d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7ffff7fc8740 (LWP 16182)):
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1  0x00007ffff7183940 in core.thread.suspend() (t=0x7ffff7ec8c00) at
src/core/thread.d:2244
#2  0x00007ffff7183bcd in thread_suspendAll () at src/core/thread.d:2322
#3  0x00007ffff7194300 in gc.gc.Gcx.fullcollect() (this=0x6056d0) at
src/gc/gc.d:2389
#4  0x00007ffff71919cd in gc.gc.GC.fullCollect() (this=0x6056a0) at
src/gc/gc.d:1156
#5  0x00007ffff71971fa in gc_collect () at src/gc/proxy.d:165
#6  0x00007ffff717fb79 in core.memory.GC.collect() () at src/core/memory.d:168
#7  0x00007ffff6a07449 in runTests () at plugin.d:24
#8  0x0000000000400a6b in main (argc=1, argv=0x7fffffffdcc8) at host.c:31


Reposting machine details:

$uname -a

Linux 3.8.0-26-generic #38-Ubuntu SMP Mon Jun 17 21:43:33 UTC 2013 x86_64
x86_64 x86_64 GNU/Linux

$ldd --version

ldd (Ubuntu EGLIBC 2.17-0ubuntu5.1) 2.17

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list