<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/thread, branch v0.9.4</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>fix extremely rare but dangerous race condition in robust mutexes</title>
<updated>2012-08-17T21:13:53+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-08-17T21:13:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=da8d0fc4fa3490f418a438b7e0830f9af312d41f'/>
<id>da8d0fc4fa3490f418a438b7e0830f9af312d41f</id>
<content type='text'>
if new shared mappings of files/devices/shared memory can be made
between the time a robust mutex is unlocked and its subsequent removal
from the pending slot in the robustlist header, the kernel can
inadvertently corrupt data in the newly-mapped pages when the process
terminates. i am fixing the bug by using the same global vm lock
mechanism that was used to fix the race condition with unmapping
barriers after pthread_barrier_wait returns.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if new shared mappings of files/devices/shared memory can be made
between the time a robust mutex is unlocked and its subsequent removal
from the pending slot in the robustlist header, the kernel can
inadvertently corrupt data in the newly-mapped pages when the process
terminates. i am fixing the bug by using the same global vm lock
mechanism that was used to fix the race condition with unmapping
barriers after pthread_barrier_wait returns.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix (hopefully) all hard-coded 8's for kernel sigset_t size</title>
<updated>2012-08-10T02:52:13+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-08-10T02:52:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=2f437040e7911d9bef239588ea7ed6f4b9102922'/>
<id>2f437040e7911d9bef239588ea7ed6f4b9102922</id>
<content type='text'>
some minor changes to how hard-coded sets for thread-related purposes
are handled were also needed, since the old object sizes were not
necessarily sufficient. things have gotten a bit ugly in this area,
and i think a cleanup is in order at some point, but for now the goal
is just to get the code working on all supported archs including mips,
which was badly broken by linux rejecting syscalls with the wrong
sigset_t size.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
some minor changes to how hard-coded sets for thread-related purposes
are handled were also needed, since the old object sizes were not
necessarily sufficient. things have gotten a bit ugly in this area,
and i think a cleanup is in order at some point, but for now the goal
is just to get the code working on all supported archs including mips,
which was badly broken by linux rejecting syscalls with the wrong
sigset_t size.
</pre>
</div>
</content>
</entry>
<entry>
<title>retry on cas failures in sem_trywait</title>
<updated>2012-07-24T04:51:36+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-24T04:51:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=07e62953c768f9f09485388c22ffaed98d11d676'/>
<id>07e62953c768f9f09485388c22ffaed98d11d676</id>
<content type='text'>
this seems counter-intuitive since sem_trywait is supposed to just try
once, not wait for the semaphore. however, the retry loop is not a
wait. instead, it's to handle the case where the value changes due to
a simultaneous post or wait from another thread while the semaphore
value remains positive. in such a case, it's absolutely wrong for
sem_trywait to fail with EAGAIN because the semaphore is not busy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this seems counter-intuitive since sem_trywait is supposed to just try
once, not wait for the semaphore. however, the retry loop is not a
wait. instead, it's to handle the case where the value changes due to
a simultaneous post or wait from another thread while the semaphore
value remains positive. in such a case, it's absolutely wrong for
sem_trywait to fail with EAGAIN because the semaphore is not busy.
</pre>
</div>
</content>
</entry>
<entry>
<title>avoid blx instruction which does not exist on armv4t or armv4</title>
<updated>2012-07-15T00:15:02+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-15T00:15:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=7be3b5a073e77f1147acfa728725f9f81d20ceb0'/>
<id>7be3b5a073e77f1147acfa728725f9f81d20ceb0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix several locks that weren't updated right for new futex-based __lock</title>
<updated>2012-07-12T15:23:43+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-12T15:23:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=bbbe87e35cfeef593e23010e35528e722027567f'/>
<id>bbbe87e35cfeef593e23010e35528e722027567f</id>
<content type='text'>
these could have caused memory corruption due to invalid accesses to
the next field. all should be fixed now; I found the errors with fgrep
-r '__lock(&amp;', which is bogus since the argument should be an array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
these could have caused memory corruption due to invalid accesses to
the next field. all should be fixed now; I found the errors with fgrep
-r '__lock(&amp;', which is bogus since the argument should be an array.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix pthread_kill unlocking</title>
<updated>2012-07-12T15:14:12+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-12T15:14:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=c89f130f39b413d1fb1733166ca63d694685c529'/>
<id>c89f130f39b413d1fb1733166ca63d694685c529</id>
<content type='text'>
it had not been updated for the futex-based locks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
it had not been updated for the futex-based locks
</pre>
</div>
</content>
</entry>
<entry>
<title>fix potential race condition in detached threads</title>
<updated>2012-07-12T03:36:46+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-12T03:36:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=92f8396b0c8e4f146563b87f46137484cfb36e31'/>
<id>92f8396b0c8e4f146563b87f46137484cfb36e31</id>
<content type='text'>
after the thread unmaps its own stack/thread structure, the kernel,
performing child tid clear and futex wake, could clobber a new mapping
made at the same location as the just-removed thread's tid field.
disable kernel clearing of child tid to prevent this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
after the thread unmaps its own stack/thread structure, the kernel,
performing child tid clear and futex wake, could clobber a new mapping
made at the same location as the just-removed thread's tid field.
disable kernel clearing of child tid to prevent this.
</pre>
</div>
</content>
</entry>
<entry>
<title>mips clone: don't free stack space used to copy arg</title>
<updated>2012-07-12T03:01:09+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-12T03:01:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=a03f69d4456d3ac5120cc07a22af8ecb631444bb'/>
<id>a03f69d4456d3ac5120cc07a22af8ecb631444bb</id>
<content type='text'>
the mips abi reserves stack space equal to the size of the in-register
args for the callee to save the args, if desired. this would cause the
beginning of the thread structure to be clobbered...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the mips abi reserves stack space equal to the size of the in-register
args for the callee to save the args, if desired. this would cause the
beginning of the thread structure to be clobbered...
</pre>
</div>
</content>
</entry>
<entry>
<title>fix mips clone() on real linux kernel</title>
<updated>2012-07-12T02:59:43+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-12T02:59:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=b58f738bcb5877c83aef49129b40827a1d5ae4c7'/>
<id>b58f738bcb5877c83aef49129b40827a1d5ae4c7</id>
<content type='text'>
the old code worked in qemu app-level emulation, but not on real
kernels where the clone syscall does not copy the register values to
the new thread. save arguments on the new thread stack instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the old code worked in qemu app-level emulation, but not on real
kernels where the clone syscall does not copy the register values to
the new thread. save arguments on the new thread stack instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix clone() on mips (args were in wrong order)</title>
<updated>2012-07-12T00:44:38+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-07-12T00:44:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=715b6403ce25110d594c7814e9cff860486a6f85'/>
<id>715b6403ce25110d594c7814e9cff860486a6f85</id>
<content type='text'>
with this change, threads on mips seem to be working
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
with this change, threads on mips seem to be working
</pre>
</div>
</content>
</entry>
</feed>
