new(malloc) locks everything in multithreading

tcak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 24 11:38:39 PDT 2014


On Friday, 24 October 2014 at 16:51:02 UTC, Kapps wrote:
> On Friday, 24 October 2014 at 10:49:42 UTC, tcak wrote:
>
> Not sure if this is the same issue, but by default gdb breaks 
> on signals that the GC uses, which would explain why it's 
> breaking in gdb but not normally.
>
> What happens if you try:
> handle SIGUSR1 noprint nostop
> handle SIGUSR2 noprint nostop
>
> In GDB before starting execution of the program?

This is what I did on shell: (I put some spaces for readability)

tolga at tolga:~/dev/d/bug$ dmd -gc -debug test.d

tolga at tolga:~/dev/d/bug$ gdb ./test

GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show 
copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./test...done.

(gdb) run

Starting program: /home/tolga/dev/d/bug/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff75ed700 (LWP 4940)]

Program received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x7ffff75ed700 (LWP 4940)]
__lll_lock_wait_private () at 
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95	../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such 
file or directory.

(gdb) backtrace full

#0  __lll_lock_wait_private () at 
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
No locals.
#1  0x00007ffff7bc52f1 in _L_lock_3358 () from 
/lib/x86_64-linux-gnu/libpthread.so.0
No symbol table info available.
#2  0x00007ffff7bc4382 in start_thread (arg=0x7ffff75ed700) at 
pthread_create.c:301
         oldtype = 0
         pd = 0x7ffff75ed700
         now = <optimised out>
         unwind_buf = {cancel_jmp_buf = {{jmp_buf = 
{140737343575808, 9112392114346628883, 1, 0,
                 140737343576512, 140737343575808, 
-9112375355952097517, -9112375093712283885},
               mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 
0x0}, data = {prev = 0x0,
               cleanup = 0x0, canceltype = 0}}}
         not_first_call = <optimised out>
         pagesize_m1 = <optimised out>
         sp = <optimised out>
         freesize = <optimised out>
         __PRETTY_FUNCTION__ = "start_thread"
#3  0x00007ffff76e8fbd in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:111
No locals.

(gdb)


More information about the Digitalmars-d-learn mailing list