]> git.lizzy.rs Git - rust.git/commit
Fix unsound behaviour with null characters in thread names (issue #32475)
authorDavid Henningsson <diwic@ubuntu.com>
Fri, 25 Mar 2016 04:46:45 +0000 (05:46 +0100)
committerDavid Henningsson <diwic@ubuntu.com>
Fri, 25 Mar 2016 05:14:03 +0000 (06:14 +0100)
commit78495d5082f51a2737619824548c9f2407b12a2b
tree2ed3ee0b3bf4b4fc323edfbaaaae445c94f915e9
parentd7a71687ef1a9fa5665944608d5bad58d98a9684
Fix unsound behaviour with null characters in thread names (issue #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 <diwic@ubuntu.com>
src/libstd/sys/unix/thread.rs
src/libstd/sys/windows/thread.rs
src/libstd/thread/mod.rs