ClassiCube icon indicating copy to clipboard operation
ClassiCube copied to clipboard

ClassiCube crashes SIGSEGV on Linux PPC64

Open Link4Electronics opened this issue 1 year ago • 14 comments

Hello everyone, so I compiled ClassiCube on Debian sid PowerPC64, but when trying to start a single player game just to test, it gives a SIGSEGV error, the music btw keeps playing on the background with the error window opened. 20241103_202300 Thank you for your support, best regards Link.

Link4Electronics avatar Nov 03 '24 23:11 Link4Electronics

The crash seems to lie within the Radeon GPU driver, so unfortunately this crash cannot be easily resolved

UnknownShadow200 avatar Nov 05 '24 00:11 UnknownShadow200

Interesting, it's a radeon R5 230, terascale 2, on big endian only OpenGL 3.2 is exposed, not 4.5 like would be on a little endian system as this card should support. Maybe worth a shot if I mention on gitlab of Mesa driver then, but probably gonna have very low priority since not everyone there has access to a powerpc system. Best regards, Link.

Link4Electronics avatar Nov 05 '24 00:11 Link4Electronics

If its a Big Endian system try compiling https://github.com/andreiixe/ClassiCube-PPC for Linux

WindClan avatar Nov 06 '24 06:11 WindClan

Compiled this one too, unfortunately same problem.

Best regards, Link.

Link4Electronics avatar Nov 06 '24 12:11 Link4Electronics

I had the same problem a couple of weeks ago. It does run if you compile using OpenGL 1, but has crazy graphical issues image

Doctorj128 avatar Nov 07 '24 20:11 Doctorj128

Have any of you tried a different GPU driver like llvmpipe (it should be as easy as LIBGL_ALWAYS_SOFTWARE=true with all of the Mesa drivers installed)?

TheComputerGuy96 avatar Nov 08 '24 07:11 TheComputerGuy96

Thanks for the suggestions, I tried them: Software rendering 20241108_145053 ClassiCube-PPC 20241108_145921 OpenGL 1.1 this one works but just like @Doctorj128 has reported: 20241108_151118 client.log Best regards, Link.

Link4Electronics avatar Nov 08 '24 18:11 Link4Electronics

Thanks for the suggestions, I tried them: Software rendering 20241108_145053 ClassiCube-PPC 20241108_145921 OpenGL 1.1 this one works but just like @Doctorj128 has reported: 20241108_151118 client.log Best regards, Link.

Have you tried running in the terminal like this: LIBGL_ALWAYS_SOFTWARE=1 ./ClassiCube? This will run it in software rendering mode so I can better understand what the actual problem is if it's a driver or library issue

andreiixe avatar Dec 02 '24 11:12 andreiixe

Hello, running with LIBGL_ALWAYS_SOFTWARE=1 ./ClassiCube if compiled targeting OpenGL 1.1, gives the same result as the 3rd picture from my last post. Compiled targeting OpenGL 2 and running with LIBGL_ALWAYS_SOFTWARE=1 ./ClassiCube gives the same result as the 1st picture.

Best regards, Link.

Link4Electronics avatar Dec 02 '24 16:12 Link4Electronics

Hello, running with LIBGL_ALWAYS_SOFTWARE=1 ./ClassiCube ragardless if compiled targeting OpenGL 1.1, gives the same result as the 3rd picture from my last post. Compiling targeting OpenGL 2, gives the same result as the 2nd picture.

Best regards, Link.

It's a library issue that causes rendering issues and crash, and it would be a difficult because I don't have your platform to solve the problem and fix it, but most likely if you decide to go back to Mac OS X 10.5 or 10.6 (beta) it might to run ClassiCube-PPC without problems

andreiixe avatar Dec 02 '24 16:12 andreiixe

I can provide an image to run on qemu-system-ppc64 with classicube and classicube-ppc repos already clonned in case you're interested to investigate this. Gonna take a while but I'll post here later an archive.org link. Unfortunately for me can't go back to Mac OS X because don't have an installation disk and the ones provided by macintosh garden don't work and I read on some forums that the powermac G5's DVD drive can be very picky to boot a disk mostly requiring an original media.

Best regards, Link.

Link4Electronics avatar Dec 02 '24 17:12 Link4Electronics

