Unable to run Wine; gdi32.dll error

Questions about Wine on Linux
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Unable to run Wine; gdi32.dll error

Post by osarusan »

I cannot get any wine program to run, not even winecfg.

This is a fresh install of Ubuntu 13.10 x64.
I have tried this with the default wine 1.4 in the repos, as well wine 1.6 and 1.7 from the Ubuntu wine team PPA, deleting the .wine directory before each attempt.
I have tried using various wine versions in PlayOnLinux as well, but the same issue happens each time.

Here's what happens on a fresh install when I try to run winecfg:

Code: Select all

osarusan@GLaDOS:~$ winecfg
wine: created the configuration directory '/home/osarusan/.wine'
fixme:storage:create_storagefile Storage share mode not implemented.
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:storage:create_storagefile Storage share mode not implemented.
fixme:iphlpapi:NotifyAddrChange (Handle 0x103e248, overlapped 0x103e260): 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/osarusan/.wine' 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
Any ideas?? This is driving me crazy as I can't do a single thing with wine at this point... Never had this trouble in the past...
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Unable to run Wine; gdi32.dll error

Post by oiaohm »

osarusan have you tried a clean wine prefix.

either rm -rf ~/.wine deleting current prefix. Or WINEPREFIX=newlocation winecfg

Most people make the mistake with wine thinking uninstalling and reinstalling will make wine clean and new.

Clean and new also requires getting rid of the old WINEPREFIX.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

Yes, I've tried that numerous times. No matter what, I always get the "gdi32.dll" failed to initialize error whenever wine runs for the first time in a new wineprefix.
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Unable to run Wine; gdi32.dll error

Post by dimesio »

Try uninstalling all versions of Wine completely, then install only one.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

I've done that numerous times. No matter which version I use the same error comes up.
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Unable to run Wine; gdi32.dll error

Post by dimesio »

Something is broken on your system. I don't think it's the Wine package, because we have many Ubuntu users and you're the only one reporting this problem here, but you might want to contact the package maintainer to find out if he knows anything about it.

It's possible that some conflicting files may have been left behind from one of the many versions of Wine you've tried. Those you would have to search for and remove manually.

The only other thing I can think of is that some security setting on your system could be preventing Wine from running. Exactly what that might be, I don't know.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

I don't know what could be left over... I've completely purged wine and removed the wine prefix too many times to count now. It could be a security setting I suppose, but I have no idea what it would be. I don't really know where to go from here to debug this further or what, but if you have any suggestions I am all ears.
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Unable to run Wine; gdi32.dll error

Post by dimesio »

There was a problem with the Ubuntu 13.10 packages last month, but it was reported fixed 3 weeks ago. Make sure the Wine package you are using is current.

You might want to ask for help on the Ubuntu forum.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

It's current for sure. I have tried the wine 1.4 that is in the 13.10 repos, as well as 1.6 and 1.7 from the Ubuntu Wine Team PPA. Each time it errors out with pretty much the same thing. It tells me that gdi32.dll failed to initialize, that it couldn't allocated memory on the X screen, and any number of other failures... but gdi32.dll is a constant recurring error. I've posted to Ubuntuforums as well, but no responses in the past week...
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Unable to run Wine; gdi32.dll error

Post by oiaohm »

osarusan ok what ever is going on here should not be happening full stop. So time to return to basics because something basic has to be wrong.

osarusan you did install 32 bit version? Yes wine is evil this way install the 64 bit version can result in 32 bit version of wine not being installed and it doing stupid things.

"wine --version" does this report the version you expect. If you have built from source its possible to build wine missing gdi32.dll.so
whereis wine

And finally.
find /usr -iname "gdi32.dll.so"
If it does not exist we have a problem.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

Code: Select all

osarusan@GLaDOS:~$ wine --version
wine-1.7.4
osarusan@GLaDOS:~$ find /usr -iname "gdi32.dll.so"
/usr/lib/i386-linux-gnu/wine/gdi32.dll.so
/usr/lib/x86_64-linux-gnu/wine/gdi32.dll.so
That looks like it's correct to me. Both the 32 and 64 bit versions are install.
This most recent install (1.7.4) I tried building from source, but it does look like gdi32 is there.
Yet even after building from source I get the error and can't even run notepad.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Unable to run Wine; gdi32.dll error

Post by oiaohm »

osarusan building from source you mean the normal.

Code: Select all

configure
make
make install
If so I can see the problem. There is no gdi32.dll.so in /usr/local area. This is where wine default installs when building from source.

Please do a "whereis wine"

Also try /usr/bin/wine --version and /usr/bin/wine notepad I suspect these will work.

Wine is a highly nasty program to build from source for the unaware. Wine will almost always build but missing dependencies causes it not to build particular libraries. Including key libraries like gdi32.dll.so.

Also building wine from source on modern 64 bit system is not simple. http://wiki.winehq.org/WineOn64bit

apt-get build-dep wine is in fact fairly critical.

As I said something basic has to be wrong. It appears to be that you attempted to build wine without the required dependencies installed.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

Well the problem occurs whether I build wine from source or install the packages from the repositories, so I'm pretty sure its not something just as simple as my own error when building... if that were the case it should have worked when I used the default packages, but it doesn't work no matter which package or wine version I install.
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Unable to run Wine; gdi32.dll error

Post by dimesio »

Did you install the Wine you built from source, or did you run it from the build directory? If you installed it, did you uninstall the packaged Wine first? When you went back to the packaged version, did you make uninstall the version you built from source? When going from a package to Wine built from source or vice versa you need to uninstall one before installing the other.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

I installed the one I built from source, and uninstalled it afterwards. The problem existed before I built wine (with the Ubuntu packages wine, 1.4, 1.5, 1.6, and 1.7), and I was hoping that building it from source might eliminate whatever problem was coming from the packages... but it had the exact same effect. Since uninstalling the wine I built I have tried the packages again, but still no change. Every single version of wine I have tried has been unable to start... :-/

Sometimes I get different errors when trying to run something in wine (such as notepad or winecfg). 9 times out of 10 it is gdi32.dll that errors out, but other times it has been user32.dll, and sometimes it tells me that there is not enough memory on X screen 0... but if I try again a moment later, the gdi32 error comes back. I am completely at a loss...
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Unable to run Wine; gdi32.dll error

Post by oiaohm »

osarusan have you tried
/usr/bin/wine notepad
Yet. This is making sure we know exactly what one you are running. I know it does not seam much of a difference.

Also dimesio of running from the build directory is a good suggestion.

osarusan random nature of bugs suggests one of my most annoying system bugs dead ram. Is wine the only program giving you trouble on your system.

As I said basics. Part of basics is checking the hardware. My recommendation would be let memtest86 run over it for at least 1 pass.

Also wine is not light on ram. Under 512 megs of ram you can run into strange issues. Yes wine is not really light hardware compatible. I guess you system is 1G of ram +??
sometimes it tells me that there is not enough memory on X screen 0
This would have been a useful thing to know about sooner. Also the fact it was not constant would have been extremely useful. The fact is random running notepad or winecfg really tells me its more likely a hardware issue than anything else.

Missing or damaged gdi32.dll should basically give the same error every single time no exceptions. gdi32 is one of the largest used in application start up. So the most likely to find a bad bit or ram.

Yes not enough memory is a X11 server answer to client when it has internal crashes. Wine does not generate X screen 0 messages.

As I said your problem is basics. I will at times ask you do strange things. But they are each to rule something out.

Please do me a favour and not censor your problems like this ever again osarusan. I would have got to ram lot quicker if I had know the problem was random. No support person can help you when you don't give them enough information.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Unable to run Wine; gdi32.dll error

Post by oiaohm »

If its not ram osarusan the next that can cause gdi32.dll user32.dll and X11 server to play up is a video card on the way out.

But if it a video card on the way out I would expect more applications effected than just wine.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

It wasn't my intention to censor, but I will do my best to give you as much information as I can. I do appreciate the help you are giving.

/usr/bin/wine notepad returns the following:

Code: Select all

