@@ -23,29 +23,28 @@ appropriate page on our website, and check out the [detailed release notes for
23
23
24
24
## What's in 1.24.1 stable
25
25
26
- As you know, we tend not to release point releases. In this case, we had a few regressions in 1.24.0.
27
- Each of them individually was not a "hair on fire" moment, but there's two reasons we decided to
28
- produce a point release. First, collectively, they were big enough to consider as a whole. Second, we
29
- want our attitude towards regressions to be "if we're not sure, default to reverting." Given that
30
- it was not clear that we * shouldn't* release a point release, we decided to err on the side of
31
- caution.
26
+ As you know, we tend not to release point releases. In this case, Several minor
27
+ regressions were found in 1.24.0 which collectively merited a release.
32
28
33
29
A quick summary of the changes: there are four.
34
30
35
- * Do not abort when unwinding through FFI
31
+ * Do not abort when unwinding through FFI (this reverts behavior from 1.24.0)
36
32
* Emit UTF-16 files for linker arguments on Windows
37
33
* Make the error index generator work again
38
34
* Cargo will warn on Windows 7 if an update is needed.
39
35
40
- In general, if you haven't run into any build issues, the "do not abort when unwinding through FFI"
41
- change is the only one you should care about. The others are also important, but if 1.24.0 has been
42
- working well for you, this is the only change that affects you. We plan on bringing this behavior back
43
- in 1.25 or 1.26, depending on how smoothly the new strategy goes.
36
+ If your code is continuing to build, then the only issue that may affect you is
37
+ the unwinding issue. We plan on bringing this behavior back in 1.25 or 1.26,
38
+ depending on how smoothly the new strategy goes.
44
39
45
40
With that, let's dig into the details!
46
41
47
42
### Do not abort when unwinding through FFI
48
43
44
+ TL;DR: the behavior in 1.24.0 broke the ` rlua ` crate, and is being reverted. If
45
+ you have since changed your code to take advantage of the behavior in 1.24.0,
46
+ you'll need to revert it for now.
47
+
49
48
Quoting [ the 1.24 annoucement] ( https://blog.rust-lang.org/2018/02/15/Rust-1.24.html ) :
50
49
51
50
> There’s one other change we’d like to talk about here: undefined behavior.
@@ -65,9 +64,11 @@ extern "C" fn panic_in_ffi() {
65
64
>
66
65
> In Rust 1.24, this code will now abort instead of producing undefined behavior.
67
66
68
- We have reverted this behavior, and 1.24.1 will reintroduce the undefined behavior.
69
- Fundamentally, this is a soundness fix, and we still plan on reintroducing the
70
- abort, but are going to be rolling it out a bit more slowly, and with a different
67
+ As implemented, this functionality broke some users, notably, integration with
68
+ the Lua language. We have reverted this behavior, and 1.24.1 will reintroduce
69
+ the undefined behavior. Fundamentally, the aborting behavior we originally
70
+ rolled out is a soundness fix, and we still plan on reintroducing it, but are
71
+ going to be rolling it out a bit more slowly, and with a different
71
72
implementation.
72
73
73
74
It started with [ a bug filed against the ` rlua `
@@ -81,9 +82,9 @@ language](https://www.lua.org/).
81
82
> production Rust users, and so handling this was a very high priority for the
82
83
> Rust team.
83
84
84
- In short, ` rlua ` error handling just... broke. On Windows, and only on Windows,
85
- any attempt to handle errors from Lua would simply abort. This makes ` rlua `
86
- unusable, as any error of any kind within Lua causes your program to die.
85
+ On Windows, and only on Windows, any attempt to handle errors from Lua would
86
+ simply abort. This makes ` rlua ` unusable, as any error of any kind within Lua
87
+ causes your program to die.
87
88
88
89
After digging in, the culpurit was found: ` setjmp ` /` longjmp ` . These functions
89
90
are provided by the C standard library as a means of handling errors. You
@@ -121,7 +122,7 @@ When we talked about `setjmp`/`longjmp` inititally, a key phrase here wasn't
121
122
highlighted. Here it is:
122
123
123
124
> After digging in, the culpurit was found: ` setjmp ` /` longjmp ` . These functions
124
- > are * provided by the C standard library* as a means of handling errors. You
125
+ > are * provided by the C standard library* as a means of handling errors.
125
126
126
127
These functions aren't part of the C language, but part of the standard
127
128
library. That means that platform authors implement these functions, and
@@ -156,9 +157,10 @@ Consider the code above, and imagine that `lua_newtable` here could call
156
157
3 . The initial ` lua_pcall ` catches the ` longjmp ` with the ` setjmp ` it called earlier.
157
158
4 . Everyone is happy.
158
159
159
- However, ` lua_newtable ` is an ` extern fn ` to Rust. So, with the chances in
160
- 1.24.1, it sets up a panic handler that will cause an abort. In other words,
161
- the code sorta looks something like this psuedo code now:
160
+ However, the implementation of ` protect_lua_call ` converts our closure to an
161
+ ` extern fn ` , since that's what Lua needs. So, with the changes in 1.24.0, it
162
+ sets up a panic handler that will cause an abort. In other words, the code
163
+ sorta looks something like this pseudo code now:
162
164
163
165
``` rust
164
166
protect_lua_call (self . state, 0 , 1 , | state | {
@@ -179,14 +181,15 @@ everything works. However, on Windows, since both `setjmp`/`longjmp` and Rust
179
181
panics use SEH, the ` longjmp ` gets "caught", and runs the new abort code!
180
182
181
183
The [ solution here] ( https://github.com/rust-lang/rust/pull/48572 ) is to
182
- generate the abort handler, but in a way that ` longjmp ` won't trigger. Eventually,
183
- it's likely we'll have to register our own personality functions and such, but
184
- this is good enough for now. It's not 100% clear if this will make it into Rust 1.25;
185
- if the landing is smooth, we may backport, otherwise, this functionality will
186
- be back in 1.26.
184
+ generate the abort handler, but in a way that ` longjmp ` won't trigger it. It's
185
+ not 100% clear if this will make it into Rust 1.25; if the landing is smooth,
186
+ we may backport, otherwise, this functionality will be back in 1.26.
187
187
188
188
### Emit UTF-16 files for linker arguments on Windows
189
189
190
+ TL;DR: ` rustc ` stopped working for some Windows users. If it's been working for you,
191
+ you were not affected by this bug.
192
+
190
193
In constrast with the previous bug, which is very complex and tough to understand,
191
194
this bug's impact is simple: if you have non-ASCII paths in the directory where
192
195
you invoke ` rustc ` , in 1.24, it would incorrectly error with a message like
@@ -214,13 +217,20 @@ straightforward: produce a UTF-16 file with a BOM.
214
217
215
218
### Make the error index generator work again
216
219
220
+ TL;DR: building Rust 1.24.0 with Rust 1.24.0 broke in some circumstances.
221
+ If you weren't building Rust yourself, you were not affected by this bug.
222
+
217
223
When packaging Rust for various Linux distros, it was found that [ building
218
224
1.24 with 1.24 fails] ( https://github.com/rust-lang/rust/issues/48308 ) .
219
225
This was caused by an incorrect path, causing certain metadata to not
220
226
be generated properly.
221
227
222
228
### Cargo will warn on Windows 7 if an update is needed.
223
229
230
+ TL;DR: Cargo couldn't fetch the index from crates.io if you were using an older
231
+ Windows without having applied security fixes. If you are using a newer
232
+ Windows, or a patched Windows, you are not affected by this bug.
233
+
224
234
In February of 2017, [ GitHub announced that they were dropping support for
225
235
weak cryptographic
226
236
standards] ( https://githubengineering.com/crypto-deprecation-notice/ ) . One
@@ -248,9 +258,10 @@ that accessing GitHub would start to fail.
248
258
` libgit2 ` [ created a fix] ( https://github.com/libgit2/libgit2/pull/4550 ) , using the ` WinHTTP ` API
249
259
to request TLS 1.2. On master, we've [ updated to fix this] ( https://github.com/rust-lang/cargo/pull/5091 ) ,
250
260
but for 1.24.1 stable, we're [ issuing a warning] ( https://github.com/rust-lang/cargo/pull/5069 ) ,
251
- suggesting that they upgrade their Windows version. There's a balance here: we could have backported
252
- the ` libgit2 ` fixes, but that'd require updating a lot of code, which feels incorrect for a point
253
- release, especially since the issue does not affect patched systems.
261
+ suggesting that they upgrade their Windows version. Although the ` libgit2 ` fix
262
+ could have been backported, we felt that the code change footprint was too
263
+ large for the point release, especially since the issue does not affect patched
264
+ systems.
254
265
255
266
## Contributors to 1.24.1
256
267
0 commit comments