[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
PR/40411 CVS commit: src/lib/libc/locale
The following reply was made to PR pkg/40411; it has been noted by GNATS.
From: Christos Zoulas <christos%netbsd.org@localhost>
Subject: PR/40411 CVS commit: src/lib/libc/locale
Date: Fri, 16 Jan 2009 21:12:11 +0000 (UTC)
Module Name: src
Committed By: christos
Date: Fri Jan 16 21:12:11 UTC 2009
src/lib/libc/locale: _wctrans.c _wctrans_local.h _wctype.c
PR/40411: Hisashi T Fujinaka: standalone-tcsh dumps core when tab completing
The new rune code abuses __UNCONST to lazily initialize _RuneLocale. If
that happens to be the _DefaultRuneLocale which is const, the program will
core-dump because it will attempt to write to read-only memory. Catch this
and clone a copy of the locale and return it. The reason we don't see
everything core-dumping is because our shared library code probably loads
the text segment COW so it works (Is there an mprotect missing somewhere?).
But on statically linked binaries this is not the case and we die.
XXX: Vet the code so that we are sure that there is no more of that
happening trying to get rid of much of the __UNCONST'ing.
XXX: This needs to be fixed for 5.0 and all related fixes.
XXX: There is one place in the code where _DefaultRuneLocale is treated
specially, does the patch break things?
To generate a diff of this commit:
cvs rdiff -r1.8 -r1.9 src/lib/libc/locale/_wctrans.c
cvs rdiff -r1.4 -r1.5 src/lib/libc/locale/_wctrans_local.h
cvs rdiff -r1.2 -r1.3 src/lib/libc/locale/_wctype.c \
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Main Index |
Thread Index |