bobbydilley / lindbergh-loader

A SEGA Lindbergh Emulator for Linux.
44 stars 6 forks source link

"Fatal Error : This program was not built to run on the processor in your system." #6

Open SeongGino opened 1 year ago

SeongGino commented 1 year ago

Hello! I've built this project on my Arch Linux system (running on an AMD R5 5600X and an RTX 3060 ti) just fine, but when I put the build files in the same directory as the games' executable elfs, I get the following output:

$ LD_PRELOAD=lindbergh.so LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./hod4M.elf
SEGA Lindbergh Loader
Robert Dilley 2022
Not for public consumption

Loader init success

Fatal Error : This program was not built to run on the processor in your system.%

(As one can guess, this is with House of the Dead 4.) So far I've gotten the same response from HOTD4 and 2spicy, though this doesn't seem to be the same with all Lindbergh titles? At least with Ghost Squad Evolution, I've gotten a different result:

$ LD_PRELOAD=lindbergh.so LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./vsg
SEGA Lindbergh Loader
Robert Dilley 2022
Not for public consumption

Warning: Unsure what game this is, using default configuration valuesWarning: Cannot open lindbergh.conf, using default values
Loader init success
./vsg
Connecting to 116.109.112.47
glutGameModeString: 640x480:32@60
Warning: Game is overriding resolution settings to 640X480
XCreateWindow Resolution 0 0 640 480
Connecting to 97.114.47.114
Connecting to 97.114.47.114
Connecting to 117.110.47.100
Warning: Skipping SEGFAULT 89
Warning: Skipping SEGFAULT 89
Warning: Skipping SEGFAULT E4
[1]    26054 segmentation fault (core dumped)  LD_PRELOAD=lindbergh.so LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./vsg

It does actually create a window for all of a second, but then subsequently crashes. I believe gsevo requested a lib32 ncurses5 library that I had to built from the AUR.

Not quite sure if this is intentional, given how different this hardware is to Lindbergh proper, but thought I'd bring this up after spending a good while trying to diagnose this.

If it matters, Linux 6.4.7, glibc 2.38, NVIDIA Prop. 535.98, Plasma 5.27.7.

bobbydilley commented 1 year ago

Hello and thanks for the issue.

Fatal Error : This program was not built to run on the processor in your system.%

https://rc.byu.edu/wiki/index.php?page=I+keep+getting+Illegal+Instruction+errors.+What+do+I+do%3F

It looks as though the game has been compiled with some Intel specific extensions which is why it won't start on an AMD processor. Unforunately I don't think this is something that can easily be fixed. My only reccomendation here (which I know is not a useful one) is to try on an Intel processor, or patch this check out of the game binary and see if it really does require the intel processor or not.

I will update the readme to show that the majority of games do not work with AMD processors.

bobbydilley commented 1 year ago

In terms of ghost squad, I've never actually managed to get this game to run. Someone else has shown screenshots of being able to run it on Ubuntu 18 with this loader, but I've never managed to do it myself so can't offer much support here - I get the same error you show.

Please let me know if you do manage to get it started! I find ltrace and strace useful to see what's going on before the binary crashes.

dkeruza-neo commented 10 months ago

I don't think the games require an Intel processor as the same game in the same computer boots in windows with Teknoparrot.. There might be a check for something else the it is patched by the Teknoparrot loader..

SeongGino commented 10 months ago

FWIW, good luck getting TP devs to make a peep about their "trade secrets," given my run-ins with them and Linux support (even if just through Wine, which does work to an extent) haven't ended well.

Unfortunately I haven't been able to get around making any backtraces yet, since that's outside of my wheelhouse of knowledge.

bobbydilley commented 8 months ago

This is now fixed on the develop branch for a few of the games, and will be released to main when ready.

bobbydilley commented 8 months ago

Fix now released (for a few games) to main. Will close this once all are done.

SeongGino commented 8 months ago

For what it's worth, the effects are certainly different now:

House of the Dead 4 can now try to run, but crashes with a different error:

❯ ./lindbergh
$ ./hod4M.elf
ERROR: ld.so: object 'lindbergh.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
SEGA Lindbergh Loader
Robert Dilley 2023
Not for public consumption

