www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6155] New: thread message boxes block infinitely with OnCrowding.block

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6155

           Summary: thread message boxes block infinitely with
                    OnCrowding.block
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: edelkind+puremagic gmail.com



13:28:21 PDT ---
Created an attachment (id=997)
Code to demonstrate OnCrowding.block deadlock

When std.concurrency.setMaxMailboxSize(..., OnCrowding.block) is used, and the
mailbox fills (thus calling m_notFull.wait() ), the corresponding notify
procedure is never called, and the threads deadlock.

This is due to the fact that m_count is not always incremented correctly, and
can become 0xffffffff (-1).  When mboxFull() checks the length of the list, it
sees an astronomical size, thus never returns false.

A test case is attached (messagebox.d).
I will attach a patch as well.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6155




13:33:11 PDT ---
Created an attachment (id=998)
patch to fix OnCrowding.block deadlock issue

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 14 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6155




13:19:51 PDT ---
Since the github commit doesn't reference this issue number, it should be noted
that the bug has been fixed in this git revision:

https://github.com/klickverbot/phobos/commit/10243e8110ce6303f7abe5b8f149f3ff2b8a2cd1

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 08 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6155


klickverbot <code klickverbot.at> changed:

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



---
Oh, sorry, I must have somehow forgotten to close your bug report, as I have
independently discovered it as well…

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