Stream: project-ffi-unwind

Topic: sync up


nikomatsakis (Jan 13 2020 at 20:02, on Zulip):

Hey @WG-ffi-unwind -- should we sync? Do we want to try this over zoom to move faster maybe?

Kyle Strand (Jan 13 2020 at 20:02, on Zulip):

Yes, I was planning to do it with Zoom.

nikomatsakis (Jan 13 2020 at 20:02, on Zulip):

Zoom link

acfoltzer (Jan 13 2020 at 20:03, on Zulip):

aaa sorry, I didn't realize we had settled on a time. I'll be able to join in ~10 minutes

nikomatsakis (Jan 13 2020 at 20:04, on Zulip):

paper doc

nikomatsakis (Jan 13 2020 at 20:05, on Zulip):

( cc @Amanieu :point_up: )

nikomatsakis (Jan 13 2020 at 20:05, on Zulip):

not sure why you're not in the alias :)

nikomatsakis (Jan 13 2020 at 22:00, on Zulip):

OK so

nikomatsakis (Jan 13 2020 at 22:00, on Zulip):

something we said at the made me realize the catch with 1C

nikomatsakis (Jan 13 2020 at 22:00, on Zulip):

which is basically that one of our goals was to add shims in Cpanic=unwind to catch exceptions across the "C" boundary

nikomatsakis (Jan 13 2020 at 22:00, on Zulip):

since it is Cpanic=unwind, we cannot just make dtors abort

nikomatsakis (Jan 13 2020 at 22:01, on Zulip):

so we have to have a shim that permits longjmp but not other exceptions, presumably

nikomatsakis (Jan 13 2020 at 22:01, on Zulip):

which means that you can't say "UB to unwind if there are destrutors in scope" without clarifying the kind of unwinding

nikomatsakis (Jan 13 2020 at 22:02, on Zulip):

even so .. I think it might be preferable, or else a variant 1d where you say

nikomatsakis (Jan 13 2020 at 22:03, on Zulip):

but honestly I'm not convinced that the cure here is worse than the disease...

nikomatsakis (Jan 13 2020 at 22:07, on Zulip):

I should raise one other option

nikomatsakis (Jan 13 2020 at 22:07, on Zulip):

nm

nikomatsakis (Jan 13 2020 at 22:21, on Zulip):

ok, I wrote out the other option. In short, if we sacrifice C++ exception interop, you get what seems to me to be a relatively minimal diff on today's ABI, and one that leaves some room for future decisions:

You need the forced exception distinction if you want to insert shims in -Cpanic=unwind mode.

In -Cpanic=abort mode, you can add shims to destructor calls to abort, since they should neve run.

In both cases, you probably only want the shims in debug builds, but they correspond to cases that are supposed to be UB.

acfoltzer (Jan 13 2020 at 22:49, on Zulip):

shims in -Cpanic=unwind mode.

what would these shims be for? aborting on a non-Rust, non-forced exception?

nikomatsakis (Jan 13 2020 at 23:05, on Zulip):

Yes, just catching accidental propagation

nikomatsakis (Jan 13 2020 at 23:05, on Zulip):

Maybe there's not much point

Last update: Jan 28 2020 at 01:00UTC