Kai Tietz schreef op do 08-08-2013 om 15:49 [+0200]:
> Hmm, not necessarily a gcc bug. It might be simply that the dll
> itself has dependencies to other dll-files.
> Try to check by dependency-walker tool, or via the objdump tool, what
> other DLL-files might be referenced.
>
> Most likely it is an issue about libgcc.dll file.
Hey Kai,
I've reproduced the issue Michael is talking about. When the testcase is
opened in dependency walker it indicates that it has direct dependencies
on libcurl-4.dll and libpq.dll (as expected). Initially everything looks
as expected. However, when I try to execute the testcase using
dependency walker then it shows that an additional dependency is
introduced for a library named '<empty string>'. The dependency walker
console shows this output:
==
Error: At least one module has an unresolved import due to a missing
export function in an implicitly dependent module.
--------------------------------------------------------------------------------
Starting profile on 8/10/2013 at 3:10:43 PM
Operating System: Microsoft Windows XP Professional (64-bit), version
5.01.2600 Service Pack 3
Program Executable: z:\home\erik\LIBPQTEST.EXE
Program Arguments:
Starting Directory: Z:\home\erik\
Search Path: C:\windows\system32;C:\windows;C:\windows\system32\wbem
Options Selected:
Simulate ShellExecute by inserting any App Paths directories into
the PATH environment variable.
Log DllMain calls for process attach and process detach messages.
Hook the process to gather more detailed dependency information.
Log LoadLibrary function calls.
Log GetProcAddress function calls.
Log debug output messages.
Automatically open and profile child processes.
--------------------------------------------------------------------------------
Started "LIBPQTEST.EXE" (process 0x25) at address 0x00400000. Cannot
hook module.
Error writing a breakpoint at the entrypoint return of "KERNEL32.DLL".
Entrypoint cannot be hooked. Access denied (5).
Error reading KERNEL32.DLL's export table. Function call tracking may
not work properly. Access denied (5).
Loaded "KERNEL32.DLL" at address 0x7B810000. Cannot hook module.
Error reading the DOS header of "NTDLL.DLL". Virtual size of module
cannot be determined. Access denied (5).
Error reading the PE headers of "NTDLL.DLL". Entrypoint address cannot
be determined. Access denied (5).
Loaded "NTDLL.DLL" at address 0x7BC10000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x7ECD0000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x7EC30000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x6CEC0000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x7EB10000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x7EFF0000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x7E9C0000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x7E980000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x65080000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x63000000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x63940000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x61CC0000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x69540000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x63B40000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x6BB80000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x7E910000. Cannot hook module.
Error reading the DOS header of "". Virtual size of module cannot be
determined. Access denied (5).
Error reading the PE headers of "". Entrypoint address cannot be
determined. Access denied (5).
Loaded "" at address 0x70800000. Cannot hook module.
Exited "LIBPQTEST.EXE" (process 0x25) with code -1073741515
(0xC0000135).
==
I do have to note that this was done from inside a Wine environment.
If I comment out the curl_global_init() call from the testcase and open
the executable in dependency walker I see that the curl dependency isn't
there any more. When I now try to execute the testcase from inside
dependency walker then it works without issues:
==
Error: At least one module has an unresolved import due to a missing
export function in an implicitly dependent module.
--------------------------------------------------------------------------------
Starting profile on 8/10/2013 at 3:13:32 PM
Operating System: Microsoft Windows XP Professional (64-bit), version
5.01.2600 Service Pack 3
Program Executable: z:\home\erik\LIBPQTEST.EXE
Program Arguments:
Starting Directory: Z:\home\erik\
Search Path: C:\windows\system32;C:\windows;C:\windows\system32\wbem
Options Selected:
Simulate ShellExecute by inserting any App Paths directories into
the PATH environment variable.
Log DllMain calls for process attach and process detach messages.
Hook the process to gather more detailed dependency information.
Log LoadLibrary function calls.
Log GetProcAddress function calls.
Log debug output messages.
Automatically open and profile child processes.
--------------------------------------------------------------------------------
Started "LIBPQTEST.EXE" (process 0x25) at address 0x00400000.
Successfully hooked module.
Loaded "KERNEL32.DLL" at address 0x7B810000. Successfully hooked
module.
Loaded "NTDLL.DLL" at address 0x7BC10000. Successfully hooked module.
Loaded "MSVCRT.DLL" at address 0x7ECB0000. Successfully hooked module.
Loaded "ADVAPI32.DLL" at address 0x7EC40000. Successfully hooked
module.
Loaded "LIBGCC_S_SJLJ-1.DLL" at address 0x6CEC0000. Successfully hooked
module.
Loaded "GDI32.DLL" at address 0x7EB20000. Successfully hooked module.
Loaded "VERSION.DLL" at address 0x7EFF0000. Successfully hooked module.
Loaded "USER32.DLL" at address 0x7E9D0000. Successfully hooked module.
Loaded "WS2_32.DLL" at address 0x7E980000. Successfully hooked module.
Loaded "ZLIB1.DLL" at address 0x65080000. Successfully hooked module.
Loaded "LIBCRYPTO-10.DLL" at address 0x00240000. Successfully hooked
module.
Loaded "IPHLPAPI.DLL" at address 0x7E900000. Successfully hooked
module.
Loaded "NETAPI32.DLL" at address 0x7E920000. Successfully hooked
module.
Loaded "SECUR32.DLL" at address 0x7E950000. Successfully hooked module.
<<snip>>
DllMain(0x7BC10000, DLL_PROCESS_DETACH, 0x00000001) in "NTDLL.DLL"
called.
DllMain(0x7BC10000, DLL_PROCESS_DETACH, 0x00000001) in "NTDLL.DLL"
returned 1 (0x1).
Exited "LIBPQTEST.EXE" (process 0x25) with code -1 (0xFFFFFFFF).
==
Does this information help?
Regards,
Erik
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public