-
Notifications
You must be signed in to change notification settings - Fork 13
Ub vs tbd #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ub vs tbd #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an issue open in the UCG repo about defining these types of behavior that maybe we should pursue more actively there (rust-lang/unsafe-code-guidelines#201 rust-lang/unsafe-code-guidelines#202). I think that in the meantime, it's fine to add things here, but we should update this to point there as things achieve consensus (for UB, this already happened).
* Examples: | ||
* Details of how a Rust panic presents itself in "C unwind" ABI on msvc | ||
|
||
## TBD as an "project-local planning measure" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## TBD as an "project-local planning measure" | |
## TBD as a "project-local planning measure" |
* We *may* specify this at some point in the future, but there are no plans to do so. | ||
* Example: Rust ABI compatibility | ||
* Example: What symbols get exported by a DLL | ||
* We wish to specify this behavior in the near future, as part of the FFI-unwind project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bullet-point hierarchy doesn't match the heading, "three categories"... I also feel that most of this section feels redundant with the terminology page.
This directory stores "resolved concerns" -- basically, whenever there | ||
is a non-obvious tradeoff, we try to create a document that describes | ||
the tradeoff in full, and then documents the resolution we ultimately | ||
reached. Sometimes these documents include dissents, if not everyone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🦀
Rust evolves. Eventually, though, we do intend to define many (but not | ||
all) aspects of how Rust panics and native unwinding interoperate. | ||
Moreover, we guarantee that unwinding will **not** result in | ||
[Undefined Behavior] and in particular not [LLVM-UB]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more of an idea for the future, but maybe we should use a term like "optimizer-UB" or "intermediate-representation-UB" instead of LLVM-UB. The core idea of the term, I think, is that we are avoiding the form of UB that lets compilers make "adversarial" optimizations (in particular, in our case, eliminating landing pads).
e.g. [rust-lang/rust#28728]). The main reason it is worth separating | ||
LLVM-UB from the more general form of Rust UB is that, while both | ||
forms of UB can cause arbitrary things to happen in your | ||
code. However, as a practical measure, LLVM-UB is much more *likely |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these sentences are really supposed to be one sentence that was inadvertently split.
code. However, as a practical measure, LLVM-UB is much more *likely | |
code, LLVM-UB is much more *likely* to do so in practice. |
(Can't submit a multi-line suggestion yet, but of course this would mean deleting the next line 😄 )
We use the term "unspecified behavior" to refer to behavior that may | ||
vary across Rust releases, depending on what options are given to the | ||
compiler, or even -- in extreme cases -- across executions of the Rust | ||
compiler. However, unlike undefined behavior, the resulting execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth noting variation across platforms, too.
No description provided.