Minimal test case for Make crash bug

Dan Kegel
Sun Mar 21 15:29:00 GMT 2004

Dan Kegel wrote:
> int main(int argc, char **argv)
> {
>         int i;
>         for (i=0; ; i++) {
>                 int fd = open("foo.c", O_RDONLY);
>                 printf("fd #%d is %d\n", i, fd);
>         }
> }
> This crashes for me at the 133rd fd unless I run it under gdb ...

OK, I built a debugging version of cygwin1.dll and dropped it
on top of the normal one, then ran my test program with
   export CYGWIN=error_start:C:\\cygwin\\bin\\gdb.exe
and hit 'c' and then 'bt' as suggested.  Looks like the
debugger is a bit happier with the debugging build.
I don't have time to look at it tonight, but in case
it makes any sense to you, here's the backtrace.


Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 660.0x838]
fhandler_base::fhandler_base() (this=0x0)
1275    {
Current language:  auto; currently c++
(gdb) bt
#0  fhandler_base::fhandler_base() (this=0x0)
#1  0x61031854 in fhandler_disk_file::fhandler_disk_file() (this=0x0)
#2  0x6101e174 in build_fh_pc(path_conv&) (pc=@0x22ec90)
     at ../../../../cygwin-snapshot-20040318-1/winsup/cygwin/fhandler.h:311
#3  0x6101ded8 in build_fh_name(char const*, void*, unsigned, 
suffix_info*) (
     name=0x401050 "foo.c", h=0x0, opt=1, si=0x0)
     at ../../../../cygwin-snapshot-20040318-1/winsup/cygwin/
#4  0x61095071 in open (unix_path=0x401050 "foo.c", flags=0)
     at ../../../../cygwin-snapshot-20040318-1/winsup/cygwin/
#5  0x610883cf in _sigfe ()
     at ../../../../cygwin-snapshot-20040318-1/winsup/cygwin/cygserver.h:82
#6  0x00000085 in ?? ()
#7  0xffffffff in ?? ()
#8  0x0022f070 in ?? ()

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list