-
-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dwarf Fortress 0.50.x Linux Compatibility #939
Comments
I don't have that game on my steam collection, so cannot test / fix myself. Can you try to run the game:
Hopefully this will gives me more info on what is going on. |
With dynarec off:
With dynarec enabled & the other flags set:
|
Still unsure what's wrong there. I have changed a few things on symbol loading that might have helped a bit, can you retry with latest version of box64? |
with the latest version of box64 built from src: w. default settings:
w.
w.
w.
|
Hey, can you try to build latest box64 from sources, but uncommenting line 33 of //#define USE_MMAP to #define USE_MMAP And see if it improve the situation? |
Bah, don't bother with the change, I have just made it default now. So you just need to update to latest box64 and try again (no source code changes needed). |
It works for me, no SIGSEV, I do have another problem though, it doesn't crash but stops later at:
Full output here[seeschloss@citropsis:df] box64 dwarfort Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:16384 Running on Icestorm-M1-Pro Firestorm-M1-Pro with 8 Cores Params database has 25 entries Box64 with Dynarec v0.2.5 81e8ce49 built on Sep 9 2023 14:15:45 Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/ Using default BOX64_PATH: ./:bin/ Counted 61 Env var BOX64 try to Preload /usr/lib/libinput-config.so /usr/lib/libinput-config.so /usr/lib/libinput-config.so Looking for dwarfort Rename process to "dwarfort" Warning, cannot pre-load of /usr/lib/libinput-config.so Warning, cannot pre-load of /usr/lib/libinput-config.so Warning, cannot pre-load of /usr/lib/libinput-config.so Using emulated libg_src_lib.so Using native(wrapped) libSDL2-2.0.so.0 Using native(wrapped) libdl.so.2 Using native(wrapped) libm.so.6 Using native(wrapped) librt.so.1 Using native(wrapped) libpthread.so.0 Using native(wrapped) libSDL2_image-2.0.so.0 Using emulated libsteam_api.so Using emulated /lib/x86_64-linux-gnu/libstdc++.so.6 Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux-x86-64.so.2 Using native(wrapped) libutil.so.1 Using native(wrapped) libresolv.so.2 Using emulated ./libfmod_plugin.so Using emulated libfmod.so.13 Loading audio...Audio loaded successfully!Loading bindings from prefs/interface.txt Loading bindings from data/init/interface.txt Broken unicode: [KEY:{] Broken unicode: [KEY:|] Broken unicode: [KEY:}] Broken unicode: [KEY:~] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY:] Broken unicode: [KEY: ] Broken unicode: [KEY:¡] Broken unicode: [KEY:¢] Broken unicode: [KEY:£] Broken unicode: [KEY:¤] Broken unicode: [KEY:¥] Broken unicode: [KEY:¦] Broken unicode: [KEY:§] Broken unicode: [KEY:¨] Broken unicode: [KEY:©] Broken unicode: [KEY:ª] Broken unicode: [KEY:«] Broken unicode: [KEY:¬] Broken unicode: [KEY:] Broken unicode: [KEY:®] Broken unicode: [KEY:¯] Broken unicode: [KEY:°] Broken unicode: [KEY:±] Broken unicode: [KEY:²] Broken unicode: [KEY:³] Broken unicode: [KEY:´] Broken unicode: [KEY:µ] Broken unicode: [KEY:¶] Broken unicode: [KEY:·] Broken unicode: [KEY:¸] Broken unicode: [KEY:¹] Broken unicode: [KEY:º] Broken unicode: [KEY:»] Broken unicode: [KEY:¼] Broken unicode: [KEY:½] Broken unicode: [KEY:¾] Broken unicode: [KEY:¿] Broken unicode: [KEY:À] Broken unicode: [KEY:Á] Broken unicode: [KEY:Â] Broken unicode: [KEY:Ã] Broken unicode: [KEY:Ä] Broken unicode: [KEY:Å] Broken unicode: [KEY:Æ] Broken unicode: [KEY:Ç] Broken unicode: [KEY:È] Broken unicode: [KEY:É] Broken unicode: [KEY:Ê] Broken unicode: [KEY:Ë] Broken unicode: [KEY:Ì] Broken unicode: [KEY:Í] Broken unicode: [KEY:Î] Broken unicode: [KEY:Ï] Broken unicode: [KEY:Ð] Broken unicode: [KEY:Ñ] Broken unicode: [KEY:Ò] Broken unicode: [KEY:Ó] Broken unicode: [KEY:Ô] Broken unicode: [KEY:Õ] Broken unicode: [KEY:Ö] Broken unicode: [KEY:×] Broken unicode: [KEY:Ø] Broken unicode: [KEY:Ù] Broken unicode: [KEY:Ú] Broken unicode: [KEY:Û] Broken unicode: [KEY:Ü] Broken unicode: [KEY:Ý] Broken unicode: [KEY:Þ] Broken unicode: [KEY:ß] Broken unicode: [KEY:à] Broken unicode: [KEY:á] Broken unicode: [KEY:â] Broken unicode: [KEY:ã] Broken unicode: [KEY:ä] Broken unicode: [KEY:å] Broken unicode: [KEY:æ] Broken unicode: [KEY:ç] Broken unicode: [KEY:è] Broken unicode: [KEY:é] Broken unicode: [KEY:ê] Broken unicode: [KEY:ë] Broken unicode: [KEY:ì] Broken unicode: [KEY:í] Broken unicode: [KEY:î] Broken unicode: [KEY:ï] Broken unicode: [KEY:ð] Broken unicode: [KEY:ñ] Broken unicode: [KEY:ò] Broken unicode: [KEY:ó] Broken unicode: [KEY:ô] Broken unicode: [KEY:õ] Broken unicode: [KEY:ö] Broken unicode: [KEY:÷] Broken unicode: [KEY:ø] Broken unicode: [KEY:ù] Broken unicode: [KEY:ú] Broken unicode: [KEY:û] Broken unicode: [KEY:ü] Broken unicode: [KEY:ý] Broken unicode: [KEY:þ] Broken unicode: [KEY:ÿ] [S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam. Using emulated /home/seeschloss/.local/share/Steam/linux64/steamclient.so Warning: Weak Symbol _ITM_RU1 not found, cannot apply R_X86_64_JUMP_SLOT @0x108ba3fb8 (0x32a296) Warning: Weak Symbol _ZGTtnam not found, cannot apply R_X86_64_JUMP_SLOT @0x108ba3fc0 (0x32a2a6) Warning: Weak Symbol _ITM_memcpyRtWn not found, cannot apply R_X86_64_JUMP_SLOT @0x108ba3fc8 (0x32a2b6) Warning: Weak Symbol _ITM_RU8 not found, cannot apply R_X86_64_JUMP_SLOT @0x108ba3fd0 (0x32a2c6) [S_API] SteamAPI_Init(): Loaded '/home/seeschloss/.local/share/Steam/linux64/steamclient.so' OK. [S_API FAIL] SteamAPI_Init() failed; create pipe failed.New window size: 1512x945 Font size: 8x12 Resizing grid to 189x78 Resizing font to 8x12 The "Broken unicode" lines are output by Dwarf Fortress. I do have /usr/lib/libSDL2-2.0.so.0 which seems to provide |
having updated my install of box64 as well, I'm getting what is presumably the same crash, considering the log vomiting out a bunch of
notably, however, it doesn't actually list the cause of the crash; going to update to the recent beta build with its own crash handler code and see what that gives me edit: behaves the exact same way as before. |
I think the "Broken unicode" lines are... more or less normal. I think I remember already seeing them in the past, and they also happen when I run DF on an amd64 machine. What's more surprising is that it stops there for you, though. I have the exact same output with 0.50.9 and 0.50.10, by the way. |
Fyi @ptitSeb: 0.50.10's full release for both the freeware and premium versions of DF is out now (https://www.bay12games.com/dwarves/ for the former, steam/itchio for the latter ofc), so you dont need to own the steam version to play 0.50 on linux anymore! That should hopefully help with you debugging why it crashes? |
Ah yes good. I'll check that next week. |
Well after adding these two functions (I just took inspiration from similar bug reports like #616), it works for me. Performance is about the same as on my x86_64 machine but it's difficult to compare. Especially since I'm not home and I don't have an ARM64 machine with me here, so I've only tested it remotely through Xvnc for now. |
Can confirm that DF itself now works entirely as expected; DFHack (a very commonly used modding utility) does not—but that looks to be tied to using ARM64 versions of SDL2 via wrapper instead of any issues with box64 or DFHack directly, as it's all issues with the overlay GUIs. What are the commands required to set SDL2 and SDL2-image to run as emulated instead of native-via-wrapper again? (For posterity, releases of DFHack can be found here: https://github.com/dfhack/dfhack/releases) |
You can use |
Hm. Regardless of what's done with the library emulation, there's still some issues with DFHack; honestly since it depends so heavily on direct memory manipulation it wouldn't be too shocking if it's just not going to work under box64, since bugs like this haven't been reported elsewhere. The console produces the following logs when running
This goes on, but after this point it's entirely dfhack in-game console logs. Interestingly, the game cannot be properly quit when dfhack is installed by just closing the game window or quitting from the main menu, the terminal window (which dfhack is technically running in) must be closed instead. This does not happen without dfhack installed. It'd be entirely fair for you to not try and fix dfhack's missing graphical features and other oddities, considering such a fix likely being significantly more complicated than getting .50.x df to run properly, but I thought I'd post these here for posterity's sake anyways. (Also, I'm going to change the name of this issue thread after I make this post to something along the lines of 'Dwarf Fortress 0.50.x compatibility' or something since it no longer SIGSEVs. Feel free to close it if this is as far as you want to work on the problem, and thanks for your hard work on box64!) |
Feel free to report that in the DFHack issue tracker. We would probably be interested in fixing at least the shutdown issue. I'm not sure what other issues you're referring to (the |
Using dfhack, I've just had a crash on: Might be easy to implement, but probably not as easy as the sdl functions I added before, as it already exists in @ptitSeb I suppose this |
The |
Fumbled a bit with my commit, but anyway I found what was breaking dfhack's console. |
Thanks @ptitSeb, now that I have enabled more logging I see the following message:
I supposed implementing the opcode would be better for performance, but this is way over my head. |
Yeah, but that's an unsuported opcode for now, even on the interpreter. It's some "dead code" for now (branch of code never executed because the cpu flag doesn't have a certain bit enabled). |
I see, in any case it runs well enough now. In the DFHack issue (DFHack/dfhack#3831) @lethosor mentions that a |
memory protection is tricky on box64. It's tracked and used as part of the dynarec. |
So it was just a check on dfhack's part that seems to be somewhat wrong, it checks that memory is allocated contiguously for no obvious reason, and it's not the case when run through box64. Just disabling the check works, so I think the rest is on dfhack's side and the box64 side is finished now. It works fine for me now, I don't know if @cocona20xx's problems have been fixed as well. |
Can you point me to the piece of code that is doing this check? I would like box64 to behave as much as possible as native. |
Here's the code I removed to make it run: seeschloss/dfhack@5102b21 You can see the last few comments on the issue there, starting from DFHack/dfhack#3831 (comment), for more context. |
From looking at this on the DFHack side, I think part of the cause of that particular issue is that there are a lot of duplicated memory ranges. Here's a snippet of the output from one of our internal tools, which should match
I think this should be pretty easy to work around on our end, but I am curious what's going on here. For reference: the check on our end is to ensure that, if we patch memory that crosses range boundaries, those ranges are contiguous. i.e. we want to preemptively avoid a segfault from attempting to write 0x2000 bytes starting at |
trying to run from debian on a 64 bit arm device. root@localhost:~/DF/df_50_13_linux# box64 dwarfort |
…on-4K pagesize) (should help ptitSeb#1398 ptitSeb#1271 maybe help ptitSeb#939 and probably others)
OS: Asahi Fedora Remix (pre-release)
Hardware: Apple Silicon M1 Mac Mini (8 cores, 16gb ram)
Log output upon crash:
With this being a beta for the 0.50 release (the version present in the premium versions of DF on steam), it'd be nice to have some attention on this before the actual Linux release.
The text was updated successfully, but these errors were encountered: