opendir crashes with -mno-cygwin

Andre Bleau bleau@igb.umontreal.ca
Fri Mar 30 09:19:00 GMT 2001


Here is more info about the problem.

The program is built with:

gcc -g -mno-cygwin test_dir.c -o test_dir

cygcheck -v ./test_dir.exe gives:

Found: .\test_dir.exe
.\test_dir.exe- os=4.0 img=1.0 sys=4.0
   C:\WINNT\System32\KERNEL32.dll - os=5.0 img=5.0 sys=4.0
     "KERNEL32.dll" v0.0 ts=2000/5/3 19:43
     C:\WINNT\System32\NTDLL.DLL - os=5.0 img=5.0 sys=4.0
       "ntdll.dll" v0.0 ts=2000/5/23 20:17
   C:\WINNT\System32\msvcrt.dll - os=4.0 img=0.0 sys=4.0
     "MSVCRT.dll" v0.0 ts=1999/9/29 21:45
     C:\WINNT\System32\KERNEL32.dll (already done)

Use -h to see help about each section

I tried gcc 2.95.3-1 and 2.95.3-2 with both NT 4.0 SP6A and Windows 2000 SP1.

I attached a copy of the faulty executable. It has been renamed 
test_dir.bug to avoid triggering email virus filters.

At 09:46 2001-03-30 -0500, Earnie wrote:
>"Larry Hall (RFK Partners, Inc)" wrote:
> >
> > At 10:53 AM 3/29/2001, Andre Bleau wrote:
> > >The following very simple program segfaults in opendir when compiled 
> with -mno-cygwin but runs OK when not compiled with -mno-cygwin. I tried 
> with both gcc 2.95.3-1 and gcc 2.95.3-2.
> > >
>-8<-
> > >
> > >When compiled with -mno-cygwin, if the directory given as an argument 
> to the program does not exist, opendir returns NULL as it should. If the 
> directory does exist, for example ".", opendir segfaults.
> >
>
>Works for me.  gcc-2.95.2-9.  NT 4 sp4
>
> > Where are you getting the implementation of opendir() for -mno-cygwin?
> >
>
>It's a MinGW default library function.
>
>Earnie.

Right, it is from the latest mingw package for Cygwin. The include file is 
/usr/include/mingw/dirent.h and the lib is /usr/lib/mingw/libmingw32.a .


More information about the Cygwin mailing list