This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/3197: Segfault in basic_ios<>::widen
- To: gcc-gnats at gcc dot gnu dot org
- Subject: libstdc++/3197: Segfault in basic_ios<>::widen
- From: los at rz dot uni-mannheim dot de
- Date: Fri, 15 Jun 2001 16:38:49 +0200 (MET DST)
- Reply-To: los at rz dot uni-mannheim dot de
>Number: 3197
>Category: libstdc++
>Synopsis: Segfault in basic_ios<>::widen
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jun 15 07:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Gert-jan Los
>Release: 3.0 20010614 (prerelease)
>Organization:
Universitaet Mannheim, Germany
>Environment:
System: SunOS memorum 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-1
Architecture: sun4
host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: sparc-sun-solaris2.7
configured with: ../gcc-3.0-20010614/configure --enable-languages=c,c++ --with-gnu-ld --with-ld=/usr/local/sparc-sun-solaris2.7/bin/ld --with-gnu-as --with-as=/usr/local/sparc-sun-solaris2.7/bin/as --disable-threads --disable-nls
>Description:
The attached program dies with an segmentation fault during
initialization (see call stack below). The program works
with older gcc versions.
I have tried a compiler configured with --disable-c-mbchars and
have used different settings of LANG and LC_*, including unsetting
them without success.
Call stack:
#0 ?? ()
#1 std::basic_ios<char, std::char_traits<char> >::widen(char) const ()
at /usr/local/include/g++-v3/bits/basic_ios.tcc:99
#2 std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*) ()
#3 std::ios_base::Init::_S_ios_create(bool) (__sync=232)
at ../../../../gcc-3.0-20010614/libstdc++-v3/include/bits/std_ostream.h:67
#4 std::ios_base::Init::Init() (this=0x32a54)
at ../../../../gcc-3.0-20010614/libstdc++-v3/src/ios.cc:203
#5 __static_initialization_and_destruction_0(int, int) ()
#6 _GLOBAL__I_verbose ()
#7 __do_global_ctors_aux ()
#8 _init ()
(gdb) frame 1
#1 0x18a78 in _ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc (this=0xff37fa3c,
__c=32 ' ') at /usr/local/include/g++-v3/bits/basic_ios.tcc:99
99 { return _M_ios_fctype->widen(__c); }
(gdb) print *_M_ios_fctype
$1 = {<__ctype_abstract_base<char>> = {<facet> = {_vptr. = 0xff375c40,
_M_references = 0}, <ctype_base> = {static upper = 1, static lower = 2,
static alpha = 16384, static digit = 4, static xdigit = 128,
static space = 8, static print = 32768, static graph = 8192,
static cntrl = 32, static punct = 16,
static alnum = 16388}, <No data fields>}, _M_del = false,
_M_toupper = @0xff2b7268, _M_tolower = @0xff2b726c, _M_ctable = @0xffbeee84,
_M_table = 0xff2a05d8, static id = {_M_index = 2, static _S_highwater = 13},
static table_size = 256}
>How-To-Repeat:
g++ -O0 -o makedep
./makedep
>Fix:
replace basic_ios.tcc line 99
{ return _M_ios_fctype->widen(__c); }
with
{ return __c; }
The resulting program survives initialization, but dies in
__do_global_dtors_aux (called from exit() -> ... -> _fini()
>Release-Note:
>Audit-Trail:
>Unformatted: