www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11594] New: synchronized causing segfault instead of Error.

https://d.puremagic.com/issues/show_bug.cgi?id=11594

           Summary: synchronized causing segfault instead of Error.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: shammah.chancellor gmail.com


--- Comment #0 from Shammah Chancellor <shammah.chancellor gmail.com>
2013-11-24 11:42:32 PST ---
I'm not sure why this segfaults, since core.sync.mutex has an in contract to
check for null?  I am compiling in debug mode.

import std.stdio;

private Object mut;// = new Object();                                           

void lockedFunction()
{
  synchronized(mut)  //I asume this makes does auto mutex = new Mutex(mut) and
then mutex.lock()?
    {
      writefln("Whoops");
    } //mutex.unlock();?

   /* Also results in segfault:
  auto mutex = new Mutex(mut);
  mutex.lock();
      writefln("Whoops");
  mutex.unlock();
*/
}

void main()
{
  lockedFunction();
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 24 2013