Commit 78495d5
committed
Fix unsound behaviour with null characters in thread names (issue rust-lang#32475)
Previously, the thread name (&str) was converted to a CString in the
new thread, but outside unwind::try, causing a panic to continue into FFI.
This patch changes that behaviour, so that the panic instead happens
in the parent thread (where panic infrastructure is properly set up),
not the new thread.
This could potentially be a breaking change for architectures who don't
support thread names.
Signed-off-by: David Henningsson <[email protected]>1 parent d7a7168 commit 78495d5
3 files changed
+30
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
95 | | - | |
| 92 | + | |
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
103 | | - | |
104 | | - | |
| 100 | + | |
105 | 101 | | |
106 | | - | |
| 102 | + | |
107 | 103 | | |
108 | 104 | | |
109 | 105 | | |
110 | 106 | | |
111 | | - | |
112 | | - | |
| 107 | + | |
113 | 108 | | |
114 | | - | |
| 109 | + | |
115 | 110 | | |
116 | 111 | | |
117 | 112 | | |
118 | 113 | | |
119 | | - | |
| 114 | + | |
| 115 | + | |
120 | 116 | | |
121 | | - | |
122 | 117 | | |
123 | 118 | | |
124 | | - | |
| 119 | + | |
125 | 120 | | |
126 | 121 | | |
127 | 122 | | |
128 | | - | |
| 123 | + | |
129 | 124 | | |
130 | 125 | | |
131 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
270 | | - | |
| 272 | + | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| |||
450 | 452 | | |
451 | 453 | | |
452 | 454 | | |
453 | | - | |
| 455 | + | |
454 | 456 | | |
455 | 457 | | |
456 | 458 | | |
| |||
465 | 467 | | |
466 | 468 | | |
467 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
468 | 473 | | |
469 | 474 | | |
470 | | - | |
| 475 | + | |
471 | 476 | | |
472 | 477 | | |
473 | 478 | | |
| |||
489 | 494 | | |
490 | 495 | | |
491 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
492 | 501 | | |
493 | 502 | | |
494 | 503 | | |
| |||
622 | 631 | | |
623 | 632 | | |
624 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
625 | 640 | | |
626 | 641 | | |
627 | 642 | | |
| |||
0 commit comments