Wine can't load comctl32.dll

Questions about Wine on Linux
Locked
nticompass
Level 1
Level 1
Posts: 6
Joined: Sun Sep 03, 2017 11:06 am

Wine can't load comctl32.dll

Post by nticompass »

I am using wine-2.3 (Staging) on Gentoo, compiled with gcc 6.3.0. I have both the 32- and 64-bit versions installed. (More info, like USE flags and such: https://pastebin.com/ZeYTSWL9)

I am having an issue opening pretty much any wine exe (like `wine notepad`), including winecfg. This is what I am seeing:

Code: Select all

nticompass@hypercube ~ % winecfg
fixme:winediag:start_process Wine Staging 2.3 is a testing version containing experimental patches.
fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
err:module:attach_process_dlls "comctl32.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\winecfg.exe" failed, status c0000005
How can I go about debugging this to try to figure out what is wrong? I tried copying comctl32.dll (and even comdlg32.dll) from a Windows 7 install and using `WINEDLLOVERRIDES`, but that didn't help. I also tried a clean wine prefix, which gives me:

Code: Select all

nticompass@hypercube ~ % WINEARCH=win64 WINEPREFIX=~/.wine64 winecfg
wine: created the configuration directory '/home/nticompass/.wine64'
fixme:winediag:start_process Wine Staging 2.3 is a testing version containing experimental patches.
fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
err:ole:get_local_server_stream Failed: 80004002
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
err:ole:get_local_server_stream Failed: 80004002
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
fixme:dwmapi:DwmIsCompositionEnabled 0x6dbd1518
fixme:iphlpapi:NotifyIpInterfaceChange (family 0, callback 0x69ebd3de, context 0x9c6740, init_notify 0, handle 0x12ae1c0): stub
wine: Unhandled page fault on execute access to 0x00000000 at address (nil) (thread 003b), starting debugger...
err:seh:start_debugger Couldn't start debugger ("winedbg --auto 58 44") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
wine: configuration in '/home/nticompass/.wine64' has been updated.
err:module:attach_process_dlls "comctl32.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\winecfg.exe" failed, status c0000005
Using `winedbg` wasn't much help either:

Code: Select all

nticompass@hypercube ~ % WINEARCH=win64 WINEPREFIX=~/.wine64 winedbg winecfg
wine: created the configuration directory '/home/nticompass/.wine64'
fixme:winediag:start_process Wine Staging 2.3 is a testing version containing experimental patches.
fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
err:ole:get_local_server_stream Failed: 80004002
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
err:ole:get_local_server_stream Failed: 80004002
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
fixme:dwmapi:DwmIsCompositionEnabled 0x6dbd1518
fixme:iphlpapi:NotifyIpInterfaceChange (family 0, callback 0x69ebd3de, context 0x9c6740, init_notify 0, handle 0x12ae1c0): stub
wine: Unhandled page fault on execute access to 0x00000000 at address (nil) (thread 003b), starting debugger...
err:seh:start_debugger Couldn't start debugger ("winedbg --auto 58 44") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
wine: configuration in '/home/nticompass/.wine64' has been updated.
Couldn't start process 'winecfg '
What could be wrong here? How can I trace this issue to try to figure it out? I've had other issues in Gentoo where all I needed to do was to recompile a library with gcc instead of clang (the default on my system).
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine can't load comctl32.dll

Post by Bob Wya »

nticompass wrote:I am using wine-2.3 (Staging) on Gentoo, compiled with gcc 6.3.0. I have both the 32- and 64-bit versions installed. (More info, like USE flags and such: https://pastebin.com/ZeYTSWL9)
...
Are you building Wine with gcc or clang?
Since you have set:

Code: Select all

CC="clang"
globally...

=sys-devel/gcc-6.3.0 is what I'm using to build Wine / Wine Staging with no noticeable issues...
I simply haven't bothered yet with the 6.4.0 release upgrade...
Using clang on the other hand could lead to some subtle compilation issues - since it isn't as widely tested.

I'd probably have to see the full app-emulation/wine build log - to see if there is any suspect items in the build process.

Any reason you're not using a newer version of Wine? Version 2.3 is quite old now... The current Wine Staging release is 2.15...

Bob
nticompass
Level 1
Level 1
Posts: 6
Joined: Sun Sep 03, 2017 11:06 am

Re: Wine can't load comctl32.dll

Post by nticompass »

I do have `CC="clang"` set globally, but I have it overridden for wine. wine uses `CC="gcc"`. I tried compiling wine with clang, but it failed and instead of debugging it, I just changed it to use gcc.

I am using 2.3 because any newer versions are currently masked in Gentoo. I could use 2.12 or 2.13, but I'd have to unmask it first.

It doesn't look like I have the build log, I'm not sure it saves logs from good builds, only failed ones.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine can't load comctl32.dll

Post by Bob Wya »

nticompass wrote:...
I am using 2.3 because any newer versions are currently masked in Gentoo. I could use 2.12 or 2.13, but I'd have to unmask it first.
The: app-emulation/wine package has been depreciated for months - in the main Gentoo Portage tree.
See Gentoo Wiki: Wine - New Packaging ...
Most Gentoo users, including myself, have moved over to the newer multi-slot Wine packages.

The newer Gentoo Wine packages: app-emulation/wine-{d3d,any,staging,vanilla}; are only masked against one bug...
A bug I cannot even reproduce - winegcc not working when using multi-slot Wine.
See Gentoo Bugzilla: Bug 625560 - app-emulation/wine-{any,vanilla,staging,d3d9} && app-eselect/wine: winegcc fails to link when using a variant symlink other than /usr/bin/winegcc for the details...

I've got both versions (multislot Wine and the older single slot Wine) in my Overlay ::bobwya ...
My multislot Wine implementation/fork has a lot of extra features - that the main Gentoo version doesn't support.
I aim for same day release updates - in my Wine packages.
No Gallium D3D9 support however - as I'm a 100% Nvidia "shop" here... :lol:
nticompass wrote:...
It doesn't look like I have the build log, I'm not sure it saves logs from good builds, only failed ones.
Keeping build logs is essential system maintenance - if you're going to use Gentoo in the longer term.
To enable this feature in Portage:

Code: Select all

/etc/portage/make.conf

FEATURES="... compress-build-logs ..."
PORT_LOGDIR="/var/log/portage/build"
That will log all Portage builds to the directory: "/var/log/portage/build" (example only!!) with gzip compression.
This directory should be owned by: portage:portage.
I've also got a Cron job to recompress these files with xz compression - as 2+ years worth of build logs can be a SSD/HDD space hog!
But realistically most people could delete build logs >1-2 weeks old.

Anyway I'd need to take a look at the app-emulation/wine build log to be able to help you any more.
But you'd need to be building a supported Wine package (either my own single slotted Wine package - which is maintained - or one of the newer mutlislotted Wine packages)...

Personally I think using a mixed toolchain, like you are, is going to lead to a world of extra pain - for little benefit... :wink:

Bob
nticompass
Level 1
Level 1
Posts: 6
Joined: Sun Sep 03, 2017 11:06 am

Re: Wine can't load comctl32.dll

Post by nticompass »

Thanks for the advice! I'm still learning about Gentoo :-)

I unmasked the new wine package(s) and installed wine-d3d9 2.12 using gcc 6.3.0. And this time I have the build log (thanks to `compress-build-logs`).

I'm using d3d9 because I have a game or 2 that seems to be able to utilize it along with my ATI RX 460.

Oddly, now I get a *different* error! Here's what I see now:

Code: Select all

nticompass@hypercube ~ % winecfg
err:module:attach_process_dlls "gdi32.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\winecfg.exe" failed, status c0000005
And if I use a new wine prefix, then I see:

Code: Select all

nticompass@hypercube ~ % WINEARCH=win64 WINEPREFIX=~/.wine64 winecfg
wine: created the configuration directory '/home/nticompass/.wine64'
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
err:ole:get_local_server_stream Failed: 80004002
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
err:ole:get_local_server_stream Failed: 80004002
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
fixme:dwmapi:DwmIsCompositionEnabled 0x6dbd1518
fixme:iphlpapi:NotifyIpInterfaceChange (family 0, callback 0x69ebd3de, context 0x9c65d0, init_notify 0, handle 0x12ae1c0): stub
err:module:attach_process_dlls "gdi32.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\rundll32.exe" failed, status c0000005
wine: configuration in '/home/nticompass/.wine64' has been updated.
err:module:attach_process_dlls "gdi32.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\winecfg.exe" failed, status c0000005
This issue is happening with anything I try, even `wine cmd`! I even tried as the root user and it still doesn't work.

I noticed this issue after my /home partition died. It was btrfs and suddenly was having I/O issues and wouldn't read or write without locking up the system. I created a new /home as ext4 and migrated what data I could save over to it.

Before, when comctl32.dll wasn't loading, I could at least open `wine cmd` and winetricks. Now I can't! `wine cmd` fails with the error above and thus winetricks won't open. Why is now complaining about gdi32.dll?

I think the issue is that some packages use clang (and libc++) and others use gcc (and libstdc++), but in the past the main issues I get are segfaults and all I need to do is recompile the crashing library with gcc and it fixes it. I just need to know how to debug this. I need to trace the issues here and figure out which library/libraries need possible recompiling.

Here's the build log(s) for app-emulation/wine-d3d9-2.12:
http://paste.ubuntu.com/25472441/
http://paste.ubuntu.com/25472442/ (Warning: almost 9MB)
http://paste.ubuntu.com/25472443/
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine can't load comctl32.dll

Post by Bob Wya »

@nticompass

Probably strace will give you some idea where Wine is failing:

Code: Select all

strace -e trace=open winecfg
Any reason why you've got an affinity for clang? Stallman hater? :wink:
My understanding is that even the BSD's are just working towards a 100% clang world package build+toolchain.

In future please sanitise your build logs, of colour control codes:

Code: Select all

gunzip -c "... .log.gz" |  sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | xclip -i -selection clipboard
Nobody wants to be wading through that guff on Pastebin sites!

Talking of Pastebin - please don't use that Ubuntu paste site abomination.
My god I've never seen such a badly implemented pasting site!! :roll:
Strangely reminds me of Launchpad (not in a good way)... :lol:
Anything else would be better...

I tried BTRFS a few years ago... Hah, hah what a joke (fK**g OpenSUSE suggested defaults!!)
Now I'm just using ext4 and ZFS exclusively on my NAS. Dumped SUSE for Arch.
BTRFS will never be production ready - because it wasn't developed and tested incrementally...
It's just a busted pile of nope.

Bob
nticompass
Level 1
Level 1
Posts: 6
Joined: Sun Sep 03, 2017 11:06 am

Re: Wine can't load comctl32.dll

Post by nticompass »

strace could be fun, I'll try that out.

As for why I like clang/libc++... I dunno, it's cool, it's the "new hotness"... because I can? I just wanted to try it out after hearing it *may* be faster. I'm crazy and do crazy things, like use btrfs for real data and use clang as a default compilier, again because I can. I'm aware that craziness is probably the issue here, and I'm not surprised things don't work, I just want to know why and see if I can fix it (because it totally *was* working).

As for the ubuntu pastebin... I used that because the log file was like 9MB, and I didn't think pastebin.com would accept it. I'm also sorry about the escape/control codes, I just uploaded the file without thinking (I read them in vim where I have a plugin to remove them automatically).

Thanks for being willing to help me and putting up with my craziness :-P
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine can't load comctl32.dll

Post by Bob Wya »

Hey,

I quite happy to help out a fellow Gentoo user - makes a change from the Ubuntu and #fake-distro Mint abusers that normally post here!
I've had a go at world builds with LTO and graphite. Experimentation is always the Gentoo way... 8)

A 9Mb log file is nothing. Some of my Wine logs have been multiple Gb in size. That is a problem to host anywhere!
There are loads of different paste sites out there anyway - e.g. 15 FREE Pastebin Alternatives ...

I'd seriously avoid BTRFS - it is fundamentality broken. You know you've got a problem when your filesystem is worse than NTFS... :(
The difference is that clang will be a drop-in replacement for gcc, some day.

Bob
nticompass
Level 1
Level 1
Posts: 6
Joined: Sun Sep 03, 2017 11:06 am

Re: Wine can't load comctl32.dll

Post by nticompass »

I tried the `strace` command you provided and I see some interesting output! It's certainly given me a place to start some more debugging.

Code: Select all

open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/comdlg32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/shell32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/shlwapi.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/user32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/gdi32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/advapi32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/version.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/comctl32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/winspool.drv.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/ole32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/rpcrt4.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/winmm.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/msacm32.dll.so", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib64/wine-d3d9-2.12/bin/../../../lib32/wine-d3d9-2.12/wine/uxtheme.dll.so", O_RDONLY|O_CLOEXEC) = 9
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6372, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 9
open("/usr/lib32/libncurses.so.6", O_RDONLY|O_CLOEXEC) = 9
open("/etc/terminfo/x/xterm", O_RDONLY|O_LARGEFILE) = 9
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib32/libfreetype.so.6", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib32/libz.so.1", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib32/libbz2.so.1", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib32/libpng16.so.16", O_RDONLY|O_CLOEXEC) = 10
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib32/libfontconfig.so.1", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib32/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 10
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
err:module:attach_process_dlls "gdi32.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\winecfg.exe" failed, status c0000005
+++ exited with 5 +++
Full output: https://pastebin.com/E3TYkfEK

Due to my mixed gcc/clang stuff, I've had similar issues in the past. They've been resolved by recompiling libraries with the other compiler (not sure why this fixes anything, but it has). I'll try some things and see if I can't get something working... or make everything worse.

EDIT: This is very, very similar to things that have happened in the past. Clang doesn't always produce 100% working 32-bit things. I don't know why, but I know I had an issue where basically no 32-bit program (most importantly Steam) would run. I had to recompile things with gcc to get it working.

Anyway running `wine64 winecfg` works! So, now I guess I'll need to use other debugging tools (maybe gdb/lldb) to figure out why wine (32) is failing.
nticompass
Level 1
Level 1
Posts: 6
Joined: Sun Sep 03, 2017 11:06 am

Re: Wine can't load comctl32.dll

Post by nticompass »

Hey! Guess what! Seriously, take a guess. I got wine all fixed!

I had to recompile media-libs/fontconfig and media-libs/freetype using gcc (instead of clang). Now `winecfg` (and everything else under wine) seems to work :-D

Thanks for the push in the right direction, man.
Locked