no message or dialog when a DLL is missing

Wang Yiping ypwangandy@gmail.com
Fri Aug 25 07:58:00 GMT 2006


>
> Now, the analysis: according to strace, the spawning process (e.g., the
> shell) does receive the Windows exception C0000135 (a.k.a.
> STATUS_DLL_NOT_FOUND), handles it, and uses it to set exit code to 0x35.
> My guess is that neither cmd.exe nor the Windows launcher install a
> handler for the exceptions, and thus the default Windows handler (which
> creates a pop-up) is used.
>
Hi, All:

I met the same problem after I installed mozilla gecko-sdk.

I used strace and got some interesting results:
a.) run with the whole path.
$ strace.exe /cygdrive/d/dev/gecko-sdk/bin/xpidl.exe
strace.exe: error creating process D:/dev/cygwin/cygdrive/d/dev/gecko-sdk/bin/xp
idl.exe, (error 3)

b.) goto that dir, then run
$ strace.exe ./xpidl.exe
--- Process 1736, exception C0000135 at 7C984ED1
ypwang@ypwang /cygdrive/d/dev/gecko-sdk/bin
It will pop-pu the "cannot find Xxx.dll " windows.

These strange behaviour is caused by path.cc in utils. When given a's
path, it can not parse it correctly (ONLY when with  /cygdrive/xxx,
/usr/bin/xxx is OK.) . the attachment shows the evidence.

So It seems cygwin can handle the exception (at least in strace). It
is maybe a question to the bash 3.1.

Best Regards.

Andy
-------------- next part --------------
(gdb) r /cygdrive/d/dev/gecko-sdk/bin/xpidl.exe
Starting program: /tmp/cygwin/cygwin-snapshot-20060818-1/winsup/utils/strace.exe
 /cygdrive/d/dev/gecko-sdk/bin/xpidl.exe
Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/msvcrt.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll

Breakpoint 2, main (argc=2, argv=0x3d2c10) at strace.cc:918
918     {
(gdb) n
919       unsigned mask = 0;
(gdb)
920       FILE *ofile = NULL;
(gdb)
921       pid_t pid = 0;
(gdb)
923       int toggle = 0;
(gdb)
924       int sawquiet = -1;
(gdb)
926       if (load_cygwin ())
(gdb)

928           char **av = (char **) cygwin_internal (CW_ARGV);
(gdb)
929           if (av && (DWORD) av != (DWORD) -1)
(gdb)
934       if (!(pgm = strrchr (*argv, '\\')) && !(pgm = strrchr (*argv, '/')))
(gdb)
937         pgm++;
(gdb)
939       while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != EOF)
(gdb)
1016      if (pid && argv[optind])
(gdb)
1019      if (!pid && !argv[optind])
(gdb)
1022      if (toggle && !pid)
(gdb)
1025      if (!pid)
(gdb)
1026        quiet = sawquiet < 0 || !sawquiet;
(gdb)
1032      if (!mask)
(gdb)
1033        mask = _STRACE_ALL;
(gdb)
1035      if (bufsize)
(gdb)
1038      if (!ofile)
(gdb)
1039        ofile = stdout;
(gdb)
1041      DWORD res = 0;
(gdb)
1042      if (toggle)
(gdb)
1045        res = dostrace (mask, ofile, pid, argv + optind);
(gdb) s
dostrace (mask=1, ofile=0x77c2fca0, pid=0, argv=0x3d2c14) at strace.cc:686
686       if (!pid)
(gdb) n
687         create_child (argv);
(gdb)
strace.exe: error creating process D:\dev\cygwin\cygdrive/d/dev/gecko-sdk/bin/xp
idl.exe, (error 3)

Program exited with code 01.
(gdb) quit
ypwang@ypwang /tmp/cygwin/cygwin-snapshot-20060818-1/winsup/utils

  ========== in create_child
328       ret = CreateProcess (0, one_line.buf, /* command line */
(gdb) p one_line.buf
$10 = 0x3d4af0 "D:\\dev\\cygwin\\cygdrive/d/dev/gecko-sdk/bin/xpidl.exe"
(gdb) n
335       if (!ret)
(gdb)
336         error (0, "error creating process %s, (error %d)", *argv,
(gdb) p ret
$11 = 0



ypwang@ypwang /cygdrive/d/dev/gecko-sdk/bin

$ gdb /tmp/cygwin/cygwin-snapshot-20060818-1/winsup/utils/strace.exe
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) r ./xpidl.exe
 ...
 ...
1045        res = dostrace (mask, ofile, pid, argv + optind);
(gdb) s
dostrace (mask=1, ofile=0x77c2fca0, pid=0, argv=0x3d3f14) at strace.cc:686
686       if (!pid)
(gdb) n
687         create_child (argv);
(gdb)
691       return proc_child (mask, ofile, pid);
(gdb) s
proc_child (mask=1, ofile=0x77c2fca0, pid=0) at strace.cc:594
594       DWORD res = 0;
(gdb) n
598       SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST);
 .....
 .....
(gdb)
658           if (!ContinueDebugEvent (ev.dwProcessId, ev.dwThreadId, status))
(gdb)
661           if (!processes)
(gdb) n
602           BOOL debug_event = WaitForDebugEvent (&ev, 1000);
(gdb)
603           DWORD status = DBG_CONTINUE;
(gdb)
605           if (bufsize && flush_period > 0 &&
(gdb)
612           if (!debug_event)
(gdb)
615           if (pid)
(gdb)
621           switch (ev.dwDebugEventCode)
(gdb)
648               if (ev.u.Exception.ExceptionRecord.ExceptionCode != STATUS_BRE
AKPOINT)
(gdb)
650                   status = DBG_EXCEPTION_NOT_HANDLED;
(gdb)
651                   if (ev.u.Exception.dwFirstChance)
(gdb)
652                     fprintf (ofile, "--- Process %u, exception %p at %p\n",
ev.dwProcessId,
(gdb) n
--- Process 1996, exception C0000135 at 7C984ED1
658           if (!ContinueDebugEvent (ev.dwProcessId, ev.dwThreadId, status))
(gdb)

  
  ========== in create_child
(gdb) n
328       ret = CreateProcess (0, one_line.buf, /* command line */
(gdb)
335       if (!ret)
(gdb) p ret
$3 = 1
(gdb) n
339       CloseHandle (pi.hThread);
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list