Wine error: Application tried to create a window, but no driver could be loaded

Daniel Alder picture Daniel Alder · Feb 15, 2014 · Viewed 7.5k times · Source

I made a fcgi-isapi bridge, which I compile with wineg++ (keyword winelib). It is running a pure Win32 isapi extension using LoadLibrary/GetProcAddress. This works fine for a simple demo isapi dll, but not for a more complex one, where wine crashes somewhere inside the dll. WINEDEBUG=+olerelay,+storage,+relay gives me the following output:

0009:Call KERNEL32.InterlockedIncrement(00000150) ret=1001eebe
0009:Call KERNEL32.UnhandledExceptionFilter(0033f428) ret=7bc8e2f5
wine: Unhandled page fault on write access to 0x00000150 at address 0x7b8716bd (thread 0009), starting debugger...
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
couldn't load main module (0)
0009:Ret  KERNEL32.UnhandledExceptionFilter() retval=00000000 ret=7bc8e2f5
Unhandled exception: page fault on write access to 0x00000150 in 32-bit code (0x7b8716bd).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:7b8716bd ESP:0033f8cc EBP:0033f8e0 EFLAGS:00010246(  R- --  I  Z- -P- )
 EAX:00000001 EBX:00000000 ECX:00000000 EDX:00000150
 ESI:0033f8fc EDI:0033f8d4
Stack dump:
0x0033f8cc:  7bc6592e 00000150 00000000 7ca3c7d4
0x0033f8dc:  00000000 0033fdc8 7b823b61 7b8be9d4
0x0033f8ec:  000102d1 0033f8f4 1001eebe 00000150
0x0033f8fc:  7ef82158 7ca3c7d0 f775d2c8 0033faac
0x0033f90c:  7bcd7208 00000000 f775c2b1 0000000f
0x0033f91c:  7bcbbed8 1004e06c 00000002 00115760
Backtrace:
=>0 0x7b8716bd in kernel32 (+0x616bd) (0x0033f8e0)
  1 0x7b823b61 in kernel32 (+0x13b60) (0x0033fdc8)
  2 0x7ef813d0 (0x0033fe18)
  3 0x7ef815f5 (0x0033fe60)
  4 0x7b85e84c in kernel32 (+0x4e84b) (0x0033fe78)
  5 0x7b85f903 in kernel32 (+0x4f902) (0x0033feb8)
  6 0x7bc77600 (0x0033fed8)
  7 0x7bc7a59d (0x0033ffa8)
  8 0x7bc775de (0x0033ffc8)
  9 0x7bc4c65e (0x0033ffe8)

(tested with Wine 1.4.1 and 1.6.2, both give exactly the same output (only some different numbers)

My questions:

  1. What happens really and how can I figure out the reason for the page fault error?
  2. Does wine try to run a graphical debugger or is the dll itself trying to create a X11 object? And why does it fail? This installation is running in a 32bit chroot environment on a 64bit host, but I called xhost + and tested X11 using xlogo, gedit and even with a Win32 GUI application using Wine. There doesn't seem to be any X11 problem.

Update: here is the link to the source: http://gist.github.com/daald/5f37de8352e1c8ca62db

Answer

Fax picture Fax · Jul 18, 2019

Try

wineconsole --backend=curses fastcgi-to-isapi.exe

As this post describes:

Wine has three options to run apps in command line mode:

  • On the bare linux console (wine)
  • On the linux console with curses (wine wineconsole --backend=curses)
  • In a win32 window (wine wineconsole --backend=user)

For wineconsole, the user backend is the default, that's why your command line tried to open a window.

It does however not print the output of the program. If you need the output, you can first start wineconsole in interactive mode, then run the exe from there:

me@mycomputer:~$ wineconsole
Microsoft Windows 6.1.7601 (3.0)

Z:\home\me> HelloWorld.exe
Hello World!

Obviously not a good solution if you want to do it programmatically though.