[phobos] "bus error" happens on Mac OS X

Masahiro Nakagawa repeatedly at gmail.com
Fri Nov 12 10:30:50 PST 2010


I inserted your code and assert failed.
And then, I enabled following code.

foreach (m; _moduleinfo_array)
{
      printf("\t%p\n", m);
}

Result:

Testing generated/osx/debug/unittest/crc32
         0x0
         0x146a0
         0x14ac0
         0x14ad0
         0x15dbc
         0x15df4
         0x15e2c
         0x15ea0
         0x15ecc
         0x15f68
         0x15f9c
         0x1649c
         0x1696c
         0x17ac4
         0x17fa4
         0x18308
         0x18334
         0x1836c
         0x183f8
         0x18444
         0x18524
         0x18c74
         0x18c84
         0x18cf8
         0x18d68
         0x18d9c
         0x18dcc
         0x18e0c
         0x18f60
         0x19088
         0x193ec
make[1]: *** [generated/osx/debug/unittest/crc32] Bus error
make[1]: *** Deleting file `generated/osx/debug/unittest/crc32'
make: *** [unittest] Error 2

The first element of _moduleinfo_array is null...

Currently, Jacob's patch fixes this bug :)


Masahiro

On Fri, 12 Nov 2010 21:20:06 +0900, Steve Schveighoffer  
<schveiguy at yahoo.com> wrote:

> I think the Mac OS code generation has some issues.
>
> In the original code before I checked that in, every module index is set  
> (see
> the revision before 414:
> http://dsource.org/projects/druntime/browser/trunk/src/object_.d?rev=405#L1900).
>  I don't see why r414 fails and r413 doesn't.
>
> BTW, I just noticed, a lot of the code in prior versions checks to see  
> if the
> array contains null pointers, does this happen?  I don't think I put  
> those
> guards in.
>
> Masahiro, can you run an assert loop like so?  I don't have a Mac, and
> everything appears to work fine on Linux.
>
> foreach(m; _moduleinfo_array)
>    if(!m)
>       assert(0, "found null reference");
>
> -Steve
>
>
>
> ----- Original Message ----
>> From: Masahiro Nakagawa <repeatedly at gmail.com>
>> To: Phobos mailing list <phobos at puremagic.com>
>> Sent: Fri, November 12, 2010 12:03:01 AM
>> Subject: [phobos] "bus error" happens on Mac OS X
>>
>> Any programs raised "bus error" in the trunk (My environment is Mac OS X
>> 10.6.4).
>> I checked druntime and found problematic revision.
>> r413 works  fine but r414 and later don't (Phobos unittest stopped at  
>> crc32
>> test).
>>
>> http://dsource.org/projects/druntime/changeset/414
>>
>> The cause is an  access to _moduleinfo_array.
>> In the above link, "m.index = i;" at line 2045  is because of this bug.
>> But, but, but, r414 doesn't change the creation  routine of  
>> _moduleinfo_array.
>>
>> It's a mystery to me...  Why?
>>
>>
>> Masahiro
>> _______________________________________________
>> phobos  mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>>
>
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list