Now starting "The House of the Dead 4", this game is working.
Warning: Skipping SEGFAULT 3A
Connecting to 116.109.112.47
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Connecting to 97.114.47.114
[xcb] Unknown sequence number while awaiting reply
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
hod4M.elf: xcb_io.c:374: poll_for_response: Assertion `!xcb_xlib_threads_sequence_lost' failed.

2spicy seems to stall on loading, no window generated or anything, but the apacheM process is still resident in memory.

❯ ./lindbergh
$ ./apacheM.elf
ERROR: ld.so: object 'lindbergh.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
SEGA Lindbergh Loader
Robert Dilley 2023
Not for public consumption

Now starting "2 Step : 2 Spicy", this game is working.
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Connecting to 116.109.112.47
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Warning: Skipping SEGFAULT F
Connecting to 97.114.47.114              // it's stuck on here

After Burner Climax does load, but only to the point that generates a window, polls the sound device[?], as other desktop audio stutters a bit, the generated window turns black for a brief moment, then crashes. Interestingly, behavior is different whether I have net-tools package installed or not (the Arch Linux package that provides ifconfig). Here it is without:

❯ ./lindbergh
$ ./abc
ERROR: ld.so: object 'lindbergh.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
SEGA Lindbergh Loader
Robert Dilley 2023
Not for public consumption

Now starting "After Burner Climax", this game is working.
Connecting to 116.109.112.47
The resolution is 1360x768 
Connecting to 97.114.47.114
Connecting to 97.114.47.114
Connecting to 117.110.47.100
Warning: SERIAL0 Opened 24
Connecting to 117.110.47.117
Connecting to 117.110.47.117
ERROR: ld.so: object 'lindbergh.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
sh: line 1: ifconfig: command not found
Connecting to 192.168.38.220
Warning: Skipping SEGFAULT 3
Warning: Skipping SEGFAULT 10
Warning: Skipping SEGFAULT 8B

and then with:

❯ ./lindbergh
$ ./abc
ERROR: ld.so: object 'lindbergh.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
SEGA Lindbergh Loader
Robert Dilley 2023
Not for public consumption

Now starting "After Burner Climax", this game is working.
Connecting to 116.109.112.47
The resolution is 1360x768 
Connecting to 97.114.47.114
Connecting to 97.114.47.114
Connecting to 117.110.47.100
Warning: SERIAL0 Opened 24
Connecting to 117.110.47.117
Connecting to 117.110.47.117
ERROR: ld.so: object 'lindbergh.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object 'lindbergh.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
SIOCSIFADDR: Operation not permitted
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: Operation not permitted
SIOCSIFBRDADDR: Operation not permitted
eth0: ERROR while getting interface flags: No such device
Connecting to 192.168.38.220
Warning: Skipping SEGFAULT 3
Warning: Skipping SEGFAULT 10
Warning: Skipping SEGFAULT 8B

The lindbergh loader doesn't even seem to detect Ghost Squad Evolution's executable (the dump I have is disk1/vsg_l/vsg), and loading it manually is about the same as the OP:

❯ LD_PRELOAD=lindbergh.so LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./vsg
SEGA Lindbergh Loader
Robert Dilley 2023
Not for public consumption

Warning: Unsure what game with CRC 0xE60D8E04 is. Please submit this new game to the GitHub repository: https://github.com/bobbydilley/lindbergh-loader/issues/new?title=Please+add+new+game+0xE60D8E04&body=I+tried+to+launch+the+following+game:
Now starting "Unknown Game", this game is working.
./vsg
Connecting to 116.109.112.47
Warning: Game is overriding resolution settings to 640X480
The resolution is 640x480 
Connecting to 97.114.47.114
Connecting to 97.114.47.114
Connecting to 117.110.47.100
Warning: Skipping SEGFAULT 89
Warning: Skipping SEGFAULT 89
Warning: Skipping SEGFAULT E4
[1]    16454 segmentation fault (core dumped)  LD_PRELOAD=lindbergh.so LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./vsg

On the positive side, I was at least able to get Let's Go Jungle (not-special) running! Albeit with the sound popping and audio/graphical weirdness, which would be other issues entirely methinks.

2023_12-29 134721

2023_12-29 135032-Let's Go Jungle! Lost on the Island of Spice!

If there's anything I need to do with gdb to investigate any of these crashes further, please advise. To clarify: this is all running on the same hardware as before, but with NVIDIA (prop) 545.29.06 and Linux 6.5.8 currently.

bobbydilley commented 8 months ago

Thanks, will add vsg in to the lindbergh executable.

Glad you got LGJ to run, and thanks for the really detailed issues. I'm not immidiately sure on any suggestions (we've seen your first error before on arch, and fixed by switching to Ubuntu unforunately), will update here if we make any significant changes that we think might fix.

SeongGino commented 8 months ago

I'm not immidiately sure on any suggestions (we've seen your first error before on arch, and fixed by switching to Ubuntu unforunately), will update here if we make any significant changes that we think might fix.

I see, so it's likely that might be part-and-parcel with something in one of the underlying libraries that are different between 'buntu and Arch. Unfortunately, I would check but I've neither enough spare hard disk space or another medium I can use to boot an Ubuntu or other distro installation at the moment.

That said, perhaps using Distrobox (or a similar containerized solution) could be a workaround in cases like this? Again, would be something I'd have to try when I get the chance; the holidays have been a rush so time has been at a premium unfortunately!

dkeruza-neo commented 8 months ago

@SeongGino I actually got distrobox running and it is a great alternative to make the emulator work in newer Linux distros. I run Arch and it does not work, I also know that it doesn't work in Ubuntu 23.10. I am working on a script to automatically create the container image for distrobox.

SeongGino commented 7 months ago

@SeongGino I actually got distrobox running and it is a great alternative to make the emulator work in newer Linux distros. I run Arch and it does not work, I also know that it doesn't work in Ubuntu 23.10. I am working on a script to automatically create the container image for distrobox.

Well, after spending quite a bit of time getting Distrobox w/ Docker setup, adding my user to docker group, restarting, getting an Ubuntu 22.04 box setup, rooted around for all the dependencies asked in the project readme, build lindbergh loader from the distrobox, put the libraries into the folder and ran, uh...

I got HOTD4 to "run". 2024_01-27 165136-The House of the Dead 4 Rev A ...in massive airquotes. It crashes literally a second into the inengine cutscene, and there's no sound (granted, I think that's because of;)

ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory

hotd4DBlog.txt (includes an in-distrobox neofetch for clarity's sake) I have no idea what I'm doing wrt Distrobox so for all I know this could be normal. :shrug:

bobbydilley commented 7 months ago

To fix the graphics you can use the shader fix files created for the Teknoparrot project.

Unsure about the crash though, I've not seen that before!

dkeruza-neo commented 7 months ago

@SeongGino I actually got distrobox running and it is a great alternative to make the emulator work in newer Linux distros. I run Arch and it does not work, I also know that it doesn't work in Ubuntu 23.10. I am working on a script to automatically create the container image for distrobox.

Well, after spending quite a bit of time getting Distrobox w/ Docker setup, adding my user to docker group, restarting, getting an Ubuntu 22.04 box setup, rooted around for all the dependencies asked in the project readme, build lindbergh loader from the distrobox, put the libraries into the folder and ran, uh...

I got HOTD4 to "run". 2024_01-27 165136-The House of the Dead 4 Rev A ...in massive airquotes. It crashes literally a second into the inengine cutscene, and there's no sound (granted, I think that's because of;)

ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory

hotd4DBlog.txt (includes an in-distrobox neofetch for clarity's sake) I have no idea what I'm doing wrt Distrobox so for all I know this could be normal. 🤷

You are missing a sound library. That happened to me. I am sure you get the same issue with ABC. I will look into it to identify the missing library, from the top of my mind, I think it was pulseaudio-alsa but I could be wrong.

SeongGino commented 7 months ago

You are missing a sound library. That happened to me. I am sure you get the same issue with ABC. I will look into it to identify the missing library, from the top of my mind, I think it was pulseaudio-alsa but I could be wrong.

Not doubting this, though would that (using the Pulseaudio-alsa) apply even if my host machine is using Pipewire?

To fix the graphics you can use the shader fix files created for the Teknoparrot project.

Ack! I'll see if the shader fix changes that. It's been so long since I've touched the original Lindbergh HOTD4 that I forgot/didn't even realize it needed a fix.

EDIT: Seems the aforementioned crash is related to sound, as installing pulseaudio:i386 fixed it and gets into gameplay. Still didn't check the shaders fix (since I can't seem to find it). 2024_01-30 133326-The House of the Dead 4 Rev A

dkeruza-neo commented 7 months ago

I believe you use pipewire in your actual distro, but that changes inside the distrobox container. I will look when I get to my laptop.

dkeruza-neo commented 7 months ago

try this in your arch host: sudo pacman -S lib32-alsa-lib

SeongGino commented 7 months ago

try this in your arch host: sudo pacman -S lib32-alsa-lib

See my earlier comment above yours; I guess I didn't elaborate that installing that package in the container is what allowed sound to work.

I did also find a version of HOTD4 with the shader patch implemented (the patch itself doesn't seem to be available, but pre-patched redistributions are) and that has fixed the models too for this game.

dkeruza-neo commented 7 months ago

try this in your arch host: sudo pacman -S lib32-alsa-lib

See my earlier comment above yours; I guess I didn't elaborate that installing that package in the container is what allowed sound to work.

I did also find a version of HOTD4 with the shader patch implemented (the patch itself doesn't seem to be available, but pre-patched redistributions are) and that has fixed the models too for this game.

Oh, I didn't realize you got the sound fixed. As for the shaders, you can find the patch, but seems like you are good now.