Author Topic: GH 0.623 not running: Linux  (Read 375 times)

Offline CCC

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
GH 0.623 not running: Linux
« on: March 07, 2010, 09:56:54 PM »
Hi!

I decided to download the latest version and see how it's changed. I compiled is (ppc386 -dCUTE gearhead), ran it, and got greeted with the following:

An unhandled exception occurred at $B733079D :
EDivByZero : Division by zero
  $B733079D

It happens in window or fullscreen mode. The only way I've found to stop it is to turn on NO_SPLASH_SCREEN_AT_START, but then I get another problem; I get a nice background screen for a menu but no menu is visible, and the only thing I can seem to do from that screen is kill the process. Taking -dCUTE out means that I get the division-by-zero error even with the splash screen turned off.

The last version I downloaded works fine (windowed, anyway); that's version 5.35, if that's any help. So I don't know what's gone wrong since then...

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2410
    • View Profile
    • http://www.gearheadrpg.com
Re: GH 0.623 not running: Linux
« Reply #1 on: March 07, 2010, 10:15:13 PM »
This is weird, because I use Linux now and it works fine for me. A few initial thoughts:
- Make sure you're doing a clean install. If you just unzipped the new source code on top of a previous version, there may be some leftover files laying around which cause trouble,
- Make sure you've downloaded the latest image pack as well as the source code.
- If you have a fairly recent version of the FreePascal compiler, Jedi SDL isn't needed anymore because SDL headers are part of the standard library. Try compiling with the FPC SDL units and see if it helps.

If none of the above applies to you, try compiling with debug info on to get better info. Type "delp ." to remove temp files first, then "fpc -dCUTE -gl gearhead". When you run the program now it should tell you exactly which line in which unit is causing the problem.

Let me know if any of this helps, and also let me know if it doesn't.

Offline plllizzz

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: GH 0.623 not running: Linux
« Reply #2 on: March 08, 2010, 06:48:32 AM »
"EDivByZero : Division by zero"

Oh My God... *disappears in a space-time vortex*

Offline CCC

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Re: GH 0.623 not running: Linux
« Reply #3 on: March 08, 2010, 09:35:28 AM »
OK; I have good news, and I have better news.

The good news is I've now got it working. (Well, as far as the splash and title screen, anyhow; I immediately quit - properly this time, using the menu - to try and recreate the original error and see if I could say something useful about what was causing it).

The better news is, I can recreate the error. What I did to recreate the error is the following:

- Unzip the source package (but not the image package) into an empty directory
- cd GH2
- ppc386 gearhead
- ./gearhead
- note, I have still not unzipped the image package yet. Naturally, I get an error
- cd ..
- unzip gh2-0623-image.zip
- cd GH2
- ppc386 gearhead
- ./gearhead

At this point, I run into the original error. However, if I wipe the directory and extract both the source and the image packages before compiling, then it works.

I can only presume that the presence of the image package affects some of the files in the build process, and these files are not rebuilt if the image directory is added afterwards. Nonetheless, it now works.

Incidentally, I also notice that there are a few files in both packages, apparently all meshes judging from the file names. I presume both copies are identical.

Also incidentally, adding -gl didn't give me a line number. I think the crash is actually happening somewhere in the SDL libraries; running in GDB throws up the following:

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1214622032 (LWP 6473)]
0xb732379d in ?? () from /usr/lib/libGLcore.so.1

...and tells me that it can't do a backtrace after the crash. (I'm using an older version of the compiler from before it had built-in SDL libraries, so this might not even happen with later compilers).

Offline CCC

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Re: GH 0.623 not running: Linux
« Reply #4 on: March 08, 2010, 01:39:48 PM »
...and no more trouble, right up until my character got blown up for, basically, not taking enough mecha skills and going to a mecha fight too soon.

Need to plan better next time.

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2410
    • View Profile
    • http://www.gearheadrpg.com
Re: GH 0.623 not running: Linux
« Reply #5 on: March 08, 2010, 05:16:16 PM »
Weird. AFAIR there's nothing in the image archive needed for compilation. Well, at least you've got it working now.

Offline peridot

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: GH 0.623 not running: Linux
« Reply #6 on: May 03, 2010, 05:25:21 PM »
I'm not totally sure this is the same bug, but I think so: I'm running linux and it bails with a segmentation fault in either graphical interface (on 0.625, in fact).

In any case, I've found the cause of this particular segfault: if the game can't find its resources (in particular the font), it tries to display an error message, but this error message is attempted to be drawn in the (missing) game font. So some TTF function to measure the size of a text string gets passed a NULL font and you get a segfault.

One temporary fix for this would be to copy all error messages, or at least this one, to standard error (before printing them onscreen). This wouldn't disturb GUI users, but it would make post-mortem debugging easier.

I'd also like to add that this bug is particularly easy to trigger under Linux: you go to the main page, you click on "download GH2 now", and you get a source tarball immediately downloading. No indication anywhere that you also need the images tarball for the game to work... even the readme file doesn't mention this, or say where to put it.