osarusan@GLaDOS:~$ /usr/bin/wine notepad 
wine: created the configuration directory '/home/osarusan/.wine'
fixme:storage:create_storagefile Storage share mode not implemented.
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:storage:create_storagefile Storage share mode not implemented.
fixme:iphlpapi:NotifyAddrChange (Handle 0x158e248, overlapped 0x158e260): 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/osarusan/.wine' has been updated.
err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": /usr/bin/../lib/i386-linux-gnu/wine/winex11.drv.so: failed to map segment from shared object: Cannot allocate memory
err:module:load_builtin_dll failed to load .so lib for builtin L"uxtheme.dll": /usr/bin/../lib/i386-linux-gnu/wine/uxtheme.dll.so: failed to map segment from shared object: Cannot allocate memory
err:module:DelayLoadFailureHook failed to delay load uxtheme.dll.IsThemeActive
wine: Call from 0x7b83a9fe to unimplemented function uxtheme.dll.IsThemeActive, aborting
err:module:attach_process_dlls "comctl32.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\notepad.exe" failed, status 80000100
the same error as before. (Currently wine 1.6 from the Ubuntu Wine Team PPA)

I'm not having trouble with any other programs at all... I've got 16 gigs of RAM and my video card is under 1 year old (AMD Radeon HD 7770), so I would be very surprised if either of those were the problem. memtest comes up clean as well.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Unable to run Wine; gdi32.dll error

Post by oiaohm »

osarusan Could you please make sure the file has size.
"ls -l /usr/lib/i386-linux-gnu/wine/gdi32.dll.so"
Also wonder if it a form of confused loader. As root/sudo run ldconfig.real this should address any loader issues. I have has some very strange things when ld.so gets confused.
err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": /usr/bin/../lib/i386-linux-gnu/wine/winex11.drv.so: failed to map segment from shared object: Cannot allocate memory
Seeing this jogged my memory. That the gdi32.dll error we are seeing is wrong. Completely wrong. We should be seeing a load_builtin_dll failure on gdi32.dll. Problem is we are not. At least I am getting somewhere the question is why.

"set |grep WINE" to check for any set environmental vars. By default on a system there should not be any. Incorrectly set WINEDLLOVERRIDES could be causing this. gdi32 is a item of wine you should not override.

osarusan also could you try a clean user on your machine. As I say this is odd ball to say the least. It has to be something basic badly wrong.

osarusan I am human I am not perfect. Sorry for getting annoyed. But with all the information it at times makes me remember things. Anything dll.so should show up as a load_builtin_dll failures by default.

Code: Select all

err:module:load_builtin_dll failed to load .so lib for builtin L"gdi32.dll": libstdc++.so.6: wrong ELF class: ELFCLASS64
This is what it should kinda look like.

osarusan I was being a little forgetful on how it should look. So we are 100 percent in strange. Yes its a nightmare when you are seeing a error message that should never be printed.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

Here are the results from the commands you gave me. It looks like nothing is out of order here:

Code: Select all

osarusan@GLaDOS:~$ ls -l /usr/lib/i386-linux-gnu/wine/gdi32.dll.so
-rw-r--r-- 1 root root 836168 Oct 22 03:14 /usr/lib/i386-linux-gnu/wine/gdi32.dll.so
osarusan@GLaDOS:~$ sudo ldconfig.real
[sudo] password for osarusan: 
osarusan@GLaDOS:~$ set |grep WINE
I tried making a new user and was able to run winecfq and notepad. There was still some error output, but the programs ran:

Code: Select all

wine: created the configuration directory '/home/osarusan-test/.wine'
fixme:storage:create_storagefile Storage share mode not implemented.
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:storage:create_storagefile Storage share mode not implemented.
fixme:iphlpapi:NotifyAddrChange (Handle 0x136e248, overlapped 0x136e260): stub
err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": /usr/bin/../lib/i386-linux-gnu/wine/winex11.drv.so: failed to map segment from shared object: Cannot allocate memory
Application tried to create a window, but no driver could be loaded.
Unknown error (127).
p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: cannot open shared object file: No such file or directory
fixme:storage:create_storagefile Storage share mode not implemented.
fixme:iphlpapi:NotifyAddrChange (Handle 0x2e8e8a0, overlapped 0x2e8e8ac): stub
wine: configuration in '/home/osarusan-test/.wine' has been updated.
p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: cannot open shared object file: No such file or directory
fixme:msg:pack_message msg 14 (WM_ERASEBKGND) not supported yet
I'm not sure if those are just the "normal" errors that show up. but the winex11.drv error has me a little suspicious...
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Unable to run Wine; gdi32.dll error

