www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2890] New: std.stdio.write family blocks on file lock

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: graham.stjack 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;
--
Apr 24 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2890






Created an attachment (id=339)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=339&action=view)
A test-case

This is more complicated than it needs to be, but I already had it lying about
for another bug report. If deadlocks at various points using dmd 2.029, but
when I modify std.stdio as described in the bug report, it works every time.


-- 
Apr 24 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2890


dsimcha yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha yahoo.com





*** Bug 2907 has been marked as a duplicate of this bug. ***


-- 
Apr 30 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2890


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





12:19:25 PDT ---
Fixed dmd 2.030

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