dmd/ldc failed with exit code -11

Anonymouse asdf at asdf.net
Tue Nov 21 19:22:47 UTC 2017


On Tuesday, 21 November 2017 at 13:28:44 UTC, Anonymouse wrote:
> Looking at the dmd command dub issues and testing them myself I 
> notice that if I reorder the arguments it builds.
>
>> $ dmd -d -oftest source/arsd/*.d source/kameloso/plugins/*.d 
>> source/kameloso/*.d
>> zsh: segmentation fault (core dumped)  dmd -d -ofkek 
>> source/arsd/*.dd source/kameloso/plugins/*.d 
>> source/kameloso/*.d
>>
>> $ dmd -d -oftest source/kameloso/plugins/*.d 
>> source/kameloso/*.d source/arsd/*.d
>> $ echo $?
>> 0

Compiling a debug dmd and running the build command in gdb, it 
seems to be a stack overflow at ddmd/dtemplate.d:6241, 
TemplateInstance::needsCodegen().

> Program received signal SIGSEGV, Segmentation fault.
> 0x00005555557ef1f7 in TemplateInstance::needsCodegen() 
> (this=<error reading variable: Cannot access memory at address 
> 0x7fffff7feff8>) at ddmd/dtemplate.d:6181
> (gdb) bt
> [...58165 all the way to 1...]
> #58166 0x00005555557ef351 in TemplateInstance::needsCodegen() 
> (this=0x7fff4a8f1eb0) at ddmd/dtemplate.d:6241
> #58167 0x00005555557ef351 in TemplateInstance::needsCodegen() 
> (this=0x7fff4a8f2640) at ddmd/dtemplate.d:6241
> #58168 0x00005555557ef351 in TemplateInstance::needsCodegen() 
> (this=0x7fff4a8f4480) at ddmd/dtemplate.d:6241
> #58169 0x00005555557ef351 in TemplateInstance::needsCodegen() 
> (this=0x7fff4a8f4c10) at ddmd/dtemplate.d:6241
> #58170 0x00005555557ef642 in TemplateInstance::needsCodegen() 
> (this=0x7ffff2553280) at ddmd/dtemplate.d:6335
> #58171 0x00005555558d7851 in 
> toObjFile::ToObjFile::visit(TemplateInstance*) 
> (this=0x7fffffffc128, ti=0x7ffff2553280) at ddmd/toobj.d:1126
> #58172 0x00005555557f2426 in TemplateInstance::accept(Visitor*) 
> (this=0x7ffff2553280, v=0x7fffffffc128) at ddmd/dtemplate.d:7438
> #58173 0x00005555558d59c2 in toObjFile(Dsymbol*, bool) 
> (ds=0x7ffff2553280, multiobj=false) at ddmd/toobj.d:1335
> #58174 0x00005555558c6f19 in genObjFile(Module*, bool) 
> (m=0x7ffff7e95bf0, multiobj=false) at ddmd/glue.d:402
> #58175 0x000055555585f7e8 in ddmd.mars.tryMain(ulong, 
> const(char)**) (argv=0x7fffffffd928, argc=36) at 
> ddmd/mars.d:1013
> #58176 0x000055555586003f in D main () at ddmd/mars.d:1115

This part (function final bool needsCodegen(), line 6181):

> 6233│             // Determine necessity of tinst before tnext.
> 6234│             if (tinst && tinst.needsCodegen())
> 6235│             {
> 6236│                 minst = tinst.minst; // cache result
> 6237│                 assert(minst);
> 6238│                 assert(minst.isRoot() || 
> minst.rootImports());
> 6239│                 return true;
> 6240│             }
> 6241│---------->  if (tnext && (tnext.needsCodegen() || 
> tnext.minst))
> 6242│             {
> 6243│                 minst = tnext.minst; // cache result
> 6244│                 assert(minst);
> 6245│                 return minst.isRoot() || 
> minst.rootImports(); 6246│             }


More information about the Digitalmars-d-learn mailing list