Date: Fri, 19 Jun 2015 04:07:52 +0200 From: Matthias Schiffer <mschiffer@...verse-factory.net> To: musl@...ts.openwall.com, linux-mips@...ux-mips.org, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Ralf Baechle <ralf@...ux-mips.org> Subject: musl-libc/MIPS: detached thread exit broken since kernel commit 46e12c07b Hi, I've come across the issue that applications with detached threads (using pthread_detach or a pthread_attr_t with pthread_attr_setdetachstate) will segfault using musl-libc on MIPS as soon as the detached thread exits. As far as I can tell, the underlying issue is the following: To clean up after itself, the finishing thread will call __unmapself, which will unmap the thread's own stack and call the exit syscall directly after that, without accessing the now unmapped stack. This worked fine in 2012, when pthread support for MIPS was implemented in musl. It seems to have been broken by kernel commit 46e12c07b "MIPS: O32 / 32-bit: Always copy 4 stack arguments." (also in 2012) which made the kernel unconditionally copy 4 stack arguments, even when the syscall doesn't even use the arguments. I guess this would be reasonably easy to fix up in musl, but let's also get the linux-mips people's opinions, as that commit obviously broke the kernel ABI... Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.