|
From: Xavier B. <xav...@fr...> - 2004-03-25 18:18:32
|
Hi, during a valgrind session I stumbled on that (this is the first error): ==22013== Invalid read of size 1 .... ==22013== Address 0x48C1D128 is not stack'd, malloc'd or free'd When I attach to gdb at this point, and I examine the content of memory at 0x48C1D128 (to which a char* is pointing), I find a string which really seems like it has been written by my program. How is this possible ? How could my program write to a non stack'd, malloc'd or free'd address before this point and not been caught by valgrind ? Thanks for your enlightenments, Xav Please Cc: me |
|
From: Nicholas N. <nj...@ca...> - 2004-03-25 18:51:40
|
On Thu, 25 Mar 2004, Xavier Bestel wrote: > during a valgrind session I stumbled on that (this is the first error): > > ==22013== Invalid read of size 1 > .... > ==22013== Address 0x48C1D128 is not stack'd, malloc'd or free'd > > > When I attach to gdb at this point, and I examine the content of memory > at 0x48C1D128 (to which a char* is pointing), I find a string which > really seems like it has been written by my program. > > How is this possible ? How could my program write to a non stack'd, > malloc'd or free'd address before this point and not been caught by > valgrind ? It does seem a bit strange. Can you write a small example program that shows the problem? N |
|
From: Xavier B. <xav...@fr...> - 2004-03-26 08:53:39
|
Le jeu 25/03/2004 à 19:51, Nicholas Nethercote a écrit : > On Thu, 25 Mar 2004, Xavier Bestel wrote: > > > during a valgrind session I stumbled on that (this is the first error): > > > > ==22013== Invalid read of size 1 > > .... > > ==22013== Address 0x48C1D128 is not stack'd, malloc'd or free'd > > > > > > When I attach to gdb at this point, and I examine the content of memory > > at 0x48C1D128 (to which a char* is pointing), I find a string which > > really seems like it has been written by my program. > > > > How is this possible ? How could my program write to a non stack'd, > > malloc'd or free'd address before this point and not been caught by > > valgrind ? > > It does seem a bit strange. Can you write a small example program that > shows the problem? Well, not easily. The program is quite big, I know only a tiny part of the code and I don't know what happens there (that's precisely why I run valgrind). If I find the bug in the program I'll perhaps have a chance to write a testcase for valgrind. In the meantime if you want me to run some tests, I'm there. Oh, I'm using version 2.0.0 if it matters. Regards, Xav |
|
From: Nicholas N. <nj...@ca...> - 2004-03-26 08:54:40
|
On Fri, 26 Mar 2004, Xavier Bestel wrote: > > It does seem a bit strange. Can you write a small example program that > > shows the problem? > > Well, not easily. The program is quite big, I know only a tiny part of > the code and I don't know what happens there (that's precisely why I run > valgrind). If I find the bug in the program I'll perhaps have a chance > to write a testcase for valgrind. In the meantime if you want me to run > some tests, I'm there. > Oh, I'm using version 2.0.0 if it matters. It might be worth trying 2.1.1; there were some big internal changes between 2.0.0 and 2.1.x. N |
|
From: Xavier B. <xav...@fr...> - 2004-03-29 10:38:24
|
On Fri, 2004-03-26 at 08:54 +0000, Nicholas Nethercote wrote: > On Fri, 26 Mar 2004, Xavier Bestel wrote: > > > > It does seem a bit strange. Can you write a small example program that > > > shows the problem? > > > > Well, not easily. The program is quite big, I know only a tiny part of > > the code and I don't know what happens there (that's precisely why I run > > valgrind). If I find the bug in the program I'll perhaps have a chance > > to write a testcase for valgrind. In the meantime if you want me to run > > some tests, I'm there. > > Oh, I'm using version 2.0.0 if it matters. > > It might be worth trying 2.1.1; there were some big internal changes > between 2.0.0 and 2.1.x. I've just tried 2.1.1 (with a slightly different version of my program) and I have exactely the same result. Although the address is different, the string dereferenced is the same, and valgrind keeps on pretending it's a virgin portion of memory. How can I easily help what looks like a valgrind bug ? Xav |
|
From: Nicholas N. <nj...@ca...> - 2004-03-29 10:52:30
|
On Mon, 29 Mar 2004, Xavier Bestel wrote: > I've just tried 2.1.1 (with a slightly different version of my program) > and I have exactely the same result. Although the address is different, > the string dereferenced is the same, and valgrind keeps on pretending > it's a virgin portion of memory. > How can I easily help what looks like a valgrind bug ? Please file a bug report (see valgrind.kde.org/bugs.html). The more relevant info you can include the better. N |
|
From: Xavier B. <xav...@fr...> - 2004-03-30 09:57:45
|
On Mon, 2004-03-29 at 11:52 +0100, Nicholas Nethercote wrote: > On Mon, 29 Mar 2004, Xavier Bestel wrote: > > > I've just tried 2.1.1 (with a slightly different version of my program) > > and I have exactely the same result. Although the address is different, > > the string dereferenced is the same, and valgrind keeps on pretending > > it's a virgin portion of memory. > > How can I easily help what looks like a valgrind bug ? > > Please file a bug report (see valgrind.kde.org/bugs.html). The more > relevant info you can include the better. http://bugs.kde.org/show_bug.cgi?id=78729 Not much info, but I'm willing to provide more when asked. Xav |