This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

CYGWIN app crashes ungracefully when run from the root of a drive


Hi,

Maybe it has been covered somewhere -- I could not find the answer, so please
excuse the repetition.  I observe that if I build an app (consider the simplest
"Hello world" program below as an example), and store the executable at a standalone
location (not CYGWIN tree), yet supplemented it with a cygwin1.dll, it can then successfully
run when started in the Windows shell (CMD.EXE) from a subdirectory, but fails ungracefully
if run from the root of a drive (e.g. when stored onto a USB stick that has the "flat"
file structure, w/o subdirectories).

Can anything be done about it?  (Like allowing the app to run, or issuing an error
saying "move me to a subdirectory" -- if there are principal problems of not being able
to launch from the root directory.  The same "friendlier" manner than Windows warns
that it cannot run "a.exe" because "cygwin1.dll" is missing -- like in the case when
the DLL was not copied to the "subdir" along with the executable.)

Thanks!

#include <stdio.h>

int main(void)
{
  printf("Hello world!\n");
  return 0;
}

F:\subdir>a.exe
Hello world!

F:\subdir>cd ..

F:\>a.exe
      0 [main] a 2832 F:\a.exe: *** fatal error - add_item ("\??", "/", ...) failed, errno 22
Stack trace:
Frame     Function  Args
002868A8  6102F50B  (002868A8, 00000000, 00000000, 00000000)
00286B98  6102F50B  (6119DDA0, 00008000, 00000000, 6119FC4F)
00287BC8  6100612C  (611DD560, 00287BF4, 00000000, 60FE000C)
00287BE8  61006168  (611DD560, 00289C10, 00000016, 0003000A)
0028AC28  61091474  (60FE000C, 6122EC60, 0028ACF8, 610831B0)
0028ACF8  610D32EF  (00000000, 0028CD78, 61006720, 00000000)
End of stack trace

F:\>

Anton Lavrentiev
Contractor NIH/NLM/NCBI


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]