[D-runtime] druntime commit, revision 459

Sean Kelly sean at invisibleduck.org
Tue Dec 28 15:08:54 PST 2010

On Dec 28, 2010, at 12:17 PM, Don Clugston wrote:

> On 28 December 2010 19:34, Sean Kelly <sean at invisibleduck.org> wrote:
>> This one was discussed a while ago in private email and stalled for lack of an executive decision.  I'll paste some pertinent bits of the discussion below (all stuff I said).  The rest of this message is pasted from various old emails.
> That's good to know.  So the Linux behaviour is also believed to be
> incorrect, but in a different way?

Yes.  Basically, having an exception thrown when another is in flight can't replace the in flight exception or chain with it, or things break in different, subtle ways (old D behavior was replacement, new D behavior was to be chaining).

> Still, none of this SEH stuff seems right to me. localunwind returns a
> CollidedUnwind, but it doesn't seem to actually be doing a collided
> unwind.  If it does a collided unwind, it should be changing the catch
> clause which it's ultimately trying to reach, but continuing to
> execute any finally clauses en route. If it does exception chaining,
> it should continue to execute any finally clauses en route.
> But it does neither of these things; instead, it just silently fails!
> (This would seem to be wrong on D1, regardless of what it is supposed
> to do on D2).

You are already better versed with SEH than I am.  I too had trouble finding documentation of SEH and so didn't dig into that code too deeply, and so assumed it was correct and tweaked it to add the chaining behavior.  It sounds like it all needs a closer look.  Thanks for getting the ball rolling!
> For something which is so complicated and undocumented by Microsoft,
> the lack of comments in the code is terrible. I added a lot of
> comments out of frustration. Please fix any which are wrong, and
> change the function names where appropriate.
> Regardless of when bug 1513 gets fixed, it seemed to me an
> embarrassment that a C compiler was required for the D runtime.

You know how these things are... the code (seemingly) worked and so was left alone.  I'm glad you spent the time to convert it though.  I'll have to take care of the mutex stuff soonish as well.  I'll review your changes as well.  Possibly not until next week though.  I'm off this week and that tends to mean that I don't get any D coding done.  Ironic, that.

More information about the D-runtime mailing list