<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc.git/stdlib, branch fedora/master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/'/>
<entry>
<title>fix missing ctype.h include</title>
<updated>2015-08-06T06:59:52+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2015-08-06T06:44:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=283c873654a58fa21a65de3031f78f194192ff90'/>
<id>283c873654a58fa21a65de3031f78f194192ff90</id>
<content type='text'>
This file uses isspace but doesn't include ctype.h leading to:
isomac.c: In function 'get_null_defines':
isomac.c:305:30: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
	for (end = start + 1; !isspace (*end) &amp;&amp; *end != '\0'; ++end)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This file uses isspace but doesn't include ctype.h leading to:
isomac.c: In function 'get_null_defines':
isomac.c:305:30: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
	for (end = start + 1; !isspace (*end) &amp;&amp; *end != '\0'; ++end)
</pre>
</div>
</content>
</entry>
<entry>
<title>Modify several tests to use test-skeleton.c</title>
<updated>2015-08-06T06:59:04+00:00</updated>
<author>
<name>Arjun Shankar</name>
<email>arjun.is@lostca.se</email>
</author>
<published>2015-08-03T16:14:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=c1f4108352e446285e99f046e3929ed13d5e9851'/>
<id>c1f4108352e446285e99f046e3929ed13d5e9851</id>
<content type='text'>
These tests were skipped by the use-test-skeleton conversion done in
commit 29955b5d because they did not have an `int main (void)'
declaration. Instead their `main' functions were declared with arguments
(i.e. argc, argv) even though they didn't use them.

Remove these arguments and include the test skeleton in these tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These tests were skipped by the use-test-skeleton conversion done in
commit 29955b5d because they did not have an `int main (void)'
declaration. Instead their `main' functions were declared with arguments
(i.e. argc, argv) even though they didn't use them.

Remove these arguments and include the test skeleton in these tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Mention dl_load_lock by name in the comments</title>
<updated>2015-07-24T00:39:47+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-24T00:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=a81a00ff94a43af85f7aefceb6d31f3c0f11151d'/>
<id>a81a00ff94a43af85f7aefceb6d31f3c0f11151d</id>
<content type='text'>
Mention dl_load_lock by name instead of just 'load lock' in the
comments.  This makes it unambigious which lock we're talking about.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mention dl_load_lock by name instead of just 'load lock' in the
comments.  This makes it unambigious which lock we're talking about.
</pre>
</div>
</content>
</entry>
<entry>
<title>Also use l_tls_dtor_count to decide on object unload (BZ #18657)</title>
<updated>2015-07-23T05:46:18+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-23T05:46:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=90b37cac8b5a3e1548c29d91e3e0bff1014d2e5c'/>
<id>90b37cac8b5a3e1548c29d91e3e0bff1014d2e5c</id>
<content type='text'>
When an TLS destructor is registered, we set the DF_1_NODELETE flag to
signal that the object should not be destroyed.  We then clear the
DF_1_NODELETE flag when all destructors are called, which is wrong -
the flag could have been set by other means too.

This patch replaces this use of the flag by using l_tls_dtor_count
directly to determine whether it is safe to unload the object.  This
change has the added advantage of eliminating the lock taking when
calling the destructors, which could result in a deadlock.  The patch
also fixes the test case tst-tls-atexit - it was making an invalid
dlclose call, which would just return an error silently.

I have also added a detailed note on concurrency which also aims to
justify why I chose the semantics I chose for accesses to
l_tls_dtor_count.  Thanks to Torvald for his help in getting me
started on this and (literally) teaching my how to approach the
problem.

Change verified on x86_64; the test suite does not show any
regressions due to the patch.

ChangeLog:

	[BZ #18657]
	* elf/dl-close.c (_dl_close_worker): Don't unload DSO if there
	are pending TLS destructor calls.
	* include/link.h (struct link_map): Add concurrency note for
	L_TLS_DTOR_COUNT.
	* stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl):
	Don't touch the link map flag.  Atomically increment
	l_tls_dtor_count.
	(__call_tls_dtors): Atomically decrement l_tls_dtor_count.
	Avoid taking the load lock and don't touch the link map flag.
	* stdlib/tst-tls-atexit-nodelete.c: New test case.
	* stdlib/Makefile (tests): Use it.
	* stdlib/tst-tls-atexit.c (do_test): dlopen
	tst-tls-atexit-lib.so again before dlclose.  Add conditionals
	to allow tst-tls-atexit-nodelete test case to use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When an TLS destructor is registered, we set the DF_1_NODELETE flag to
signal that the object should not be destroyed.  We then clear the
DF_1_NODELETE flag when all destructors are called, which is wrong -
the flag could have been set by other means too.

This patch replaces this use of the flag by using l_tls_dtor_count
directly to determine whether it is safe to unload the object.  This
change has the added advantage of eliminating the lock taking when
calling the destructors, which could result in a deadlock.  The patch
also fixes the test case tst-tls-atexit - it was making an invalid
dlclose call, which would just return an error silently.

I have also added a detailed note on concurrency which also aims to
justify why I chose the semantics I chose for accesses to
l_tls_dtor_count.  Thanks to Torvald for his help in getting me
started on this and (literally) teaching my how to approach the
problem.

Change verified on x86_64; the test suite does not show any
regressions due to the patch.

ChangeLog:

	[BZ #18657]
	* elf/dl-close.c (_dl_close_worker): Don't unload DSO if there
	are pending TLS destructor calls.
	* include/link.h (struct link_map): Add concurrency note for
	L_TLS_DTOR_COUNT.
	* stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl):
	Don't touch the link map flag.  Atomically increment
	l_tls_dtor_count.
	(__call_tls_dtors): Atomically decrement l_tls_dtor_count.
	Avoid taking the load lock and don't touch the link map flag.
	* stdlib/tst-tls-atexit-nodelete.c: New test case.
	* stdlib/Makefile (tests): Use it.
	* stdlib/tst-tls-atexit.c (do_test): dlopen
	tst-tls-atexit-lib.so again before dlclose.  Add conditionals
	to allow tst-tls-atexit-nodelete test case to use it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove Linuxism from tst-tls-atexit</title>
<updated>2015-07-21T01:44:17+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-21T01:44:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=d72c2763056b9c0de69886f8f3e6c3ed0aaa6dd4'/>
<id>d72c2763056b9c0de69886f8f3e6c3ed0aaa6dd4</id>
<content type='text'>
The tst-tls-atexit test case searches for its module in /proc/PID/maps
to verify that it is unloaded, which is a Linux-specific test.  This
patch makes the test generic by looking for the library in the link
map list in the _r_debug structure.

Verified that the test continues to succeed on x86_64.  There is a bug
in the test case where it calls dlclose once again, which is actually
incorrect but still manages to unload the DSO thanks to an existing
bug in __tls_call_dtors.  This will be fixed in a later patch which
also fixes up the __cxa_thread_atexit_impl implementation.  I have
added a FIXME comment to that call momentarily, which I will remove
when I fix the problem.

	* stdlib/tst-tls-atexit-lib.c (do_foo): Rename to reg_dtor.
	* stdlib/tst-tls-atexit.c: (is_loaded): New function.
	(spawn_thread): New function.
	(load): Rename to reg_dtor_and_close.  Move dlopen to...
	(do_test): ... here.  Use IS_LOADED to test for its
	availability.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tst-tls-atexit test case searches for its module in /proc/PID/maps
to verify that it is unloaded, which is a Linux-specific test.  This
patch makes the test generic by looking for the library in the link
map list in the _r_debug structure.

Verified that the test continues to succeed on x86_64.  There is a bug
in the test case where it calls dlclose once again, which is actually
incorrect but still manages to unload the DSO thanks to an existing
bug in __tls_call_dtors.  This will be fixed in a later patch which
also fixes up the __cxa_thread_atexit_impl implementation.  I have
added a FIXME comment to that call momentarily, which I will remove
when I fix the problem.

	* stdlib/tst-tls-atexit-lib.c (do_foo): Rename to reg_dtor.
	* stdlib/tst-tls-atexit.c: (is_loaded): New function.
	(spawn_thread): New function.
	(load): Rename to reg_dtor_and_close.  Move dlopen to...
	(do_test): ... here.  Use IS_LOADED to test for its
	availability.
</pre>
</div>
</content>
</entry>
<entry>
<title>Whitespace fixup in cxa_thread_atexit_impl.c</title>
<updated>2015-07-16T03:24:40+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-16T03:24:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=9ceb5f6251fa0c0de5304e081e979b3f855148ed'/>
<id>9ceb5f6251fa0c0de5304e081e979b3f855148ed</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix up typo in tst-tls-atexit</title>
<updated>2015-07-14T14:57:09+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-14T14:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=38b759496b0483491e54f3946ae8f0e55d8c079f'/>
<id>38b759496b0483491e54f3946ae8f0e55d8c079f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Whitespace fix in tst-tls-atexit.c</title>
<updated>2015-07-14T14:14:55+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-14T14:14:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=8e7e971a91f03353189d37909a467b3fb6c6ec92'/>
<id>8e7e971a91f03353189d37909a467b3fb6c6ec92</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unnecessary mutex locks from tst-tls-atexit test case</title>
<updated>2015-07-10T17:53:57+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-10T17:53:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=0c8f39cbf769ef35f54b57859e1e87b5291daf5e'/>
<id>0c8f39cbf769ef35f54b57859e1e87b5291daf5e</id>
<content type='text'>
The locks don't synchronize with anything - they were likely
introduced initially to synchronize with some main thread code, but
that is no longer evident.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The locks don't synchronize with anything - they were likely
introduced initially to synchronize with some main thread code, but
that is no longer evident.
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid boolean coercion in tst-tls-atexit test case</title>
<updated>2015-07-10T17:51:32+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@redhat.com</email>
</author>
<published>2015-07-10T17:50:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=962a1aeb28ac38019034e89ae4e87e515f3d25bd'/>
<id>962a1aeb28ac38019034e89ae4e87e515f3d25bd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
