Comments (19)
FWIW this (and likely any access violation at an address ending in xAAC) is a DEP violation error caused by storm.dll trying to run dynamic code from non-executable memory.
Windows can be shifty when it comes to disabling DEP, sometimes it appears to be turned off but requires a reboot to actually be turned off.
To see if an access violation is being caused by DEP the error logging code can be modified like this: https://github.com/squidcc/devil-nightly/commit/976eb9722e11842629e4be133c7a4c04e38a90bc.diff
The first exception info DWORD specifies the nature of the access that caused the violation: 0=read, 1=write, 8=execution (DEP violation).
If there was a way that we could somehow get code executed before storm is loaded (and its DllMain function called to initialize its static classes) we could hotpatch VirtualAlloc to always request memory with executable permission as a workaround.
from devilution.
Did you compile and run devilution through wine in 18.04? When I tried it just looped the intro movie, when I hit a button it would briefly show the menu then go to a black screen and play the intro again. So I can't get to the main menu.
from devilution.
When I am seeing the black screen it is at the menu, but I believe that is just a Wine issue. The menu sounds still work so I am able to start a new game by clicking enter a few times and entering the character name (all while having a black screen). The game seems to run fine once I get into the game.
If I run the same binary on winxp it runs great, If I run it on win7 it crashes even with compatibility settings set. Maybe ChaosMarc is having the same win7 incompatibility issues (probably outside the scope of this project, since it runs fine on older windows setups).
from devilution.
I'm using Windows 7 x64 and it runs just fine. If you use the ddraw wrapper then it stops the color glitch. No compatibility settings needed.
from devilution.
My main OS is Windows 10 (1803, 17134.112) and the Ubuntu I'm building in is the official WSL from the Microsoft Store. I build in Ubuntu and play in Windows, so no wine is involved (not even installed). When using the main Ubuntu "App" from the Store (which is 16.04) everything works fine with the steps I described in the OP. If I upgrade to 18.04 or use the official Ubuntu 18.04 "App" directly building works fine, but running the exe in Windows fails. A black window opens for a few seconds opens and closes without a visible error dialog.
Edit: I tried messing around with the g++-mingw-w64-i686 package and installed the old version and it's dependencies (from the xenial repo) but the effect is the same.
I've uploaded both compiled executables. notice the file size difference
devilution-16.04.exe.zip (1.41mb)
devilution-18.04.exe.zip (1.82mb)
as a last afterthought: I have to use the ddraw wrapper or else I get the known Direct Draw error message with both compiled executables
from devilution.
I am not sure if it helps, but I had similar problems with this in my windows machine because of the resolution was way too high.
from devilution.
On my win7 machine I was able to install the direct X 9 required for ddraw.dll. I can't install the 2010 c++ redistribute package because I have a newer one installed. If I try to run my compiled devilution.exe (which semi works in ubuntu under wine) then it crashes. If I instead run Diablo.exe (got from the disc) instead it runs just fine (its runs windowed because I am using ddraw.ll). Any ideas?
PROGRAM VERSION: 1.0.9.2
COMPUTER NAME: User
TIME: 07/10/18 20:49:25
INFO:
Exception code: C0000005 ACCESS_VIOLATION
Fault address: 003C0AAC 00:00000000 unknown
Registers:
EAX:003C0FAD
EBX:003C0AAC
ECX:00000000
EDX:000001E0
ESI:00000000
EDI:06170020
CS:EIP:0023:003C0AAC
SS:ESP:002B:0028F7B0 EBP:0028F870
DS:002B ES:002B FS:0053 GS:002B
Flags:00210216
Call stack:
Address Frame Logical addr Module
003C0AAC 0028F870 0000:00000000 unknown
Stack bytes:
Code bytes:
0x003c0aac: 89 0f 81 c7 04 00 00 00 89 0f 81 c7 04 00 00 00 ................
from devilution.
I am also seeing this in Ubuntu 18.04, or rather, when I run devilution in Win10. When I ran it in Wine, I got a fullscreen intro and then black screen. Passing -d to devilution just gave me the black screen.
I did notice this:
0009:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
after I closed devilution. I figure that wine is bypassing the ddraw.dll and using something built-in and that is why it is going fullscreen. Wonder if something is breaking there...
from devilution.
I guess I misspoke, it was the Blizzard logo video I saw. Playing some more, I got the intro video (sword in ground). Clicking a few times made it stop and play again. I'm wondering if maybe since the scaling is way off then it is being rendered 'off screen' or something crazy.
EDIT: Using winecfg
and following this, I overrode the ddraw library to use the native then builtin. That resulted in this:
https://imgur.com/fiXQy6P
from devilution.
Phyllostachys,
See my 2nd comment above. I believe the issue is the cross compiling windows in Ubuntu. Maybe other mingw can work.
from devilution.
Indeed. I'll try compiling with msvc and clang when I get a chance to see if the results are any different.
from devilution.
Hmmm, I built with the mingw-w64 i686 tools on Windows and it seemed to have worked fine. The Windows and Linux mingw-w64 tools build to the same target... weird. After some finangling, I got it working with clang on windows though it hits a data file error.
from devilution.
As the op noted everything worked when they used the mingw in ubuntu 16.04 but the mingw version in 18.04 doesn't work. May have to compile old mingw from souce to work for Ubuntu 18.04.
from devilution.
I am also seeing this in Ubuntu 18.04, or rather, when I run devilution in Win10. When I ran it in Wine, I got a fullscreen intro and then black screen. Passing -d to devilution just gave me the black screen.
@Phyllostachys This is a known bug with DDRAW.dll . You should be able to still nagivate the menus. It does this in the original diablo. If I recall correctly it has to do with that DDRAW is trying to write directly on top of a window.
This is how ddraw works anyway, but the menu is I think two windows or something.
https://bugs.winehq.org/show_bug.cgi?id=2082
from devilution.
Is this still an issue for anyone using Ubuntu 18.04? Have you tried both mingw32 and 64?
from devilution.
for me it is. can you tell me what I need to do to compile with mingw32 instead of 64 (which is what I suspect I do as I installed the g++-mingw-w64-i686 package)
from devilution.
I don't think this needs anything complicated.
The MSVC build turns off DEP compatibility (/NXCOMPAT:NO
), perhaps MingW leaves it unspecified/on.
Should be fixable by just adding --no-nxcompat
to the linker flags.
from devilution.
Unfortunately the flag in the executable is not always respected; later versions of windows default to the "AlwaysOn" DEP policy which means it applies to all processes regardless.
from devilution.
After clearing things up via discord, I now know that the fact that the executable build under 16.04 works in windows is not intentional but only a nice side-effect and cross-compiling is not in the scope of devilution but belongs to devilutionX (I think :D)
So I'm gonna close this issue as there are other ways to build a working executable for windows. Thanks for your patience with me ;)
edit:
the problem itself is definitely caused by DEP. If disabled completely in windows I can successfully use the crosscompiled exe under windows. So the default compiler in 16.04 sets the the DEP flag to false, but the 18.04 sets it to true. I tried adding --no-nxcompat
to the LDFLAGS
but it's not a valid flag and I could not find the correct syntax.
from devilution.
Related Issues (20)
- [hellfire] Hive/Crypt - invisible chests and barrels HOT 1
- Are you able to use Hellfire's source code? HOT 1
- [hellfire] OperateL2Door - Please check bin exactness HOT 10
- Building in VS2019: exe attempts to open crypto/rsa key file? HOT 1
- Cleanup code HOT 1
- out of memory error HOT 5
- 60 FPS support? HOT 1
- Migrate macOS builds to GitHub Actions HOT 10
- [Not A Bug] Question about the License and Legal Section in the Readme HOT 5
- MaxGold always depends on auricGold HOT 4
- Gnat String's "Multiple arrows per shot" only fires one arrow HOT 2
- Win98 Support? HOT 1
- Farmer Quest Bug HOT 1
- [Feature request] add option to show items on map HOT 4
- [Android] Option to change stationary toggle to allow moving
- "Legal" section ambiguity HOT 1
- [MSVC][permissive-] devilution failed to build with /permissive- on MSVC HOT 5
- [Need help] Getting a Massive bow of swiftness at clvl 44+ HOT 3
- Is this gap intentional? HOT 1
- mods don't work In the mobile application HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devilution.