All wine programs immediately segfault

Questions about Wine on macOS.
Locked
Relish
Newbie
Newbie
Posts: 4
Joined: Sun Jul 08, 2012 12:39 pm

All wine programs immediately segfault

Post by Relish »

Hello everybody,

I am trying to build WINE of Mac OS Lion (10.7.4) using the command line tools from Xcode 4.3.3. I don't want to use macports because that installs a huge amount of dependencies that I don't want, so I decided to compile from source. I downloaded the stable tar ball and built with this:

./configure --without-fontconfig --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib
make
sudo make install

It builds fine, but whenever I start winecfg, this happens:

Code: Select all

wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 000b), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
err:process:__wine_kernel_init boot event wait timed out
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
err:x11drv:process_attach failed to load libX11.6.dylib: dlopen(libX11.6.dylib, 266): image not found
err:x11drv:process_attach failed to load libX11.6.dylib: dlopen(libX11.6.dylib, 266): image not found
wine: Unhandled page fault on read access to 0xffffffff at address 0x7bc8c2a5 (thread 0009), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
There are two problems: the unhanded page fault and the fact that wine isn't linked to X11 at compile time, so each time I run wine cfg I need to use LD_LIBRARY_PATH=/usr/X11/lib (but the macports build doesn't have to! what do they do?).

When I fix the dlopen stuff:

Code: Select all

wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 0015), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
err:process:__wine_kernel_init boot event wait timed out
wine: Unhandled page fault on read access to 0xffffffff at address 0x7bc8c2a5 (thread 0013), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
The most frustrating part is that the macports build works just fine. What am I doing wrong to make WINE hate me so? Everything I do with this wine binary results in the page fault on read access to 0xffffffff![/quote]
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: All wine programs immediately segfault

Post by doh123 »

Relish wrote:Hello everybody,

I am trying to build WINE of Mac OS Lion (10.7.4) using the command line tools from Xcode 4.3.3. I don't want to use macports because that installs a huge amount of dependencies that I don't want, so I decided to compile from source. I downloaded the stable tar ball and built with this:

./configure --without-fontconfig --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib
make
sudo make install

It builds fine, but whenever I start winecfg, this happens:

Code: Select all

wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 000b), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
err:process:__wine_kernel_init boot event wait timed out
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
err:x11drv:process_attach failed to load libX11.6.dylib: dlopen(libX11.6.dylib, 266): image not found
err:x11drv:process_attach failed to load libX11.6.dylib: dlopen(libX11.6.dylib, 266): image not found
wine: Unhandled page fault on read access to 0xffffffff at address 0x7bc8c2a5 (thread 0009), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
There are two problems: the unhanded page fault and the fact that wine isn't linked to X11 at compile time, so each time I run wine cfg I need to use LD_LIBRARY_PATH=/usr/X11/lib (but the macports build doesn't have to! what do they do?).

When I fix the dlopen stuff:

Code: Select all

wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 0015), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
err:process:__wine_kernel_init boot event wait timed out
wine: Unhandled page fault on read access to 0xffffffff at address 0x7bc8c2a5 (thread 0013), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
The most frustrating part is that the macports build works just fine. What am I doing wrong to make WINE hate me so? Everything I do with this wine binary results in the page fault on read access to 0xffffffff!
[/quote]
First, I'd recommend getting and installing XQuartz, which will go to /opt/X11 and using that over the stuff in /usr. Its updated more frequently and works better all around. Apple makes their own builds off of XQuartz anyways, so its not like its majorly different, but instead of 0 to 1 updates in 2 years you'll get several.

you'll want to set...
DYLD_FALLBACK_LIBRARY_PATH=/opt/X11/lib
don't mess with LD_LIBRARY_PATH

Macports does this for you... it moves the real wine executable to another folder, and then /opt/local/bin/wine is really just a shell script that sets DYLD_FALLBACK_LIBRARY_PATH and launches the real wine program. You can edit the wine script they make to see what it does.
Relish
Newbie
Newbie
Posts: 4
Joined: Sun Jul 08, 2012 12:39 pm

