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

Kyle Strand (Feb 15 2020 at 22:31, on Zulip):

@WG-ffi-unwind I replaced Niko's "big ol' table" of desiderata with a table of the behaviors of different types of unwinding for each strategy we considered. I highlighted "unusual" features of each strategy, using orange where the difference is an unexpected footgun and green where it's an advantage of some kind.

Kyle Strand (Feb 15 2020 at 22:32, on Zulip):

I also assigned names to options 1, 1c, and 3

Kyle Strand (Feb 15 2020 at 22:32, on Zulip):

If anyone's available to double-check the table entries, and/or to provide feedback on the names and highlighting, I'd appreciate it!

Kyle Strand (Feb 15 2020 at 22:33, on Zulip):

https://paper.dropbox.com/doc/ffi-unwind-2020-01-13--AuYm0xrr9_LR66E9da6xBEL4Ag-agituL322N0qRsCbcnn7D

Kyle Strand (Feb 15 2020 at 22:34, on Zulip):

I did not include Niko's added "after the fact" suggestion.

Kyle Strand (Feb 15 2020 at 23:22, on Zulip):

I've now fleshed out my draft of the blog post announcing the upcoming meeting: https://github.com/rust-lang/project-ffi-unwind/pull/21

Kyle Strand (Feb 15 2020 at 23:23, on Zulip):

I kept the "background" section, because it isn't terribly long.

Kyle Strand (Feb 15 2020 at 23:39, on Zulip):

Okay, I think it's pretty close to ready. @nikomatsakis I've opened a PR: https://github.com/rust-lang/project-ffi-unwind/pull/21

Kyle Strand (Feb 15 2020 at 23:39, on Zulip):

I don't have a way to post it to Rust Internals, so I will leave that to you unless you'd like me to help in some capacity.

nikomatsakis (Feb 18 2020 at 16:53, on Zulip):

oh, neat

Last update: May 27 2020 at 22:45UTC