Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #352 (new defect)

Opened 3 years ago

Last modified 2 years ago

bus error compiling blip

Reported by: fawzi Assigned to: ChristianK
Priority: major Milestone:
Component: unspecified Version: hg tip
Keywords: Cc:

Description

on mac with llvm 78472 and ldc 1570:ab03cfb3a212 all mini tests pass, but the I get a bus error compiling blip:

ldc -c -v -I/Users/fawzi/Documents/d-dev/blipClean -inline -release -O3  -of=/Users/fawzi/Documents/d-dev/blipClean/objs-osx-i386-ldc-opt/testSerial.o /Users/fawzi/Documents/d-dev/blipClean/objs-osx-i386-ldc-opt/testSerial.d
Note: Variant vararg functionality not supported for this compiler/platform combination.
To override and enable vararg support anyway, compile with the EnableVararg version.
0   ldc               0x00b88888 llvm::sys::RWMutexImpl::writer_release() + 312
1   ldc               0x00b88e0a llvm::sys::PrintStackTraceOnErrorSignal() + 554
2   libSystem.B.dylib 0x91e0b2bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1847545199
4   ldc               0x00158677 IrTypeBasic::IrTypeBasic(Type*) + 39
5   ldc               0x00139099 DtoType(Type*) + 601
6   ldc               0x00149318 GetTypeAlignment(Ir*, Type*) + 24
7   ldc               0x000686fd TypeBasic::alignsize() + 45
8   ldc               0x00098398 AggregateDeclaration::addField(Scope*, VarDeclaration*) + 104
9   ldc               0x0001b5b3 VarDeclaration::semantic(Scope*) + 835
10  ldc               0x000100ba ClassDeclaration::semantic(Scope*) + 2058
11  ldc               0x00064926 Module::semantic(Scope*) + 390
12  ldc               0x000fe5df main + 4687
13  ldc               0x00003c36 start + 54

if I have time later I will try to reduce it

Change History

08/17/09 16:51:19 changed by fawzi

This failure comes from the use of the blip.serialization.SerializationMixins?.serializeSome mixin. its use in testSerial makes ldc fail.

it is sort of amusing that I created SerializationMixins? to have simple mixins, in the hope ldc could digest them (the Expose mixins, and expose itself don't work with ldc.

08/18/09 03:21:51 changed by fawzi

I was wrong the mixin is not the culprit, the problem is much more basic:

class B{
    int a;
    uint b;
    long c;
    ulong d;
    char[] e;
    wchar[] f;
    dchar[] g;
    float h;
    double i;
    real l;
    ifloat m;
    idouble n;
    ireal o;
    cfloat p;
    cdouble q;
    creal r;
    bool s;
    byte t;
    ubyte u;
    short v;
    ushort z;
}

gives

0   ldc               0x00b88888 llvm::sys::RWMutexImpl::writer_release() + 312
1   ldc               0x00b88e0a llvm::sys::PrintStackTraceOnErrorSignal() + 554
2   libSystem.B.dylib 0x91e0b2bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1847545199
4   ldc               0x00158677 IrTypeBasic::IrTypeBasic(Type*) + 39
5   ldc               0x00139099 DtoType(Type*) + 601
6   ldc               0x00149318 GetTypeAlignment(Ir*, Type*) + 24
7   ldc               0x000686fd TypeBasic::alignsize() + 45
8   ldc               0x00098398 AggregateDeclaration::addField(Scope*, VarDeclaration*) + 104
9   ldc               0x0001b5b3 VarDeclaration::semantic(Scope*) + 835
10  ldc               0x000100ba ClassDeclaration::semantic(Scope*) + 2058
11  ldc               0x00064926 Module::semantic(Scope*) + 390
12  ldc               0x000fe5df main + 4687
13  ldc               0x00003c36 start + 54
Bus error

08/18/09 05:19:34 changed by fawzi

it turns out that the problem are the complex number, any of cfloat, cdouble or creal declarations give that error.

(Unfortunately using real numbers the test compiles, but then segfaults, but that will be for another ticket...)

08/18/09 05:27:47 changed by fawzi

the error I het after it is a stack misalignment problem, maybe putting some structs on the stack does not keep stack alignment into account on mac

08/18/09 06:04:09 changed by fawzi

mmh

1) class B{ cfloat r; }

it seems that the latest ldc on linux x86_64 does not have these problems (still the program segfaults)... maybe it is a mac only (or 32 bit only) problem

2) stack misaligment problem (running testSerial)

that is a mac problem as other 32 bit architecure allow for stack misaligment. 64 bit has to be aligned, and the segfault I see with linux_x86_64 might be connected to it

Copyright © 2008, LDC Development Team.