[pw32-dev] Re: [PW32 BUG] stat() function gives "unknown signal" error in GDB.
Status: Beta
Brought to you by:
pfalcon
|
From: Paul S. <Pau...@te...> - 2000-04-08 17:14:03
|
Hello Earnie,
четверг, 6 апреля 2000 г., you wrote to me:
EB> ----stat-bug.c-----
EB> #include <sys/stat.h>
EB> int
EB> main ( int argc, void **argv )
EB> {
EB> struct stat sbuf;
EB> stat("d:/tmp/a.c", &sbuf);
EB> }
EB> ---end stat-bug.c---
EB> Attached is a bitmap of the screen during the insite debug session. The error
EB> occurs within the call to CloseHandle.
EB> This is on a NT4 sp4.
Well, took several minutes to investigate. Thank you, very obscure
bug! The cause is that FindFirstFile() returns value not belonging to
common kernel namespace, and it should be closed with FindClose()
instead of CloseHandle(). But see how NT is smart - it by default
ignores that 0xc000008 (invalid handle) exception, and its being
caught only under debugger. No need to say that 9x doesn't generate it
at all.
EB> Regards,
EB> Earnie.
--
Paul Sokolovsky, IT Specialist
http://www.brainbench.com/transcript.jsp?pid=11135
|