[Bug 36209] New: Sybase PowerDesigner 16.5 'pdshell16.exe' (.NET 4.x WPF app) wants non-blocking wait behaviour for ntdll.LdrLockLoaderLock (flag 0x02)

wine-bugs at winehq.org wine-bugs at winehq.org
Thu May 1 10:15:24 CDT 2014


https://bugs.winehq.org/show_bug.cgi?id=36209

            Bug ID: 36209
           Summary: Sybase PowerDesigner 16.5 'pdshell16.exe' (.NET 4.x
                    WPF app) wants non-blocking wait behaviour for
                    ntdll.LdrLockLoaderLock (flag 0x02)
           Product: Wine
           Version: 1.7.17
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ntdll
          Assignee: wine-bugs at winehq.org
          Reporter: focht at gmx.net

Hello folks,

it's unclear if the failure to get the loader lock in a non-blocking way is
really harmful to the app (there are various Wine bugs exposed in the app).

The app spams the terminal a lot with: "fixme:module:LdrLockLoaderLock flags 2
not supported".

The implementation doesn't look that hard so this might be a good candidate to
add the missing bits to Wine, making it more feature complete.

--- snip ---
$ pwd
/home/focht/.wine/drive_c/Program Files/Sybase/PowerDesigner 16

$ WINEDEBUG=+tid,+seh,+relay,+ole,+variant wine ./PdShell16.exe >>log.txt 2>&1
...
002a:Call KERNEL32.LoadLibraryW(00d2f54c L"C:\\Program
Files\\Sybase\\PowerDesigner 16\\PdCore16") ret=04a1d8f2 
...
002a:Ret  PE DLL (proc=0x600d7720,module=0x60000000
L"PdCore16.dll",reason=PROCESS_ATTACH,res=(nil)) retval=1
002a:Ret  KERNEL32.LoadLibraryW() retval=60000000 ret=04a1d8f2
...
002a:Call ntdll.LdrLockLoaderLock(00000002,0033e040,0033e044) ret=6003092f
002a:fixme:module:LdrLockLoaderLock flags 2 not supported
002a:Ret  ntdll.LdrLockLoaderLock() retval=00000000 ret=6003092f
002a:Call ntdll.LdrUnlockLoaderLock(00000000,0000002a) ret=6003095b
002a:Ret  ntdll.LdrUnlockLoaderLock() retval=00000000 ret=6003095b
002a:Call ntdll.RtlRemoveVectoredExceptionHandler(60055f40) ret=6001928b
002a:Ret  ntdll.RtlRemoveVectoredExceptionHandler() retval=00000000
ret=6001928b
002a:Call msvcr100.malloc(00000014) ret=60a31e38
002a:Call ntdll.RtlAllocateHeap(04ee0000,00000000,00000014) ret=7de36f8d
002a:Ret  ntdll.RtlAllocateHeap() retval=0ae93d18 ret=7de36f8d
002a:Ret  msvcr100.malloc() retval=0ae93d18 ret=60a31e38
002a:Call msvcr100.free(0ae93d18) ret=60a32f7d
002a:Call ntdll.RtlFreeHeap(04ee0000,00000000,0ae93d18) ret=7de36f45
002a:Ret  ntdll.RtlFreeHeap() retval=00000001 ret=7de36f45
002a:Ret  msvcr100.free() retval=00000001 ret=60a32f7d
002a:Call ntdll.RtlRemoveVectoredExceptionHandler(60055f40) ret=60054e75
002a:Ret  ntdll.RtlRemoveVectoredExceptionHandler() retval=00000000
ret=60054e75
002a:Call ntdll.LdrLockLoaderLock(00000002,0033e030,0033e034) ret=6003092f
002a:fixme:module:LdrLockLoaderLock flags 2 not supported
002a:Ret  ntdll.LdrLockLoaderLock() retval=00000000 ret=6003092f
002a:Call ntdll.LdrUnlockLoaderLock(00000000,0000002a) ret=6003095b
002a:Ret  ntdll.LdrUnlockLoaderLock() retval=00000000 ret=6003095b
002a:Call ntdll.RtlRemoveVectoredExceptionHandler(60055f40) ret=6001928b
002a:Ret  ntdll.RtlRemoveVectoredExceptionHandler() retval=00000000
ret=6001928b
002a:Call KERNEL32.InterlockedDecrement(04eff71c) ret=600feda6
002a:Ret  KERNEL32.InterlockedDecrement() retval=00000001 ret=600feda6
002a:Call ntdll.LdrLockLoaderLock(00000002,0033e108,0033e10c) ret=6003092f
002a:fixme:module:LdrLockLoaderLock flags 2 not supported
002a:Ret  ntdll.LdrLockLoaderLock() retval=00000000 ret=6003092f
002a:Call ntdll.LdrUnlockLoaderLock(00000000,0000002a) ret=6003095b
002a:Ret  ntdll.LdrUnlockLoaderLock() retval=00000000 ret=6003095b
...
--- snip ---

Debugger to get the actual caller/module:

--- snip ---
Wine-dbg>bt
Backtrace:
=>0 0x7bc55682 LdrLockLoaderLock(flags=0x2, result=0x33cef4, magic=0x33cef8)
[/home/focht/projects/wine/wine.repo/src/dlls/ntdll/loader.c:1345] in ntdll
(0x0033ceb4)
  1 0x7bc21709 in ntdll (+0x11708) (0x0033cf08)
  2 0x6003092f in pdcore16 (+0x3092e) (0x0033cf08)
  3 0x600531fe in pdcore16 (+0x531fd) (0x0033cf38)
  4 0x600a5dc7 in pdcore16 (+0xa5dc6) (0x0033d0a4)
  5 0x6014071f in pdcore16 (+0x14071e) (0x0033d0e0)
  6 0x100060eb in pdips16 (+0x60ea) (0x0033d118)
  7 0x6013f89a in pdcore16 (+0x13f899) (0x0033d188)
--- snip ---

Information from Geoff Chappell's website:
http://www.geoffchappell.com/studies/windows/win32/ntdll/api/ldrapi/lockloaderlock.htm

Source:
http://source.winehq.org/git/wine.git/blob/0e42fd97c05beb50c0788164647631c00485623b:/dlls/ntdll/loader.c#l1337

There is already a comment outlining a possible implementation.

--- snip ---
1337 /******************************************************************
1338 * LdrLockLoaderLock (NTDLL.@)
1339 *
1340 * Note: flags are not implemented.
1341 * Flag 0x01 is used to raise exceptions on errors.
1342 * Flag 0x02 is used to avoid waiting on the section (does
RtlTryEnterCriticalSection instead).
1343 */
1344 NTSTATUS WINAPI LdrLockLoaderLock( ULONG flags, ULONG *result, ULONG
*magic )
1345 {
1346     if (flags) FIXME( "flags %x not supported\n", flags );
1347
1348     if (result) *result = 1;
1349     if (!magic) return STATUS_INVALID_PARAMETER_3;
1350     RtlEnterCriticalSection( &loader_section );
1351     *magic = GetCurrentThreadId();
1352     return STATUS_SUCCESS;
1353 }
--- snip ---

$ sha1sum PowerDesigner165_DMR.exe 
c74e4cfd99500d9e3e32713b302ea35bc3f911fb  PowerDesigner165_DMR.exe

$ du -sh PowerDesigner165_DMR.exe 
810M    PowerDesigner165_DMR.exe

$ wine --version
wine-1.7.17-148-g2e5cb7a

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list