This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/9756: __verbose_terminate_handler enters infinite loop


The following reply was made to PR libstdc++/9756; it has been noted by GNATS.

From: "Stephen M. Webb" <stephenw at cryptocard dot com>
To: Phil Edwards <phil at jaj dot com>
Cc: gcc-gnats at gcc dot gnu dot org
Subject: Re: libstdc++/9756: __verbose_terminate_handler enters infinite loop
Date: Thu, 20 Feb 2003 11:01:23 -0500

 On February 19, 2003 05:04 pm, Phil Edwards wrote:
 > > >How-To-Repeat:
 > >
 > > echo "int main() { throw 0; }" > dc.cpp
 > > g++ -o dc dc.cpp
 > > ./dc
 > > ^C
 >
 > I can't reproduce this.
 
 I can't see how it's anything unique I've done, since gcc was built from 
 unmodified CVS sources for both my 3.2 and 3.4 versions.  Is it possible the 
 problem comes from binutils (I'm using 2.13.90 20021125 for gcc 3.4) or libc 
 (I have 2.2.5)?
 
 When I compile with gcc 3.2, I get expected behaviour:
 
 stephen_[153]> g++ -v
 Reading specs from /opt/gnu/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
 Configured with: ../combined/configure --enable-languages=c++ 
 --prefix=/opt/gnu --enable-threads
 Thread model: posix
 gcc version 3.2 20020326 (experimental)
 stephen_[154]> g++ -o dc dc.cpp
 stephen_[155]> ./dc
 Abort
 stephen_[156]>
 
 When I compile with yesterday's main trunk CVS (actually, it goes back a ways 
 before yesterday), I get the following unexpected behaviour.
 
 stephen_[1033]> g++ -v
 Reading specs from /smw/gnu/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
 Configured with: /home/stephenw/gnu/gcc/configure --prefix=/smw/gnu 
 --enable-threads --enable-languages=c++
 Thread model: posix
 gcc version 3.4 20030219 (experimental)
 stephen_[1034]> g++ -o dc dc.cpp
 stephen_[1035]> ./dc
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after thro^C
 stephen_[1036]>
 
 A gdb session reveals the following stack trace.
 
 ....
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 terminate called after throwing an instance of 'int'
 
 Program received signal SIGINT, Interrupt.
 0x401c1184 in __libc_write () at __libc_write:-1
 -1      __libc_write: No such file or directory.
         in __libc_write
 (gdb) bt
 #0  0x401c1184 in __libc_write () at __libc_write:-1
 #1  0x400cfd18 in __JCR_LIST__ () from /smw/gnu/lib/libstdc++.so.6
 #2  0x400acbf5 in __cxxabiv1::__terminate(void (*)()) (
     handler=0x400aef50 <__gnu_cxx::__verbose_terminate_handler()>)
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:43
 #3  0x400acc32 in std::terminate() () at 
 /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:53
 #4  0x400ace0d in __cxa_rethrow () at 
 /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_throw.cc:104
 #5  0x400af034 in __gnu_cxx::__verbose_terminate_handler() ()
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/vterminate.cc:81
 #6  0x400acbf5 in __cxxabiv1::__terminate(void (*)()) (
     handler=0x400aef50 <__gnu_cxx::__verbose_terminate_handler()>)
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:43
 #7  0x400acc32 in std::terminate() () at 
 /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:53
 ....
 #10212 0x400ace0d in __cxa_rethrow () at 
 /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_throw.cc:104
 #10213 0x400af034 in __gnu_cxx::__verbose_terminate_handler() ()
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/vterminate.cc:81
 #10214 0x400acbf5 in __cxxabiv1::__terminate(void (*)()) (
     handler=0x400aef50 <__gnu_cxx::__verbose_terminate_handler()>)
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:43
 #10215 0x400acc32 in std::terminate() () at 
 /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:53
 #10216 0x400ace0d in __cxa_rethrow () at 
 /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_throw.cc:104
 #10217 0x400af034 in __gnu_cxx::__verbose_terminate_handler() ()
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/vterminate.cc:81
 #10218 0x400acbf5 in __cxxabiv1::__terminate(void (*)()) (
     handler=0x400aef50 <__gnu_cxx::__verbose_terminate_handler()>)
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:43
 #10219 0x400acc32 in std::terminate() () at 
 /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:53
 
 
 #10220 0x400acdc2 in __cxa_throw (obj=0x400b7d59, tinfo=0x2d, dest=0x2d)
     at /home/stephenw/gnu/gcc/libstdc++-v3/libsupc++/eh_throw.cc:80
 #10221 0x080484fe in main ()
 #10222 0x40119472 in __libc_start_main (main=0x80484c4 <main>, argc=1, 
 ubp_av=0x804a660, init=0x804839c <_init>,
     fini=0x40013d8c <_dl_debug_mask>,
     rtld_fini=0x400b7fc0 <typeinfo name for 
 __cxxabiv1::__fundamental_type_info+128>, stack_end=0x30)
     at ../sysdeps/generic/libc-start.c:129
 (gdb)
 
 -- 
 Stephen M. Webb
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]