This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] BZ #14545: Always check dtv before freeing dtv[-1]


On Thu, Sep 6, 2012 at 5:49 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Sep 6, 2012 at 1:08 AM, Andreas Jaeger <aj@suse.com> wrote:
>> On Wednesday, September 05, 2012 13:21:07 H.J. Lu wrote:
>>> Hi,
>>>
>>> We should always check dtv before freeing dtv[-1], including in
>>> libc.a, since dtv is a static array in libc.a.  _dl_initial_dtv
>>> is intialized to &static_dtv[1] so that index -1 contains the length.
>>> Testd on Linux/x86-64.  OK to install?
>>
>> Could you add a test for the testsuite, please?
>
> Many tests failed statically to due
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=14544
>
> A patch was posted at
>
> http://sourceware.org/ml/libc-alpha/2012-09/msg00059.html
>
> I need to apply this before adding a test.
>

Here is the testcase.  But it fails even with my fix for PR 14545
due to PR 14544.

-- 
H.J.
---
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index f4b7ff3..34b3698 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #14545]
+	* Makefile (tests-static): Add tst-cancel21-static.
+	(tests): Likewise.
+	* tst-cancel21-static.c: New file.
+
 2012-09-01  Joseph Myers  <joseph@codesourcery.com>

 	* sysdeps/unix/sysv/linux/pthread_getcpuclockid.c
diff --git a/nptl/Makefile b/nptl/Makefile
index 614f0ce..ad7ac05 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -348,8 +348,9 @@ CFLAGS-funlockfile.c = $(libio-mtsafe)
 link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
 		    $(common-objpfx)libc.a

-tests-static += tst-locale1 tst-locale2 tst-stackguard1-static
-tests += tst-stackguard1-static
+tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
+		tst-cancel21-static
+tests += tst-stackguard1-static tst-cancel21-static
 xtests-static += tst-setuid1-static

 # These tests are linked with libc before libpthread
diff --git a/nptl/tst-cancel21-static.c b/nptl/tst-cancel21-static.c
new file mode 100644
index 0000000..2a01061
--- /dev/null
+++ b/nptl/tst-cancel21-static.c
@@ -0,0 +1 @@
+#include "tst-cancel21.c"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]