* [Bug c++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
@ 2004-02-05 10:59 ` hubert dot schmid at stud dot uka dot de
2004-02-05 16:26 ` bangerth at dealii dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: hubert dot schmid at stud dot uka dot de @ 2004-02-05 10:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From hubert dot schmid at stud dot uka dot de 2004-02-05 10:59 -------
Okay, the command line and compiler output is missing: Here it is. The following
program (same as in original description) does not work with:
/tmp > g++-3.2 -v -Wall bug-ex.cc -o bug-ex
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,f77,objc,ada
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3 (Debian)
/usr/lib/gcc-lib/i386-linux/3.2.3/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=2
-D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__
-Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux
-Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386
-Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ bug-ex.cc -D__GNUG__=3
-D__DEPRECATED -D__EXCEPTIONS -quiet -dumpbase bug-ex.cc -Wall -version -o
/tmp/ccXJp6ZE.s
GNU CPP version 3.2.3 (Debian) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.2.3 (Debian) (i386-linux)
compiled by GNU C version 3.2.3 (Debian).
ignoring nonexistent directory "/usr/i386-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/3.2
/usr/include/c++/3.2/i386-linux
/usr/include/c++/3.2/backward
/usr/local/include
/usr/lib/gcc-lib/i386-linux/3.2.3/include
/usr/include
End of search list.
as -V -Qy -o /tmp/cc7xIPyK.o /tmp/ccXJp6ZE.s
GNU assembler version 2.14.90.0.7 (i386-linux) using BFD version 2.14.90.0.7
20031029 Debian GNU/Linux
/usr/lib/gcc-lib/i386-linux/3.2.3/collect2 --eh-frame-hdr -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o bug-ex
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../crt1.o
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../crti.o
/usr/lib/gcc-lib/i386-linux/3.2.3/crtbegin.o -L/usr/lib/gcc-lib/i386-linux/3.2.3
-L/usr/lib/gcc-lib/i386-linux/3.2.3/../../.. /tmp/cc7xIPyK.o -lstdc++ -lm
-lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i386-linux/3.2.3/crtend.o
/usr/lib/gcc-lib/i386-linux/3.2.3/../../../crtn.o
#include <iostream>
int main()
{
try {
throw 1;
} catch (...) {
try {
throw;
} catch (...) {
std::cout << std::uncaught_exception() << std::endl;
}
}
std::cout << std::uncaught_exception() << std::endl;
}
Wrong output:
1
1
Correct output:
0
0
Same behaviour with gcc 3.3.3 (Debian):
/tmp > g++-3.3 -v -Wall bug-ex.cc -o bug-ex
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 20040125 (prerelease) (Debian)
/usr/lib/gcc-lib/i486-linux/3.3.3/cc1plus -quiet -v -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE bug-ex.cc -D__GNUG__=3
-quiet -dumpbase bug-ex.cc -auxbase bug-ex -Wall -version -o /tmp/ccSG2PSd.s
GNU C++ version 3.3.3 20040125 (prerelease) (Debian) (i486-linux)
compiled by GNU C version 3.3.3 20040125 (prerelease) (Debian).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64471
ignoring nonexistent directory "/usr/i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/3.3
/usr/include/c++/3.3/i486-linux
/usr/include/c++/3.3/backward
/usr/local/include
/usr/lib/gcc-lib/i486-linux/3.3.3/include
/usr/include
End of search list.
as -V -Qy -o /tmp/ccQNDRUV.o /tmp/ccSG2PSd.s
GNU assembler version 2.14.90.0.7 (i386-linux) using BFD version 2.14.90.0.7
20031029 Debian GNU/Linux
/usr/lib/gcc-lib/i486-linux/3.3.3/collect2 --eh-frame-hdr -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o bug-ex
/usr/lib/gcc-lib/i486-linux/3.3.3/../../../crt1.o
/usr/lib/gcc-lib/i486-linux/3.3.3/../../../crti.o
/usr/lib/gcc-lib/i486-linux/3.3.3/crtbegin.o -L/usr/lib/gcc-lib/i486-linux/3.3.3
-L/usr/lib/gcc-lib/i486-linux/3.3.3/../../.. /tmp/ccQNDRUV.o -lstdc++ -lm
-lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i486-linux/3.3.3/crtend.o
/usr/lib/gcc-lib/i486-linux/3.3.3/../../../crtn.o
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
2004-02-05 10:59 ` [Bug c++/14026] " hubert dot schmid at stud dot uka dot de
@ 2004-02-05 16:26 ` bangerth at dealii dot org
2004-02-05 16:40 ` [Bug libstdc++/14026] " pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-02-05 16:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-02-05 16:26 -------
Confirmed. I don't know if this is a C++ or libstdc++ problem, though.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |3.2.3 3.3.3 3.4.0 3.5.0
Last reconfirmed|0000-00-00 00:00:00 |2004-02-05 16:26:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
2004-02-05 10:59 ` [Bug c++/14026] " hubert dot schmid at stud dot uka dot de
2004-02-05 16:26 ` bangerth at dealii dot org
@ 2004-02-05 16:40 ` pinskia at gcc dot gnu dot org
2004-02-05 21:53 ` pcarlini at suse dot de
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-05 16:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-05 16:40 -------
Almost sure that this is a libstdc++ bug.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |libstdc++
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (2 preceding siblings ...)
2004-02-05 16:40 ` [Bug libstdc++/14026] " pinskia at gcc dot gnu dot org
@ 2004-02-05 21:53 ` pcarlini at suse dot de
2004-02-05 22:42 ` pcarlini at suse dot de
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-02-05 21:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-02-05 21:53 -------
Yes, it's a libstdc++ bug.
It looks like uncaught_exception() has always (3.0.0 ->) been buggy in case of
rethrow: globals->uncaughtExceptions (which is an unsigned int) is not increased
from 0, then when is decreased in the catch block becomes (unsigned int)(-1) and
uncaught_exception, which is globals->uncaughtExceptions != 0, returns 1. Ouch!
--
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=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (3 preceding siblings ...)
2004-02-05 21:53 ` pcarlini at suse dot de
@ 2004-02-05 22:42 ` pcarlini at suse dot de
2004-02-06 14:26 ` pcarlini at suse dot de
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-02-05 22:42 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pcarlini at suse dot de |unassigned at gcc dot gnu
| |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (4 preceding siblings ...)
2004-02-05 22:42 ` pcarlini at suse dot de
@ 2004-02-06 14:26 ` pcarlini at suse dot de
2004-02-08 18:01 ` cvs-commit at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2004-02-06 14:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-02-06 14:26 -------
If I'm not mistaken you are the original author of the new exception handling
code. Can you possibly have a look at this bug and 10606?
Thanks!
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rth at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (5 preceding siblings ...)
2004-02-06 14:26 ` pcarlini at suse dot de
@ 2004-02-08 18:01 ` cvs-commit at gcc dot gnu dot org
2004-02-08 18:11 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-08 18:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-08 18:01 -------
Subject: Bug 14026
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: rth@gcc.gnu.org 2004-02-08 18:01:23
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/libsupc++: eh_catch.cc
Added files:
libstdc++-v3/testsuite/18_support: 14026.cc
Log message:
PR libstdc++/14026
* libsupc++/eh_catch.cc (__cxa_begin_catch): Don't adjust
uncaughtExceptions during nested catch rethrow.
* testsuite/18_support/14026.cc: New.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2315&r2=1.2316
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/libsupc++/eh_catch.cc.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/18_support/14026.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (6 preceding siblings ...)
2004-02-08 18:01 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-08 18:11 ` cvs-commit at gcc dot gnu dot org
2004-02-08 18:19 ` rth at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-08 18:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-08 18:11 -------
Subject: Bug 14026
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: rth@gcc.gnu.org 2004-02-08 18:11:23
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/libsupc++: eh_catch.cc
Added files:
libstdc++-v3/testsuite/18_support: 14026.cc
Log message:
PR libstdc++/14026
* libsupc++/eh_catch.cc (__cxa_begin_catch): Don't adjust
uncaughtExceptions during nested catch rethrow.
* testsuite/18_support/14026.cc: New.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.26&r2=1.2224.2.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/libsupc++/eh_catch.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.5&r2=1.5.16.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/18_support/14026.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (7 preceding siblings ...)
2004-02-08 18:11 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-08 18:19 ` rth at gcc dot gnu dot org
2004-02-08 19:45 ` pinskia at gcc dot gnu dot org
2004-08-16 15:58 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-02-08 18:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2004-02-08 18:19 -------
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00730.html
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (8 preceding siblings ...)
2004-02-08 18:19 ` rth at gcc dot gnu dot org
@ 2004-02-08 19:45 ` pinskia at gcc dot gnu dot org
2004-08-16 15:58 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-08 19:45 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/14026] std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception)
2004-02-05 10:54 [Bug c++/14026] New: std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception) hubert dot schmid at stud dot uka dot de
` (9 preceding siblings ...)
2004-02-08 19:45 ` pinskia at gcc dot gnu dot org
@ 2004-08-16 15:58 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-16 15:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-08-16 15:58 -------
Subject: Bug 14026
CVSROOT: /cvs/gcc
Module name: gcc
Branch: hammer-3_3-branch
Changes by: paolo@gcc.gnu.org 2004-08-16 15:58:45
Modified files:
libstdc++-v3 : ChangeLog.hammer
libstdc++-v3/libsupc++: eh_catch.cc
Log message:
2004-08-16 Richard Henderson <rth@redhat.com>
PR libstdc++/14026
* libsupc++/eh_catch.cc (__cxa_begin_catch): Don't adjust
uncaughtExceptions during nested catch rethrow.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.39&r2=1.1.2.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/libsupc++/eh_catch.cc.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.3.32.1&r2=1.3.32.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14026
^ permalink raw reply [flat|nested] 12+ messages in thread