DMD 2.055 Crashing on Windows 7 x64 (So is my D program)

Steven Schveighoffer schveiguy at yahoo.com
Mon Sep 26 13:51:38 PDT 2011


On Mon, 26 Sep 2011 16:38:10 -0400, Mehrdad <wfunction at hotmail.com> wrote:

> On 9/26/2011 12:19 PM, Steven Schveighoffer wrote:
>> On Mon, 26 Sep 2011 15:05:44 -0400, Walter Bright  
>> <newshound2 at digitalmars.com> wrote:
>>
>>> On 9/26/2011 8:06 AM, Mehrdad wrote:
>>>> Actually, I just found out that the program itself crashes the same  
>>>> way, too.
>>>
>>> What program?
>>
>> I think he means both dmd and the program it generates crash in the  
>> same way.
>>
>> -Steve
> Right; what Steve said. The program is empty.
>
> It seems to be failing in the _close() method, but ONLY when I run it  
> from my text editor, SciTE. It runs fine from the command prompt.
>
> I don't believe it's a problem with the text editor (since it's just a  
> pipe, and since it works fine with other languages) but I'll keep  
> looking. Does anyone happen to know if there's a stray _close() method  
> in snn.lib that closes a handle that might be already closed?

AHA!

Yes, there is a bug in snn.lib regarding pipes.  And I fixed it, waiting  
for Walter to incorporate it :)  I needed it for the new std.process.

What it comes down to is, DMC's FILE * implementation does not expect some  
of the quirks of pipe HANDLEs.  For instance, if you open a FILE * around  
a pipe handle, it still tries to do a seek on that handle, and crashes.   
Also, when the write end of a pipe is closed, reading from the read end  
results in EPIPE from ReadFile, but this is translated to EBADF by the  
runtime.  Therefore, FILE * sets an error instead of EOF.

Is the email address you have for this message correct?  If so, I can send  
you a new version of snn.lib to try linking your code against (if you are  
willing to go through these steps), to see if it fixes your problem.

Using the command line dmd to build should be sufficient (I think).

-Steve


More information about the Digitalmars-d mailing list