This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix locking issue in newlocale
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Ulrich dot Weigand at de dot ibm dot com, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 16 Jul 2004 14:30:32 +0200
- Subject: Re: [PATCH] Fix locking issue in newlocale
- References: <40F79EAB.1060107@suse.de> <20040716121639.GJ30497@sunsite.ms.mff.cuni.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jul 16, 2004 at 02:16:39PM +0200, Jakub Jelinek wrote:
> 2004-07-16 Jakub Jelinek <jakub@redhat.com>
>
> * locale/newlocale.c: Include bits/libc-lock.h.
> (__libc_setlocale_lock): Extern decl.
> (__newlocale): Use it.
> Reported by Ulrich Weigand <Ulrich.Weigand@de.ibm.com>.
FYI, this patch clearly doesn't fix all segfaults in 12658_thread-1, but
the crashes no longer appear in glibc locale related functions.
E.g. I get segfaults in
#0 0x0000002a957b3b40 in std::locale::name () from /usr/lib64/libstdc++.so.6
#1 0x0000002a957b5dd8 in std::locale::global () from /usr/lib64/libstdc++.so.6
#2 0x0000000000401cde in thread_main ()
#3 0x0000002a9565debc in start_thread () from /lib64/tls/libpthread.so.0
#4 0x0000002a95c30df3 in thread_start () from yy/libc.so.6
or
#0 0x0000002a95bd6c00 in strlen () from yy/libc.so.6
#1 0x0000002a957b3cc9 in std::locale::name () from /usr/lib64/libstdc++.so.6
#2 0x0000002a957b5dd8 in std::locale::global () from /usr/lib64/libstdc++.so.6
#3 0x0000000000401cde in thread_main ()
#4 0x0000002a9565debc in start_thread () from /lib64/tls/libpthread.so.0
#5 0x0000002a95c30df3 in thread_start () from yy/libc.so.6
, also malloc corruptions, etc.
Jakub