Post by dimesio »

The winex11.drv error is definitely not normal. The p11-kit message isn't normal, but it's harmless. The mscoree errors are normal on creation of a wineprefix.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

For comparison, here is the error when I just now created a new wineprefix on my primary user:

Code: Select all

wine: created the configuration directory '/home/osarusan/.wine'
fixme:storage:create_storagefile Storage share mode not implemented.
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:storage:create_storagefile Storage share mode not implemented.
fixme:iphlpapi:NotifyAddrChange (Handle 0x158e248, overlapped 0x158e260): 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/osarusan/.wine' has been updated.
err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": /usr/bin/../lib/i386-linux-gnu/wine/winex11.drv.so: failed to map segment from shared object: Cannot allocate memory
err:module:load_builtin_dll failed to load .so lib for builtin L"localspl.dll": /usr/bin/../lib/i386-linux-gnu/wine/localspl.dll.so: failed to map segment from shared object: Cannot allocate memory
err:module:load_builtin_dll failed to load .so lib for builtin L"imaadp32.acm": /usr/bin/../lib/i386-linux-gnu/wine/imaadp32.acm.so: failed to map segment from shared object: Cannot allocate memory
err:module:load_builtin_dll failed to load .so lib for builtin L"msadp32.acm": /usr/bin/../lib/i386-linux-gnu/wine/msadp32.acm.so: failed to map segment from shared object: Cannot allocate memory
err:module:load_builtin_dll failed to load .so lib for builtin L"msg711.acm": /usr/bin/../lib/i386-linux-gnu/wine/msg711.acm.so: failed to map segment from shared object: Cannot allocate memory
err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": /usr/bin/../lib/i386-linux-gnu/wine/winemp3.acm.so: failed to map segment from shared object: Cannot allocate memory
err:module:load_builtin_dll failed to load .so lib for builtin L"msgsm32.acm": /usr/bin/../lib/i386-linux-gnu/wine/msgsm32.acm.so: failed to map segment from shared object: Cannot allocate memory
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Unable to run Wine; gdi32.dll error

Post by oiaohm »

osarusan what we have confirmed so far that some of the problem is profile related. There is something wrong in your default user.

Removing ~/.wine the WINEPREFIX should in theory result in exactly the same as creating a new user.

So some of your problem is not wine installation. Now what is damaged in your default user.

osarusan I need you to check a few environmental vars in your default user.

Code: Select all

set |grep LD_
This is checking if the default Linux loader is getting any overrides. Again by default this should show nothing.
echo $PATH
Again this is looking for something out of place. Test user and default user $PATH should match.

osarusan Also please run the test user again if it magically fails create a new user and see what happens. I unfortunately have to suspect some form of system infection. Linux infections are very rare. particularly if it turns out to be spreading user to user. What is more than odd here is if winexll.dll.so was broken notepad starting should be impossible.
osarusan
Level 2
Level 2
Posts: 18
Joined: Sat Mar 19, 2011 10:25 pm

Re: Unable to run Wine; gdi32.dll error

Post by osarusan »

Hmm... this is pretty crazy. A system infection seems unlikely, as this is a fresh install of Ubuntu, but I suppose anything is possible.

At this stage, with pretty much no clue as to what is happening here, I'm more inclined just to reformat and reinstall. If that works, it would save more time to just re-set up my PC than it would to actually identify and fix whatever is happening here... :?
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Unable to run Wine; gdi32.dll error

Post by dimesio »

The one other thing I can think of is: are you using SELinux? Improperly configured, it will crash Wine.
Locked