-
Notifications
You must be signed in to change notification settings - Fork 348
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
Crash on ppc64 big endian #625
Comments
I don't have such hardware so I'm afraid you'll have to debug it yourself :-/ |
I think there must be some endianness issues in imgui_draw.cpp
|
Interesting! Could be that Dear ImGui's compressed font data only works with little endian, I'll try to look into that. Does dhewm3 work if you disable Dear ImGui (pass |
instead of whatever else compression was used there. Hopefully fixes big endian problems (dhewm#625)
Great to hear it works better with Dear ImGui. Can you try if ImGui works with this branch: https://github.com/DanielGibson/dhewm3/tree/imgui-base85 |
see also #472 for the T-Pose issue |
Yeah, looks like that branch works. |
I wish I had an idea where to start debugging this :-/ |
If Once you found someone to spawn who shows the broken behavior, quit dhewm3 and run |
It doesn't matter if the number is 6309, 12345 was just a placeholder. The weird thing is, dhewm3 works at least with 32bit Big Endian, like MacOS 10.5 on PowerPC, and according to #472 (comment) also on 32bit Big Endian PPC with Linux |
instead of whatever else compression was used there. Hopefully fixes big endian problems (dhewm#625)
can you try a debug build of this branch: https://github.com/DanielGibson/dhewm3/tree/PPC64BE-debug ? if you get an assertion, please reproduce it in gdb and get a backtrace. |
Hi, I've just tried the new branch. Tragically I don't think anything has changed :( |
That's a pity. Just to be sure, is it the same for you, @Link4Electronics ? Another thing to try to hopefully narrow down the problem: How does it look like if you then enter |
The result is exactly the same. He does sit down correctly, and this message is printed: Some animations do actually work, such as the characters blinking. It also looks like RaiseWeapon() is being called constantly, multiple times every frame. |
With the branch PPC64BE-debug, got the same behavior, tried to run with valgrind, but when it was about to load testmaps/test_box it crashed. Interesting though that PPC32 doesn't have this behavior, another side note from me, some people had a similar behavior with the project sm64ex, it will compile on PPC64 but after the loading screen it hangs, PPC32 is fine and than by just doing that single change from OP post, s32 word to s64 word, sm64ex works fine on PPC64. |
It only crashes when running in valgrind? Or does that branch always crash when loading the map?
I was also looking for similar unions in dhewm3, but the ones I found apparently don't cause the issue, so it must be something else |
Oh and yet another thing: One screenshot above shows the console like
Do you also get any warnings when running Update: For testing this, ideally use the latest state of https://github.com/DanielGibson/dhewm3/tree/PPC64BE-debug - I just added a commit with additional debug prints and assertions. |
Thinking about it again, it's most probably not fixed completely yet, though I think I at least know the cause now. Please still check Dear ImGui and do the tests for the "Entity not found" warnings |
Sorry it took me a while to answer, here's the valgrind log with here's a photo how ImGui is rendering on big endian (it's not a problem from dhewm3 project, unless there's something related), Shipwright project does the same (pressing F1 to open Dear ImGui menu, it's all wrong), 3D Space Cadet somehow it renders ok ImGui on big endian. spacecadet (probably using a very old version of ImGui) |
Don't worry, I think I know how to fix the Dear ImGui issue, I just wanted to make sure it actually happens before doing the change. |
dhewm#625 (comment) confirms that it's broken for the fix, see ocornut/imgui#6732 (comment) ocornut/imgui#5190
I just pushed a fix for the ImGui color issue, I hope it works.. If you want to tell other projects how to fix it, they just need to add the following to imconfig.h:
I'll try to fix the remaining problems with the script code now. |
I just pushed another commit that hopefully fixes the T-pose problem as well :) |
Now I only need to clean up all that shit and patch the resurrection of evil code as well.. and eventually the mods :-/ |
instead of whatever else compression was used there. Fixes crash on Big Endian systems (dhewm#625)
dhewm#625 (comment) confirms that it's broken for the fix, see ocornut/imgui#6732 (comment) ocornut/imgui#5190
idInterpreter::Push() is used only for int and (reinterpreted) float values, not pointers (as far as I can tell), so 32bit values on all relevant platforms. It stored its value as intptr_t at `&localstack[ localstackUsed ]` - on 64bit platforms intptr_t is 64bit. Unfortunately, all code reading from the stack just get got a pointer to `&localstack[ localstackUsed ]` in the type they want to read (like `int*` or `float*`) and read that. On Little Endian that happens to work, on 64bit Big Endian it reads the wrong 4 bytes of the intptr_t, so it doesn't work. fixes dhewm#625, dhewm#472
The cleaned up code is in this branch: https://github.com/DanielGibson/dhewm3/tree/fix-ppc64be @Link4Electronics @Doctorj128 could you please test that branch to make sure I got all the important changes, but also please play a bit more in case there are more Big Endian issues that haven't been found yet. |
instead of whatever other compression was used there. Fixes crash on Big Endian systems (dhewm#625)
dhewm#625 (comment) confirms that it's broken for the fix, see ocornut/imgui#6732 (comment) ocornut/imgui#5190
See also #626 |
So does this shit work now or what? @Doctorj128 |
Yes! Sorry, I've been fairly busy recently but I did test the changes and didn't find any further issues. Thanks! |
Great, thanks for testing, I merged this. |
I'm on a Powermac G5 quad 2.5GHz, Radeon HD5770, 16GB RAM with Gentoo Linux on kernel 6.6.52
I got the 'base' folder from my Mac copy of the game, which was installed on my second hard drive.
The game reaches this screen before crashing:
Here's the log:
log.txt
The text was updated successfully, but these errors were encountered: