Comments (22)
Update: PR is ready for review, and we'll have a longjmp blog post going out soon
from lang-team.
2021-04-06:
"C-unwind"
PR was merged!- This accidentally introduced a change to
"C"
unwind behavior even without the feature flag; we will need to fix this before the next stable release. We have alerted the release team and are working on a fix. - There are a few more follow-up issues to address, listed here.
- This accidentally introduced a change to
- a
longjmp
blog post was published, but we are prioritizing the"C-unwind"
issues for now
from lang-team.
2020-04-02: Working towards RFC
from lang-team.
2020-04-09: BatmanAod opened a PR with draft of RFC
from lang-team.
2020-04-30:
- The only question is whether to make it “defined behavior” if a foreign except propagates across a “C unwind” boundary (and there is no catch_unwind
)
- Advantage: we probably want to support this
- Disadvantage: it will require a shim to catch C++ exceptions — this is probably necessary later, unless we reverse the “two ABIs” proposal
- Interesting downside of the “two ABI” design
- If you have a C function but it takes callbacks, then there could potentially be pressure to make callbacks into “C unwind” and the function too (for flexibility)
- but note that this is not a trivial change, necessarily, and indeed many C libraries are not ready for this to happen “just because”
- True, but just a downside of this approach.
from lang-team.
2020-06-01:
- Plain Old Frames — for frames that don’t have a pending destructor or catch_unwind
from lang-team.
2020-06-11:
We uncovered a few interesting things in discussing the latest draft. The most important is that we are not comfortable saying that longjmp functions can unwind Plain Old Frames (POF) without any further annotation, because that will hinder our efforts to optimize. For the time being, we plan to edit the RFC to leave the details of when longjmp is legal as TBD, but we discussed some possible alternative proposals here rust-lang/project-ffi-unwind#30.
from lang-team.
2020-06-22:
- RFC 2945 opened
- Not just about "C" vs "C unwind" ABIs, but we currently use
#[unwind(allowed)]
for"system"
:
extern "system" {
#[unwind(allowed)]
pub fn _CxxThrowException(pExceptionObject: *mut c_void, pThrowInfo: *mut u8) -> !;
}
- Options:
- add
"system unwind"
,"stdcall unwind"
, etc - maybe
"system"
itself is redundant
- add
from lang-team.
2020-07-06:
- RFC is believed to be ready for FCP, needs someone from lang-team to review and fcp merge.
- We clarified that other ABIs (e.g.,
system
) may have unwind variants (e.g.,extern "system unwind"
). - Josh: If there were an ABI that is used in some context where unwinding is always used, it's not useful to have a non-unwind variant of it, in practice there is often a "defacto no-unwind" guarantee. (Niko: but we may want to call it
"foo unwind"
, even if there is no"foo"
).
from lang-team.
2020-07-20:
- RFC has just entered FCP.
- Bikeshedding now about "C unwind" vs "C-unwind"
from lang-team.
2020-07-27:
- Bikeshed resolved ABI name to "C-unwind".
from lang-team.
2020-07-31:
- rust-lang/rfcs#2945 is merged and tracking issue rust-lang/rust#74990 is opened.
from lang-team.
2020-09-14:
- Implementation work is ongoing, we may start looking at the longjmp question.
from lang-team.
2020-09-21:
No update.
from lang-team.
Discussion in today's meeting:
- New discussion and proposals for handling "target ABI"
- e.g. target for native iOS vs target for iOS simulator, which have different ABIs
- Rust doesn't have a way to express this today
This isn't directly in the current ffi-unwind charter. Rather than expanding it (which we'd do to cover c++/longjmp/etc), we may need to consider chartering an additional project for new FFI issues.
from lang-team.
(Not sure why this unassigned @BatmanAoD; I didn't change anything there.)
from lang-team.
Update:
- @BatmanAoD plans to write a blog post setting the direction for work on functions that can be deallocated ("canceled") with longjmp &c.
- @katie-martin-fastly hasn't had time to work on rust-lang/rust#76570 recently but hopes to get some more time soon =)
from lang-team.
2020-11-17:
- Previous comment still basically accurate.
from lang-team.
Lang team planning meeting update:
- We should promote this project to "evaluation"
- On the topic of longjmp:
- Josh: Fairly unusual to see people using longjmp these days, should not sacrifice optimizablity
- Josh: But it should be possible -- with enough care -- to longjmp without UB
- Amanieu: this also affects functions that call
pthread_exit
- Would be nice to open a PR and update the charter to include new scope (can link to the blog post)
from lang-team.
- updated charter
- Follow-up issues for
"C-unwind"
remain our top priority.- In particular, we need to implement the specified "abort-on-unwind" behavior for
"C-unwind"
FFI calls inpanic=abort
mode.
- In particular, we need to implement the specified "abort-on-unwind" behavior for
- Regarding
longjmp
, we believe there's an LLVM bug causing incorrect code-gen when strict-aliasing is enabled in a frame that gets discarded bylongjmp
. We haven't yet discussed how to move forward, though we plan to open a bug report for it.
from lang-team.
Update:
- @alexcrichton has a PR fixing various bugs and implementing the intended semantics, under review
- Plan of record is to
- remove the UB from panics in "C" while adding "C-unwind" as a target
- once "C-unwind" is stabilized -- hopefully soon! -- add back in the UB for panics in "C"
from lang-team.
Closing in favor of rust-lang/project-ffi-unwind#36
from lang-team.
Related Issues (20)
- Nail down cargo-script syntax proposal HOT 2
- T-types proposal for stabilizing type alias impl Trait (TAIT)
- 2024 Edition Review HOT 1
- Design meeting: resolve ABI issues around target-feature HOT 6
- Website broken HOT 5
- Design meeting: Rust for Linux
- Design meeting: Match ergonomics 2024
- Lang-team RFC guidelines appear to be out of date
- Design meeting: Profiles
- Bounds for RPIT/RPITIT/async fn
- Discuss RFC 2442: Simple postfix macros HOT 3
- Discuss Rust 2024 edition planning: 2024-01-10
- Discuss ideas for GSoC 2024 HOT 2
- Discuss feedback for T-spec sample chapters HOT 1
- Lang discussion: Item-level `const {}` blocks, and `const { assert!(...) }` HOT 1
- Discuss temporary lifetimes 2024 RFC HOT 1
- Discuss arbitrary self types v2 RFC
- Proposal: Remove `i128`/`u128` from the `improper_ctypes` lint HOT 7
- Discuss the never type situation
- Extended triage meeting 2024-03-20 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lang-team.