Thread overview
DMD Deadlocks
Mar 19, 2012
Benjamin Thaut
Mar 19, 2012
Sean Kelly
Mar 19, 2012
Benjamin Thaut
Mar 19, 2012
Sean Kelly
Mar 19, 2012
Trass3r
March 19, 2012
Hi,

I somehow hit a bug where dmd deadlocks within Mem::Free if I use -inline. With previous bugs I was able to reduce my code using DustMite but with this one it is hard because dmd gives no output and just freezes. Any ideas how I could reduce my code?

Callstack:
kernel32.dll!_WaitForSingleObject@8()  + 0x12 Bytes	
dmd.exe!__WaitSemaphore()  + 0x1c Bytes	C++
dmd.exe!Mem::free(void *)()  Zeile 95 + 0x8 Bytes	C++
dmd.exe!Array::~Array()()  Zeile 59 + 0x10 Bytes	C++
dmd.exe!main()  Zeile 1431 + 0x26 Bytes	C++


Kind Regards
Benjamin Thaut
March 19, 2012
On Mar 19, 2012, at 10:58 AM, Benjamin Thaut wrote:
> 
> I somehow hit a bug where dmd deadlocks within Mem::Free if I use -inline. With previous bugs I was able to reduce my code using DustMite but with this one it is hard because dmd gives no output and just freezes. Any ideas how I could reduce my code?
> 
> Callstack:
> kernel32.dll!_WaitForSingleObject@8()  + 0x12 Bytes
> dmd.exe!__WaitSemaphore()  + 0x1c Bytes	C++
> dmd.exe!Mem::free(void *)()  Zeile 95 + 0x8 Bytes	C++
> dmd.exe!Array::~Array()()  Zeile 59 + 0x10 Bytes	C++
> dmd.exe!main()  Zeile 1431 + 0x26 Bytes	C++

What are the callstacks of the other threads?
March 19, 2012
> I somehow hit a bug where dmd deadlocks within Mem::Free if I use -inline. With previous bugs I was able to reduce my code using DustMite but with this one it is hard because dmd gives no output and just freezes. Any ideas how I could reduce my code?

You could play with DustMite + timeout.
March 19, 2012
Am 19.03.2012 19:08, schrieb Sean Kelly:
>
> On Mar 19, 2012, at 10:58 AM, Benjamin Thaut wrote:
>>
>> I somehow hit a bug where dmd deadlocks within Mem::Free if I use -inline. With previous bugs I was able to reduce my code using DustMite but with this one it is hard because dmd gives no output and just freezes. Any ideas how I could reduce my code?
>>
>> Callstack:
>> kernel32.dll!_WaitForSingleObject@8()  + 0x12 Bytes	
>> dmd.exe!__WaitSemaphore()  + 0x1c Bytes	C++
>> dmd.exe!Mem::free(void *)()  Zeile 95 + 0x8 Bytes	C++
>> dmd.exe!Array::~Array()()  Zeile 59 + 0x10 Bytes	C++
>> dmd.exe!main()  Zeile 1431 + 0x26 Bytes	C++
>
> What are the callstacks of the other threads?

The funny thing is: There are no other threads.
I always thought that dmd is single threaded. Or am I mistaken there?

I can provide a full package with all sources if that would help.

Kind Regards
Benjamin Thaut
March 19, 2012
On Mar 19, 2012, at 12:21 PM, Benjamin Thaut <code@benjamin-thaut.de> wrote:

> Am 19.03.2012 19:08, schrieb Sean Kelly:
>> 
>> On Mar 19, 2012, at 10:58 AM, Benjamin Thaut wrote:
>>> 
>>> I somehow hit a bug where dmd deadlocks within Mem::Free if I use -inline. With previous bugs I was able to reduce my code using DustMite but with this one it is hard because dmd gives no output and just freezes. Any ideas how I could reduce my code?
>>> 
>>> Callstack:
>>> kernel32.dll!_WaitForSingleObject@8()  + 0x12 Bytes
>>> dmd.exe!__WaitSemaphore()  + 0x1c Bytes    C++
>>> dmd.exe!Mem::free(void *)()  Zeile 95 + 0x8 Bytes    C++
>>> dmd.exe!Array::~Array()()  Zeile 59 + 0x10 Bytes    C++
>>> dmd.exe!main()  Zeile 1431 + 0x26 Bytes    C++
>> 
>> What are the callstacks of the other threads?
> 
> The funny thing is: There are no other threads.
> I always thought that dmd is single threaded. Or am I mistaken there?

I think DMD will spawn a thread per module, or something like that. It would be weird for a thread to crash while holding the allocator lock though, unless there's memory corruption involved.