Package: g++
Version: 3.3.3 20040110
Severity: serious
Every exception thrown is signaled by valgrind as a invalid read of 4
bytes. It seems there is something broken in the stack unrolling
mechanism.
On Debian testing, the code works as expected.
Example code:
#include <iostream>
int main(int argc, char** argv)
{
int number = 5;
try
{
throw number;
}
catch(...)
{
std::cout << "catched "<< &number << std::endl;
}
return 0;
}
Compiled with this options:
g++ -O0 -g -o testexception test_exception.cpp
valgrind reports:
valgrind -v ./testexception ==7242== Memcheck, a memory error detector
for x86-linux.
==7242== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==7242== Using valgrind-2.1.0, a program supervision framework for
x86-linux.
==7242== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==7242== Command line
==7242== ./testexception
==7242== Startup, with flags:
==7242== --suppressions=/usr/lib/valgrind/default.supp
==7242== -v
==7242== Reading syms from
/home/glaure/Projects/svu_no_smart_pointer/src/testexception
==7242== Reading syms from /lib/ld-2.3.2.so
==7242== object doesn't have a symbol table
==7242== object doesn't have any debug info
==7242== Reading syms from /usr/lib/valgrind/vgskin_memcheck.so
==7242== Reading syms from /usr/lib/valgrind/valgrind.so
==7242== Reading syms from /usr/lib/libstdc++.so.5.0.5
==7242== object doesn't have a symbol table
==7242== object doesn't have any debug info
==7242== Reading syms from /usr/lib/debug/libm-2.3.2.so
==7242== Reading syms from /lib/libgcc_s.so.1
==7242== object doesn't have a symbol table
==7242== object doesn't have any debug info
==7242== Reading syms from /usr/lib/debug/libc-2.3.2.so
==7242== Reading suppressions file: /usr/lib/valgrind/default.supp
==7242== Estimated CPU clock rate is 1921 MHz
==7242==
==7242== Invalid read of size 4
==7242== at 0x4032FB70: (within /lib/libgcc_s.so.1)
==7242== by 0x4043A017: __dl_iterate_phdr (dl-iteratephdr.c:50)
==7242== by 0x4032FF04: _Unwind_Find_FDE (in /lib/libgcc_s.so.1)
==7242== by 0x4032DA44: (within /lib/libgcc_s.so.1)
==7242== Address 0xFFFFE034 is not stack'd, malloc'd or free'd
==7242==
==7242== Invalid read of size 4
==7242== at 0x4032FE48: (within /lib/libgcc_s.so.1)
==7242== by 0x4043A017: __dl_iterate_phdr (dl-iteratephdr.c:50)
==7242== by 0x4032FF04: _Unwind_Find_FDE (in /lib/libgcc_s.so.1)
==7242== by 0x4032DA44: (within /lib/libgcc_s.so.1)
==7242== Address 0xFFFFE03C is not stack'd, malloc'd or free'd
==7242==
==7242== ERROR SUMMARY: 12 errors from 2 contexts (suppressed: 0 from 0)
==7242==
==7242== 3 errors in context 1 of 2:
==7242== Invalid read of size 4
==7242== at 0x4032FE48: (within /lib/libgcc_s.so.1)
==7242== by 0x4043A017: __dl_iterate_phdr (dl-iteratephdr.c:50)
==7242== by 0x4032FF04: _Unwind_Find_FDE (in /lib/libgcc_s.so.1)
==7242== by 0x4032DA44: (within /lib/libgcc_s.so.1)
==7242== Address 0xFFFFE03C is not stack'd, malloc'd or free'd
==7242==
==7242== 9 errors in context 2 of 2:
==7242== Invalid read of size 4
==7242== at 0x4032FB70: (within /lib/libgcc_s.so.1)
==7242== by 0x4043A017: __dl_iterate_phdr (dl-iteratephdr.c:50)
==7242== by 0x4032FF04: _Unwind_Find_FDE (in /lib/libgcc_s.so.1)
==7242== by 0x4032DA44: (within /lib/libgcc_s.so.1)
==7242== Address 0xFFFFE034 is not stack'd, malloc'd or free'd
==7242== IN SUMMARY: 12 errors from 2 contexts (suppressed: 0 from 0)
==7242==
==7242== malloc/free: in use at exit: 4 bytes in 1 blocks.
==7242== malloc/free: 2 allocs, 1 frees, 88 bytes allocated.
==7242==
--7242-- TT/TC: 0 tc sectors discarded.
--7242-- 1125 chainings, 0 unchainings.
--7242-- translate: new 2140 (33248 -> 425668; ratio 128:10)
--7242-- discard 0 (0 -> 0; ratio 0:10).
--7242-- dispatch: 0 jumps (bb entries), of which 5640 (564000%) were
unchained.
--7242-- 2/2150 major/minor sched events. 2144 tt_fast
misses.
--7242-- reg-alloc: 299 t-req-spill, 79905+1892 orig+spill uis, 10399
total-reg-r.
--7242-- sanity: 3 cheap, 1 expensive checks.
--7242-- ccalls: 8593 C calls, 56% saves+restores avoided (28522
bytes)
--7242-- 11675 args, avg 0.87 setup instrs each (2938 bytes)
--7242-- 0% clear the stack (25779 bytes)
--7242-- 3083 retvals, 34% of reg-reg movs avoided (2090
bytes)
Attachment:
signature.asc
Description: This is a digitally signed message part