www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Compiler crash I can't pin down

reply "Mehrdad" <wfunction hotmail.com> writes:
I can't tell which part of my code is causing this (there's quite
a few files in my project and I can't really submit every file),
but when I run DMD, it crashes in template.c with
"Access violation reading location 0x00000004":


TemplateInstance::TemplateInstance(Loc loc, TemplateDeclaration
*td, Objects *tiargs)
         : ScopeDsymbol(NULL)
{
#if LOG
         printf("TemplateInstance(this = %p, tempdecl = '%s')\n",
this, td->toChars());
#endif
         this->loc = loc;
         this->name = td->ident;   // Crash here; apparently 'td' 
is
null?
         ...



Does anyone know what the bug might be? (Version 2.060 DEBUG)

It's a bit of a wild goose chase to narrow down the problem,
since I've tried commenting out several parts of my code entirely
(including the file mentioned in the "Loc" structure) but to no
avail. I also tried using Process Monitor to figure out the last
file DMD is opening, which happened to be std/utf.d, but
commenting out the entire code for that still caused the crash,
so idk...
May 11 2012
parent reply "Mehrdad" <wfunction hotmail.com> writes:
On Saturday, 12 May 2012 at 01:38:56 UTC, Mehrdad wrote:
 I can't tell which part of my code is causing this (there's 
 quite
 a few files in my project and I can't really submit every file),
 but when I run DMD, it crashes in template.c with
 "Access violation reading location 0x00000004":


 TemplateInstance::TemplateInstance(Loc loc, TemplateDeclaration
 *td, Objects *tiargs)
         : ScopeDsymbol(NULL)
 {
 #if LOG
         printf("TemplateInstance(this = %p, tempdecl = '%s')\n",
 this, td->toChars());
 #endif
         this->loc = loc;
         this->name = td->ident;   // Crash here; apparently 
 'td' is
 null?
         ...



 Does anyone know what the bug might be? (Version 2.060 DEBUG)

 It's a bit of a wild goose chase to narrow down the problem,
 since I've tried commenting out several parts of my code 
 entirely
 (including the file mentioned in the "Loc" structure) but to no
 avail. I also tried using Process Monitor to figure out the last
 file DMD is opening, which happened to be std/utf.d, but
 commenting out the entire code for that still caused the crash,
 so idk...
Hmm... I "fixed" the error by updating my object_.d file (I'd modified it for a separate project) but I still don't know what was causing it..
May 11 2012
parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 11 May 2012 22:28:40 -0400, Mehrdad <wfunction hotmail.com> wrote:

 On Saturday, 12 May 2012 at 01:38:56 UTC, Mehrdad wrote:
 I can't tell which part of my code is causing this (there's quite
 a few files in my project and I can't really submit every file),
 but when I run DMD, it crashes in template.c with
 "Access violation reading location 0x00000004":


 TemplateInstance::TemplateInstance(Loc loc, TemplateDeclaration
 *td, Objects *tiargs)
         : ScopeDsymbol(NULL)
 {
 #if LOG
         printf("TemplateInstance(this = %p, tempdecl = '%s')\n",
 this, td->toChars());
 #endif
         this->loc = loc;
         this->name = td->ident;   // Crash here; apparently 'td' is
 null?
         ...



 Does anyone know what the bug might be? (Version 2.060 DEBUG)

 It's a bit of a wild goose chase to narrow down the problem,
 since I've tried commenting out several parts of my code entirely
 (including the file mentioned in the "Loc" structure) but to no
 avail. I also tried using Process Monitor to figure out the last
 file DMD is opening, which happened to be std/utf.d, but
 commenting out the entire code for that still caused the crash,
 so idk...
Hmm... I "fixed" the error by updating my object_.d file (I'd modified it for a separate project) but I still don't know what was causing it..
In the future, know that dmd should *never* actually crash. If it does, it should be a bug report. -Steve
May 14 2012