[Issue 7938] Stack overflow/access violation when throwing exceptions from fibers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 18 21:27:08 PDT 2012


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



--- Comment #3 from Andrew Lauritzen <andrew.lauritzen at gmail.com> 2012-04-18 21:28:03 PDT ---
Hmm yeah that was a portion pasted into a large file - should have been
independent, but here we go with a separately tested case:

import core.thread;
import std.stdio;

class A : core.thread.Fiber
{
    public this()
    {
        super(&run);
    }

    public void run()
    {
        throw new Exception("msg");
    }
}

void main() 
{
    auto a = new A();
    try
    {
        a.call();
    }
    catch (Exception e)
    {
        writeln(e.msg);
    }
}

This is about the simplest you can get I think, but running it in Debug with
MSVC and Visual D 0.3.31 with a breakpoint on the writeln you'll see the
following in the debugger:

First-chance exception at 0x5d66bc13 in TestFiberExceptions.exe: 0xC00000FD:
Stack overflow.
First-chance exception at 0x769ab9bc in TestFiberExceptions.exe: 0xE0440001:
0xe0440001.
First-chance exception at 0x769ab9bc in TestFiberExceptions.exe: 0xE0440001:
0xe0440001.

In this example it doesn't seem to actually crash the program, but in more
complex examples you'll get a stream of access violations and nonsense after
the initial stack overflow. I can try to make it more complex to demonstrate
this behavior as well, but presumably the above output is indicative of a
problem in and of itself?

-- 
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