[Issue 6376] Throwing exception or assertion failure causes segfault or memory error due to ASLR on Mac OS X 10.7

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 25 06:05:47 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6376



--- Comment #5 from kennytm at gmail.com 2011-07-25 06:05:42 PDT ---
(In reply to comment #4)
> The segfault for case 2 happens in _d_throwc:
> 
>     // this is a catch handler (no finally)
> 
>     auto pci = cast(DCatchInfo *)(cast(char *)handler_table + phi.cioffset);
>     auto ncatches = pci.ncatches;
>     for (int i = 0; i < ncatches; i++)
>     {
>         auto ci = **cast(ClassInfo **)h;  // <--------- this line, *h == null
> 
>         auto pcb = &pci.catch_block[i];

Actually this is because I compile with -debug. Without -debug, _d_throwc is
not no-return, causing originally unreachable statements e.g.

extern (C) void onAssertError( string file = __FILE__, size_t line = __LINE__ )
{
    if( assertHandler is null )
        throw new AssertError( file, line );
    assertHandler( file, line, null);   // <-------- this line
}

to be run.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list