Package: valgrind
Version: 1:3.1.1-1

Brief summary
=============

When I ran a buggy program under valgrind -q, valgrind gave the output:



[snippety snip snip]

--23346-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11
(SIGSEGV) - exiting
--23346-- si_code=1;  Faulting address: 0x24930CD4;  sp: 0x62416E50

valgrind: the 'impossible' happened:
  Killed by fatal signal

[snip]

Note: see also the FAQ.txt in the source distribution.
It contains workarounds to several common problems.

If that doesn't help, please report this bug to: www.valgrind.org

[snip]

<<<<<<<<<<

See below for the full output, including the snipped parts.

Full bug report
===============

I am running a mixed system of i386 sarge and etch, although I can
easily do a dist-upgrade to pure etch if you would like. I am using
g++=4:4.0.2-2 which reports "gcc version 4.0.3 (Debian 4.0.3-1)" and
libc6=2.3.6-7.

At one point, a C++ program I was writing for school did something
invalid. I believe the invalid code was somewhere in the lines:


temp = strncpy(temp, (_str + spos), strlen(_str + spos));
string widthchars = temp;
free(temp);
<<<<<<<<<<

When I ran the program without valgrind, I got the following:


*** glibc detected *** free(): invalid next size (fast): 0x0805de20 ***
                                                                      Aborted
$
<<<<<<<<<<

When I ran "valgrind -q ./a2main 2> valg.err", I got the following:


--23346-- DWARF2 CFI reader: unhandled CFI instruction 0:50
--23346-- DWARF2 CFI reader: unhandled CFI instruction 0:50
==23346== Invalid write of size 1
==23346==    at 0x401DC20: strncpy (mac_replace_strmem.c:290)
==23346==    by 0x804A60A: TextField::TextField(char*, int, int, int,
int, char, char, char) (screen.cpp:223)
==23346==    by 0x804BCA8: test4() (a2main.cpp:315)
==23346==    by 0x804BEB2: main (a2main.cpp:83)
==23346==  Address 0x42C9D9F is 0 bytes after a block of size 31 alloc'd
==23346==    at 0x401B422: malloc (vg_replace_malloc.c:149)
==23346==    by 0x804A5B3: TextField::TextField(char*, int, int, int,
int, char, char, char) (screen.cpp:221)
==23346==    by 0x804BCA8: test4() (a2main.cpp:315)
==23346==    by 0x804BEB2: main (a2main.cpp:83)
==23346==
==23346== Invalid read of size 1
==23346==    at 0x401D0C1: strlen (mac_replace_strmem.c:243)
==23346==    by 0x40FA91A: std::string::string(char const*,
std::allocator<char> const&) (in /usr/lib/libstdc++.so.6.0.8)
==23346==    by 0x804A631: TextField::TextField(char*, int, int, int,
int, char, char, char) (screen.cpp:224)
==23346==    by 0x804BCA8: test4() (a2main.cpp:315)
==23346==    by 0x804BEB2: main (a2main.cpp:83)
==23346==  Address 0x42C9D9F is 0 bytes after a block of size 31 alloc'd
==23346==    at 0x401B422: malloc (vg_replace_malloc.c:149)
==23346==    by 0x804A5B3: TextField::TextField(char*, int, int, int,
int, char, char, char) (screen.cpp:221)
==23346==    by 0x804BCA8: test4() (a2main.cpp:315)
==23346==    by 0x804BEB2: main (a2main.cpp:83)
--23346-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11
(SIGSEGV) - exiting
--23346-- si_code=1;  Faulting address: 0x24930CD4;  sp: 0x62416E50

valgrind: the 'impossible' happened:
  Killed by fatal signal
==23346==    at 0xA01BD0C: vgPlain_arena_malloc (m_mallocfree.c:182)
==23346==    by 0xA035186: vgPlain_cli_malloc (replacemalloc_core.c:101)
==23346==    by 0xA0020AD: vgMAC___builtin_new (mac_malloc_wrappers.c:192)
==23346==    by 0xA036EC2: do_client_request (scheduler.c:987)
==23346==    by 0xA03686A: vgPlain_scheduler (scheduler.c:721)
==23346==    by 0xA04B1E3: thread_wrapper (syswrap-linux.c:86)
==23346==    by 0xA04B316: run_a_thread_NORETURN (syswrap-linux.c:119)

sched status:
 running_tid=1

Thread 1: status = VgTs_Runnable
==23346==    at 0x401B825: operator new(unsigned) (vg_replace_malloc.c:164)
==23346==    by 0x40F942A: std::string::_Rep::_S_create(unsigned,
unsigned, std::allocator<char> const&) (in
/usr/lib/libstdc++.so.6.0.8)
==23346==    by 0x40FA7C4: (within /usr/lib/libstdc++.so.6.0.8)
==23346==    by 0x40FA938: std::string::string(char const*,
std::allocator<char> const&) (in /usr/lib/libstdc++.so.6.0.8)
==23346==    by 0x804A631: TextField::TextField(char*, int, int, int,
int, char, char, char) (screen.cpp:224)
==23346==    by 0x804BCA8: test4() (a2main.cpp:315)
==23346==    by 0x804BEB2: main (a2main.cpp:83)


Note: see also the FAQ.txt in the source distribution.
It contains workarounds to several common problems.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what Linux distro you are using.  Thanks.
<<<<<<<<<<

I tried the suggestions in the FAQ, but to no avail. I have preserved
a copy of my program's source code in its buggy state in case it is
needed for more troubleshooting. If anyone would like me to try
anything, or to email you a copy of my program's source code, that
would be no problem.

Regards,
Jason Spiro

Reply via email to