|
From: Jason C. <co...@cc...> - 2005-08-11 11:47:47
|
Dear Valgrind Users, I am using valgrind 2.4.1 (excellent tool - thanks) - have also tried 3.0 but get the same thing on a suse linux box (9.2) - here's the kernel gen: Linux vali 2.4.21-243-smp4G #1 SMP Thu Aug 12 15:32:27 UTC 2004 i686 i686 i386 GNU/Linux and I get a pair of messages in the following form ==22671== Warning: invalid file descriptor -1 in syscall close() ==22671== Warning: invalid file descriptor -2 in syscall close() . . a bit of output, then . ==22671== Invalid free() / delete / delete[] ==22671== at 0x3414CA69: free (vg_replace_malloc.c:152) ==22671== by 0x3530C03B: free_mem (in /lib/i686/libc.so.6) ==22671== by 0x3530BD71: __libc_freeres (in /lib/i686/libc.so.6) ==22671== by 0x341469D3: _vgw(float, long double,...)(...)(long double,...)(short) (vg_intercept.c:55) ==22671== by 0x34264BE7: IPC::run(DBManager&, int) (ipc.cpp:565) ==22671== by 0x805BEDF: server() (server.cpp:196) ==22671== by 0x805A889: main (main.cpp:88) ==22671== Address 0x3532F588 is not stack'd, malloc'd or (recently) free'd ==22671== ==22671== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 0 from 0) I can suppress the 'free_mem' message using --run-libc-freeres=no ( Although I'd like to know why I get it ;*) but I still get the file descriptor warnings. I searched through various pages and found a bug fixed report in the NEWS file 97427 "Warning: invalid file descriptor -1 in syscall close()" ... but frustratingly cant find what that pertains to ... is there any way I can easily locate where the invalid file descriptor warning is coming from (so I can prevent the invalid call?) Jason |
|
From: Dennis L. <pla...@in...> - 2005-08-11 12:04:47
|
Am Donnerstag, den 11.08.2005, 12:47 +0100 schrieb Jason Cole: > Dear Valgrind Users, > > I am using valgrind 2.4.1 (excellent tool - thanks) - have also tried > 3.0 but get the same thing on a suse linux box (9.2) - here's the kernel > gen: > > Linux vali 2.4.21-243-smp4G #1 SMP Thu Aug 12 15:32:27 UTC 2004 i686 > i686 i386 GNU/Linux > > and I get a pair of messages in the following form > > ==22671== Warning: invalid file descriptor -1 in syscall close() > ==22671== Warning: invalid file descriptor -2 in syscall close() Running valgrind3 with -v produces also for invalid file descriptor warnings a stacktrace greets Dennis |
|
From: Nicholas N. <nj...@cs...> - 2005-08-11 13:29:46
|
On Thu, 11 Aug 2005, Dennis Lubert wrote: > Running valgrind3 with -v produces also for invalid file descriptor > warnings a stacktrace This question has been asked twice recently. Perhaps we should print the stack trace by default? Or upgrade these warnings to full error messages so dups aren't shown, they can be suppressed, etc? N |
|
From: Dennis L. <pla...@in...> - 2005-08-11 14:17:05
|
Am Donnerstag, den 11.08.2005, 08:29 -0500 schrieb Nicholas Nethercote: > On Thu, 11 Aug 2005, Dennis Lubert wrote: > > > Running valgrind3 with -v produces also for invalid file descriptor > > warnings a stacktrace > > This question has been asked twice recently. Perhaps we should print the > stack trace by default? Or upgrade these warnings to full error messages > so dups aren't shown, they can be suppressed, etc? > > N I think that usually errors reported by valgrind are "serious programming errors" that should be fixed, rather than suppressed whenever possible. But passing a negative value to write/read etc. isnt that serious, since at this point the function directly reports EBADF via errno, and I think in some programs its quite common to (more or less accidently) pass invalid fds (theyre checked only now and then, maybe in between set by another thread to -1) Maybe there should be a switch like "--full-stack-trace" that shows at every possible occasion every stacktrace that can be printed, also the usual ones without limitation... greets Dennis |
|
From: Igmar P. <mai...@jd...> - 2005-08-11 14:19:53
|
> > Running valgrind3 with -v produces also for invalid file descriptor
> > warnings a stacktrace
>
> This question has been asked twice recently. Perhaps we should print the
> stack trace by default? Or upgrade these warnings to full error messages
> so dups aren't shown, they can be suppressed, etc?
I'm in favor of the 'make them errors' option. The only problem I see is
code doing :
int i;
for (i = 0; i < getdtablesize(); i++) {
close(i);
}
which I've seen numerous times in code.
Regards,
Igmar
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-11 13:34:59
|
On Thu, 11 Aug 2005, Jason Cole wrote: > I am using valgrind 2.4.1 (excellent tool - thanks) - have also tried 3.0 but > get the same thing on a suse linux box (9.2) > [...] > and I get a pair of messages in the following form > > ==22671== Warning: invalid file descriptor -1 in syscall close() > ==22671== Warning: invalid file descriptor -2 in syscall close() > . > . a bit of output, then > . > ==22671== Invalid free() / delete / delete[] > ==22671== at 0x3414CA69: free (vg_replace_malloc.c:152) > ==22671== by 0x3530C03B: free_mem (in /lib/i686/libc.so.6) > ==22671== by 0x3530BD71: __libc_freeres (in /lib/i686/libc.so.6) > ==22671== by 0x341469D3: _vgw(float, long double,...)(...)(long > double,...)(short) (vg_intercept.c:55) Is that the 3.0.0 output? The "_vgw(float..." line is showing a bug that I thought I fixed in 3.0.0. N |