[Issue 18052] New: LockingTextWriter is not thread safe
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Dec 10 01:11:02 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=18052
Issue ID: 18052
Summary: LockingTextWriter is not thread safe
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
IM writes:
For purposes of debugging, I'm using writeln() to print stuff out from tasks
running concurrently on many threads. At some point it crashes with the
following stack trace:
Thread 4 received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x7ffff5ec2700 (LWP 19267)]
__lll_lock_wait_private () at
../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95 ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or
directory.
(gdb) bt
#0 __lll_lock_wait_private () at
../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007ffff7bcb2d5 in __flockfile (stream=0x7ffff728b780
<_IO_stdfile_1_lock>) at ../sysdeps/pthread/flockfile.c:28
#2 0x000000000045f5b0 in
_D3std5stdio4File17LockingTextWriter6__ctorMFNcNeKSQBxQBwQBtZSQCiQChQCeQCc ()
#3 0x000000000045f670 in
_D3std5stdio4File17lockingTextWriterMFNfZSQBoQBnQBk17LockingTextWriter ()
#4 0x000000000044a1e0 in _D3std5stdio4File__T5writeTAyaTyiTaZQqMFNfQpyiaZv
(this=..., _param_2=10 '\n', _param_1=12, _param_0=...)
at /usr/include/dmd/phobos/std/stdio.d:1399
Note that I didn't add any synchronizations around the writeln() calls, should
I? I assume the implementation *should* synchronize access to std_out, no?
--
More information about the Digitalmars-d-bugs
mailing list