Here's a qemu image: https://archive.org/details/classicubeppc64 in case you'd like to have a look Extract it and run with qemu-system-ppc64 -M mac99,via=pmu -cpu 970fx -m 2G -hda Cube.img -boot c It takes a while to boot specially when initializing ramdisk, and it's very slow on qemu (need some patience) but at least it works.

user: andrei pass: dsa123 user: root pass: dsa123 user andrei belongs to the sudoers list

There's kate, gimp, fastfetch, libsdl2-dev, libsdl3-dev, ClassiCube dependencies and an IDE KDevelop at your disposal if needed. The source of ClassiCube-PPC and ClassiCube are located at ~/home/Downloads image

There's no audio btw, I don't know how to make it work in qemu. If you have any problems with qemu and/or image, I'll be around to try to help.

Best regards, Link.

Link4Electronics avatar Dec 03 '24 04:12 Link4Electronics

Here's a qemu image: https://archive.org/details/classicubeppc64 in case you'd like to have a look Extract it and run with qemu-system-ppc64 -M mac99,via=pmu -cpu 970fx -m 2G -hda Cube.img -boot c It takes a while to boot specially when initializing ramdisk, and it's very slow on qemu (need some patience) but at least it works.

user: andrei pass: dsa123 user: root pass: dsa123 user andrei belongs to the sudoers list

There's kate, gimp, fastfetch, libsdl2-dev, libsdl3-dev, ClassiCube dependencies and an IDE KDevelop at your disposal if needed. The source of ClassiCube-PPC and ClassiCube are located at ~/home/Downloads image

There's no audio btw, I don't know how to make it work in qemu. If you have any problems with qemu and/or image, I'll be around to try to help.

Best regards, Link.

I’ll take care of this situation soon, for now I’m waiting for my new PC to arrive so I can fix the issue in a few weeks, meaning next week or the week after. I’ll check it out and bring some fixes. See you soon 🐱

andreiixe avatar Dec 14 '24 00:12 andreiixe

Don't worry, take your time and enjoy your new PC!

And I apologize to everyone for having made the VM image that seems aimed only at @andreiixe (should have made a generic image), I just thought he's more involved into PPC platform.

Best regards, Link.

Link4Electronics avatar Dec 17 '24 14:12 Link4Electronics

Hello, Had some time again with big endian devices, manage to install an IDE so I could try to debug it, I wonder where I could put a breakpoint to check this? On Graphics_GL2.c file, changed all GL_UNSIGNED_BYTE to GL_UNSIGNED_INT_8_8_8_8_REV but stills segfault. Noticed that on my first post I forgot to include the log file:

client.log

Best regards, Link.

Link4Electronics avatar Oct 14 '25 04:10 Link4Electronics

Changes you will want to do for debugging:

  1. In src/Platform_Posix.c, comment out the code inside Crashhandler_Install function.

  2. In src/main_impl.h change

#ifdef _MSC_VER
	/* NOTE: Make sure to comment this out before pushing a commit */
	//cc_string rawArgs = String_FromConst("UnknownShadow200 fffff 127.0.0.1 25565");
	//cc_string rawArgs = String_FromConst("UnknownShadow200"); 
	//argsCount = String_UNSAFE_Split(&rawArgs, ' ', args, 4);
#endif

to

cc_string rawArgs = String_FromConst("testguy"); 
argsCount = String_UNSAFE_Split(&rawArgs, ' ', args, 4);

UnknownShadow200 avatar Oct 14 '25 07:10 UnknownShadow200

@Link4Electronics I investigated this (thanks to providing the powerpc QEMU image), and turns out the problem isn't caused by the GPU driver, but because of some pointer recasting that only worked properly on little endian systems.

I've fixed that now, and it works properly in powerpc QEMU. When you get a chance, can you please see if the crashes and broken textures have been fixed for you with latest commit now?

UnknownShadow200 avatar Oct 17 '25 08:10 UnknownShadow200

Talk about timing! I was about to report at mesa gitlab since I was suspecting it was a gpu driver. Just compiled and tested it, it works now! OpenGL 1.1 and OpenGL 2. Image Congrats!

Best regards, Link.

Link4Electronics avatar Oct 17 '25 09:10 Link4Electronics