More problems

Post by Relish »

Building against xquartz doesn't work either:

Code: Select all

$ winecfg
wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 0031), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
err:process:__wine_kernel_init boot event wait timed out
Wine cannot find the ncurses library (libncurses.5.4.dylib).
wine: Unhandled page fault on read access to 0xffffffff at address 0x7bc8c2a5 (thread 002f), starting debugger...
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc8c2a5
The line about ncurses is really strange because:
$ ls -l /usr/lib/libncurses.5.4.dylib
-rwxr-xr-x 1 root wheel 559024 Jul 7 15:33 /usr/lib/libncurses.5.4.dylib
I am really stumped on this one. It can find all the libs at runtime no problem and winecfg is as supported as apps get for wine... Why oh why does this page fault happen?
Relish
Newbie
Newbie
Posts: 4
Joined: Sun Jul 08, 2012 12:39 pm

Post by Relish »

I have found another strange thing:

Code: Select all

$ winedbg
wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 000b), starting debugger...
err:seh:start_debugger Couldn't start debugger ("winedbg --auto 10 4") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
Wine-dbg>
Exception c0000005
fatal flex scanner internal error--end of buffer missed
and

Code: Select all

$ winedbg /usr/local/bin/wine winecfg
wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 000b), starting debugger...
err:seh:start_debugger Couldn't start debugger ("winedbg --auto 10 4") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
Debuggee has been started (/usr/local/bin/wine winecfg )
But WineDbg isn't attached to it. Maybe you're trying to debug a winelib wrapper ??
Try to attach to one of those processes:
 pid      threads  parent   executable (all id:s are in hex)
 0000000c 1        00000000 'ntdll.dll'
 0000000e 1        0000000c ''
Wine-dbg>
Exception c0000005
fatal flex scanner internal error--end of buffer missed
AJs-MacBook-Pro:wine-1.4.1 aj$ wine: Unhandled page fault on read access to 0xffffffff at address 0x90d4b820 (thread 000f), starting debugger...
err:seh:start_debugger Couldn't start debugger ("winedbg --auto 14 4") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
wine: Unhandled page fault on read access to 0xffffffff at address 0x42e84ddd (thread 000d), starting debugger...
err:seh:start_debugger Couldn't start debugger ("winedbg --auto 12 64") (2)
Read the Wine Developers Guide on how to set up winedbg or another debugger
Perhaps this is a problem with my compiler or something? winedbg can't even start (it exits with `Exception c0000005` at startup)
Relish
Newbie
Newbie
Posts: 4
Joined: Sun Jul 08, 2012 12:39 pm

Finally solved the problem (sort of)

Post by Relish »

I tried compiling with stock gcc4.6 and wine finally worked, which leads me to believe that there is a bug in apple's llvm compiler. I don't know what this bug is, and I really don't know how to find out (but it would be nice to know). Anyway, build with a different compiler and it works!
kenorb
Newbie
Newbie
Posts: 4
Joined: Fri Nov 12, 2010 12:14 pm

Re: All wine programs immediately segfault

Post by kenorb »

Great that you solved it, but could you tell what did you install or change in your sources?
I've already:
CC = gcc -m32
in my Makefile (i686-apple-darwin10-gcc-4.2.1).
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: All wine programs immediately segfault

Post by doh123 »

LLVM and clang both have problems... you can get clang to work modifying Wine's makefiles, but I still use an old gcc 4.2 from Xcode 3.x since Apple dumped any normal gcc compilers. Its nice you got gcc 4.6 to work, I couldn't ever get 4.6 to build Wine at all.

If you didn't install Apple's X11 manually, there is nothing in /usr/X11 for it to find, which seems like its missing things in your errors. Apple's X11 is just an old build of XQuartz, so your much better off getting XQuartz and aiming everything at /opt/X11. Once you go to Mountain Lion there isn't even anything to ever put in /usr/X11 since Apple no longer makes X11, and just tells people to use XQuartz.
Locked