Segfault while compiling simple program

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Dec 16 01:38:09 PST 2015


On Wednesday, 16 December 2015 at 09:26:33 UTC, Saurabh Das wrote:
> struct xlref
> {
>     ushort rwFirst;
>     ushort rwLast;
>     ubyte colFirst;
>     ubyte colLast;
> }
>
> struct xlmref
> {
>     ushort count;
>     xlref reflist;
> }
>
> Mac OS X (dmd 2.069.0)
> ===================
> dmd  dprob.d
> Segmentation fault: 11
>
> Windows (dmd 2.069.2)
> ==================
> dmd -v -m64 dprob.d
> binary C:\D\dmd2\windows\bin\dmd.exe
> version v2.069.2
> config C:\D\dmd2\windows\bin\sc.ini
> parse xlcall_wrap2
> importall xlcall_wrap2
> import object 
> (C:\D\dmd2\windows\bin....\src\druntime\import\object.d)
> semantic xlcall_wrap2
>
> object.Error@(0): assert(0) or HLT instruction
>
> 0x0040496F
> 0x00404CF8
> 0x004CF2B6
> 0x004565A7
> 0x0044EAB0
> 0x004BF99E
> 0x74F757F9 in MultiByteToWideChar
> 0x76F2139E in RtlQueryProcessDebugInformation
> 0x76F21340 in RtlQueryProcessDebugInformation
> 0x76F21190 in RtlQueryProcessDebugInformation
>
> What gives?
>
> Saurabh

Any compiler crash is a bug, please report at issues.dlang.org

While you wait for it to be fixed, try swapping reflist and count 
and you should find it doesn't crash. You should probably do 
anyway to avoid wasting space in the struct 
(http://www.catb.org/esr/structure-packing/)


More information about the Digitalmars-d-learn mailing list