public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/23953] New: using stringstreams causes crashes with some locales
@ 2005-09-18 16:24 plors at hakvoort dot be
2005-09-18 16:25 ` [Bug libstdc++/23953] " plors at hakvoort dot be
` (6 more replies)
0 siblings, 7 replies; 12+ messages in thread
From: plors at hakvoort dot be @ 2005-09-18 16:24 UTC (permalink / raw)
To: gcc-bugs
The attached codesnippet (test.cc) will segfault when using the nl_BE locale.
Although i can't confirm it i have heard it migth also fail with some other locales.
------------------------------------
$ g++ -v -save-temps test.cc
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/specs
Configured with: /var/tmp/portage/gcc-3.4.4-r1/work/gcc-3.4.4/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.4
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --disable-multilib
--disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
/usr/libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus -E -quiet -v -D_GNU_SOURCE
test.cc -mtune=pentiumpro -o test.ii
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3/i686-pc-linux-gnu
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3/backward
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include
/usr/include
End of search list.
/usr/libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus -fpreprocessed test.ii -quiet
-dumpbase test.cc -mtune=pentiumpro -auxbase test -version -o test.s
GNU C++ version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
(i686-pc-linux-gnu)
compiled by GNU C version 3.4.3-20050110 (Gentoo Linux
3.4.3.20050110-r2, ssp-3.4.3.20050110-0, pie-8.7.7).
GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=113194
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/as -V
-Qy -o test.o test.s
GNU assembler version 2.15.92.0.2 (i686-pc-linux-gnu) using BFD version
2.15.92.0.2 20040927
/usr/libexec/gcc/i686-pc-linux-gnu/3.4.4/collect2 --eh-frame-hdr -m elf_i386
-dynamic-linker /lib/ld-linux.so.2
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../crt1.o
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../crti.o
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/crtbegin.o
-L/usr/lib/gcc/i686-pc-linux-gnu/3.4.4 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.4
-L/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/lib
-L/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../.. test.o -lstdc++ -lm -lgcc_s
-lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/crtend.o
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../crtn.o
---------------------------------------------------------------------------
--------------------------------
$ LC_ALL=C ./a.out
$
$ LC_ALL=nl_BE ./a.out
Segmentation fault
--------------------------------------
--
Summary: using stringstreams causes crashes with some locales
Product: gcc
Version: 3.4.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: plors at hakvoort dot be
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/23953] using stringstreams causes crashes with some locales
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
@ 2005-09-18 16:25 ` plors at hakvoort dot be
2005-09-18 16:45 ` plors at hakvoort dot be
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: plors at hakvoort dot be @ 2005-09-18 16:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From plors at hakvoort dot be 2005-09-18 16:25 -------
Created an attachment (id=9770)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9770&action=view)
test.cc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/23953] using stringstreams causes crashes with some locales
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
2005-09-18 16:25 ` [Bug libstdc++/23953] " plors at hakvoort dot be
@ 2005-09-18 16:45 ` plors at hakvoort dot be
2005-09-18 17:02 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: plors at hakvoort dot be @ 2005-09-18 16:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From plors at hakvoort dot be 2005-09-18 16:45 -------
Created an attachment (id=9771)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9771&action=view)
test.ii
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/23953] using stringstreams causes crashes with some locales
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
2005-09-18 16:25 ` [Bug libstdc++/23953] " plors at hakvoort dot be
2005-09-18 16:45 ` plors at hakvoort dot be
@ 2005-09-18 17:02 ` pinskia at gcc dot gnu dot org
2005-09-18 17:31 ` pcarlini at suse dot de
` (3 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-18 17:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-18 17:02 -------
The stack is overflowed because it is an infinite loop.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/23953] using stringstreams causes crashes with some locales
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
` (2 preceding siblings ...)
2005-09-18 17:02 ` pinskia at gcc dot gnu dot org
@ 2005-09-18 17:31 ` pcarlini at suse dot de
2005-09-18 17:42 ` pcarlini at suse dot de
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2005-09-18 17:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-09-18 17:31 -------
It looks like we are not considering some special corner cases for the localedata
in numeric_members.cc: as long as *nl_langinfo_l(THOUSANDS_SEP) != '\0' we simply
process the nl_langinfo_l(GROUPING) string as-is. We should be more careful...
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-09-18 17:31:29
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/23953] using stringstreams causes crashes with some locales
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
` (3 preceding siblings ...)
2005-09-18 17:31 ` pcarlini at suse dot de
@ 2005-09-18 17:42 ` pcarlini at suse dot de
2005-09-30 8:42 ` cvs-commit at gcc dot gnu dot org
2005-09-30 8:43 ` pcarlini at suse dot de
6 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2005-09-18 17:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-09-18 17:42 -------
Probably the best fix is in __add_grouping: we have to consider the possibility
than an integer specifying the group size is -1, which means no more groupings
(section 7. Locale of IEEE Std 1003.1, 2004 Edition)
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/23953] using stringstreams causes crashes with some locales
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
` (4 preceding siblings ...)
2005-09-18 17:42 ` pcarlini at suse dot de
@ 2005-09-30 8:42 ` cvs-commit at gcc dot gnu dot org
2005-09-30 8:43 ` pcarlini at suse dot de
6 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-30 8:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-30 08:41 -------
Subject: Bug 23953
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: paolo@gcc.gnu.org 2005-09-30 08:39:57
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/include/bits: locale_facets.tcc
Added files:
libstdc++-v3/testsuite/22_locale/num_get/get/char: 23953.cc
libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t: 23953.cc
libstdc++-v3/testsuite/22_locale/num_put/put/char: 23953.cc
libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t: 23953.cc
Log message:
2005-09-30 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/23953
* include/bits/locale_facets.tcc (__numpunct_cache<>::_M_cache,
__moneypunct_cache<>::_M_cache): Check that grouping()[0] > 0.
(__verify_grouping): Do the last check only if __grouping[__min] > 0.
(__add_grouping<>): End recursion if *__gbeg <= 0.
* testsuite/22_locale/num_get/get/char/23953.cc: New.
* testsuite/22_locale/num_get/get/wchar_t/23953.cc: Likewise.
* testsuite/22_locale/num_put/put/char/23953.cc: Likewise.
* testsuite/22_locale/num_put/put/wchar_t/23953.cc: Likewise.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3115&r2=1.3116
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&r1=1.218&r2=1.219
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/23953.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/23953.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/23953.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/23953.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/23953] using stringstreams causes crashes with some locales
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
` (5 preceding siblings ...)
2005-09-30 8:42 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-30 8:43 ` pcarlini at suse dot de
6 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2005-09-30 8:43 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23953
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-02-13 17:27 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-23953-11374@http.gcc.gnu.org/bugzilla/>
2005-11-06 1:12 ` [Bug libstdc++/23953] using stringstreams causes crashes with some locales paolo at gcc dot gnu dot org
2005-11-06 1:13 ` pcarlini at suse dot de
2005-11-06 1:13 ` pcarlini at suse dot de
2006-01-16 13:55 ` pcarlini at suse dot de
2006-02-13 17:28 ` pinskia at gcc dot gnu dot org
2005-09-18 16:24 [Bug libstdc++/23953] New: " plors at hakvoort dot be
2005-09-18 16:25 ` [Bug libstdc++/23953] " plors at hakvoort dot be
2005-09-18 16:45 ` plors at hakvoort dot be
2005-09-18 17:02 ` pinskia at gcc dot gnu dot org
2005-09-18 17:31 ` pcarlini at suse dot de
2005-09-18 17:42 ` pcarlini at suse dot de
2005-09-30 8:42 ` cvs-commit at gcc dot gnu dot org
2005-09-30 8:43 ` pcarlini at suse dot de
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).