From: hjl@lucon.org (H.J. Lu)
To: libc-hacker@cygnus.com (GNU C Library)
Cc: egcs-bugs@egcs.cygnus.com
Subject: A patch for linuxthreads
Date: Tue, 16 Mar 1999 20:28:00 -0000 [thread overview]
Message-ID: <m10N7wN-000ErMC@ocean.lucon.org> (raw)
Hi,
This Linuxthreads patch should fix
http://egcs.cygnus.com/ml/egcs-bugs/1999-03/msg00316.html
The problem is we should not access those key data stuctures after
a thread is terminared since they have been freed.
The patch for Versions fixes another bug.
--
H.J. Lu (hjl@gnu.org)
--
Tue Mar 16 19:30:50 1999 H.J. Lu <hjl@gnu.org>
* specific.c (pthread_key_delete): Check th->p_terminated to
if the thread is running.
* Versions (__libc_internal_tsd_get, __libc_internal_tsd_set):
Added to GLIBC_2.0 for libc.so.
Index: Versions
===================================================================
RCS file: /work/cvs/gnu/glibc/linuxthreads/Versions,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 Versions
--- Versions 1999/02/16 23:21:28 1.1.1.3
+++ Versions 1999/03/17 04:21:23
@@ -13,6 +13,9 @@ libc {
pthread_mutexattr_getkind_np; pthread_mutexattr_setkind_np;
pthread_self; pthread_setcancelstate; pthread_setcanceltype;
pthread_setschedparam;
+
+ # Internal libc interface to libpthread
+ __libc_internal_tsd_get; __libc_internal_tsd_set;
}
GLIBC_2.1 {
pthread_attr_init;
Index: specific.c
===================================================================
RCS file: /work/cvs/gnu/glibc/linuxthreads/specific.c,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 specific.c
--- specific.c 1998/12/01 16:22:30 1.1.1.5
+++ specific.c 1999/03/17 03:30:10
@@ -80,7 +80,7 @@ int pthread_key_delete(pthread_key_t key
idx2nd = key % PTHREAD_KEY_2NDLEVEL_SIZE;
th = self;
do {
- if (th->p_specific[idx1st] != NULL)
+ if (!th->p_terminated && th->p_specific[idx1st] != NULL)
th->p_specific[idx1st][idx2nd] = NULL;
th = th->p_nextlive;
} while (th != self);
next reply other threads:[~1999-03-16 20:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-16 20:28 H.J. Lu [this message]
1999-03-17 2:20 ` Mark Kettenis
1999-03-17 7:21 ` H.J. Lu
1999-03-17 4:52 ` Andrey Slepuhin
-- strict thread matches above, loose matches on Subject: below --
2000-09-04 10:48 H . J . Lu
2000-09-04 19:54 ` Ulrich Drepper
1999-12-16 16:12 H . J . Lu
[not found] ` <199912170033.QAA01416@localhost.cygnus.com>
1999-12-16 16:43 ` H . J . Lu
1999-04-14 22:31 H.J. Lu
1999-04-14 23:51 ` Ulrich Drepper
1999-03-17 13:44 Mike Stump
1999-03-18 7:44 ` H.J. Lu
1998-12-02 10:35 H.J. Lu
1998-12-02 11:44 ` Ulrich Drepper
1998-10-24 18:33 H.J. Lu
1998-10-25 0:59 ` Ulrich Drepper
1998-10-25 8:22 ` H.J. Lu
1998-10-25 8:22 ` Ulrich Drepper
1998-08-08 23:26 H.J. Lu
1998-08-09 8:59 ` Ulrich Drepper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m10N7wN-000ErMC@ocean.lucon.org \
--to=hjl@lucon.org \
--cc=egcs-bugs@egcs.cygnus.com \
--cc=libc-hacker@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).