[Issue 2890] New: std.stdio.write family blocks on file lock
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Apr 24 17:15:15 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2890
Summary: std.stdio.write family blocks on file lock
Product: D
Version: 2.029
Platform: PC
OS/Version: Linux
Status: NEW
Severity: major
Priority: P2
Component: Phobos
AssignedTo: bugzilla at digitalmars.com
ReportedBy: graham.stjack at internode.on.net
In multi-threaded applications, File.LockingTextWriter is not correctly
locking/unlocking the underlying FILE* handle, resulting in deadlocks. The more
trace prints you put in to find the problem, the worse it gets.
The problem seems to be related to recent dmd bug-fixes, and I worked around it
with the following change. It looks like LockingTextWriter needs to be
revisited, maybe by reinstating the non-hacked implementation.
$ diff dmd/src/phobos/std/stdio.d stdio.d
922c922
< //return LockingTextWriter(this);
---
> return LockingTextWriter(this);
925,926c925,926
< auto result = LockingTextWriter(this);
< return result;
---
> //auto result = LockingTextWriter(this);
> //return result;
--
More information about the Digitalmars-d-bugs
mailing list