HamaIndustries / FEMultiPlayer-V2

Reupload & revamp of FEMP with fresh bugfixes... usually. Check "releases" for download.
http://eliatlarge.github.io/FEMultiPlayer-V2/
GNU General Public License v3.0
27 stars 31 forks source link

Crashes immediately after loading screen finishes #39

Closed ghost closed 8 years ago

ghost commented 8 years ago

Issue type: problem

Description:

In both the v1.2.1, v1.3 x86, and v1.3 x64 "non-x86" versions, the game will crash immediately after the loading screen completes due to a RuntimeException. This occurs whenever the app.config generated by the game has a value greater than 0.0 for the "VOLUME=" setting within the file. Even the stock app.config file created by the game when cleanly installed / extracted, produces this behavior.

It should be noted that the bug only occurred on Windows systems, being personally observed on both Windows 7 Home Premium 64-bit Edition, and Windows 10, while using Oracle's Java 8. When tested on Debian Linux 8 (Jessie) 64-bit, with OpenJDK8 (which includes OpenJRE8) the game ran without crashing at all, regardless of the value assigned to "VOLUME=".

That being said, I'm led to believe that this could be a compatibility issue with Oracle's Java, or Windows itself. I can't find a Windows binary of OpenJDK8 to confirm or deny this theory though. Please advise.

Edited to fix typos.


Examples:

Raw text from error_log_client3464147.log:

java.lang.RuntimeException: java.lang.NullPointerException
    at net.fe.SoundTrack.loadAudioNames(SoundTrack.java:106)
    at net.fe.SoundTrack.loop(SoundTrack.java:46)
    at net.fe.FEMultiplayer.setCurrentStage(FEMultiplayer.java:392)
    at net.fe.FEMultiplayer.init(FEMultiplayer.java:146)
    at net.fe.FEMultiplayer.main(FEMultiplayer.java:96)
Caused by: java.lang.NullPointerException
    at net.fe.SoundTrack.loadAudioNames(SoundTrack.java:95)
    ... 4 more
Windows CMD Output: (Crashes upon transition to title screen where music is suppose to play)
C:\Users\Drew\Desktop\Fire Emblem Multiplayer>java -jar Fire_Emblem_Multiplayer_V2.jar
Wed Apr 20 14:47:55 EDT 2016 INFO:Use Java PNG Loader = true
default_med(bitmap font) loaded
stat_numbers(bitmap font) loaded
msg_text(bitmap font) loaded
1.20 NVIDIA via Cg compiler
20
Wed Apr 20 14:47:56 EDT 2016 INFO:Initialising sounds..
Wed Apr 20 14:47:57 EDT 2016 INFO:- Sound works
Wed Apr 20 14:47:57 EDT 2016 INFO:- 64 OpenAL source available
Wed Apr 20 14:47:57 EDT 2016 INFO:- Sounds source generated
default_med(bitmap font) loaded
stat_numbers(bitmap font) loaded
msg_text(bitmap font) loaded
Loaded res/gui/rescue.png
Loaded res/gui/runes.png
Loaded res/gui/connect_button.png
Loaded res/gui/team_builder_button.png
Loaded res/gui/title.png
Loaded res/gui/title_two.png
Loaded res/gui/title_slide.png
Exception occurred, writing to logs...
java.lang.RuntimeException: java.lang.NullPointerException
        at net.fe.SoundTrack.loadAudioNames(SoundTrack.java:106)
        at net.fe.SoundTrack.loop(SoundTrack.java:46)
        at net.fe.FEMultiplayer.setCurrentStage(FEMultiplayer.java:392)
        at net.fe.FEMultiplayer.init(FEMultiplayer.java:146)
        at net.fe.FEMultiplayer.main(FEMultiplayer.java:96)
Caused by: java.lang.NullPointerException
        at net.fe.SoundTrack.loadAudioNames(SoundTrack.java:95)
        ... 4 more
AL lib: (EE) alc_cleanup: 1 device not closed

C:\Users\Drew\Desktop\Fire Emblem Multiplayer>

These results remained consistent with both the JRE and JDK.

For comparison's sake, when ran successfully through my Linux terminal, I get the following.

Linux Terminal Output: (Successfully reaches title screen)
drew@Mint-Drop:~$ cd .Fire_Emblem_Multiplayer_V2/
drew@Mint-Drop:~/.Fire_Emblem_Multiplayer_V2$ java -jar Fire_Emblem_Multiplayer_V2.jar
Wed Apr 20 15:20:21 EDT 2016 INFO:Use Java PNG Loader = true
default_med(bitmap font) loaded
stat_numbers(bitmap font) loaded
msg_text(bitmap font) loaded
Wed Apr 20 15:20:21 EDT 2016 INFO:Initialising sounds..
Wed Apr 20 15:20:21 EDT 2016 INFO:- Sound works
Wed Apr 20 15:20:21 EDT 2016 INFO:- 64 OpenAL source available
Wed Apr 20 15:20:21 EDT 2016 INFO:- Sounds source generated
default_med(bitmap font) loaded
stat_numbers(bitmap font) loaded
msg_text(bitmap font) loaded
Loaded res/gui/rescue.png
Loaded res/gui/runes.png
Loaded res/gui/connect_button.png
Loaded res/gui/team_builder_button.png
Loaded res/gui/title.png
Loaded res/gui/title_two.png
Loaded res/gui/title_slide.png
1.20 NVIDIA via Cg compiler
20

Upon successfully reaching the title screen in Linux ONLY, complete with music, I closed it as this was just to show that Linux can reach the title screen with the music enabled just fine with the default settings. I noticed some messages appear in a different order when under Linux, not sure if that's relevant but figured I'd show you anyways.

HamaIndustries commented 8 years ago

I'm worried that github is deleting files or something. could you share with me the file(s) that screws up?

ghost commented 8 years ago

could you share with me the file(s) the screws up?

I have no idea what file(s) you're referring to. This bug occurs "out-of-the-box", with no changes made to any files. Everything is stock, exactly as you zipped them. I noticed you posted a build that might address the bug, I'll check it out, but it'll most likely be in the morning since it's 3am by me.

EDIT: I tested the "fix" build and here are my findings:

EDIT 2: Added what we tried from /r/femp and the results to the main post.

HamaIndustries commented 8 years ago

I posted a PSA that's helped 2 people so far. Have you tried it yet? I don't know your reddit username.

ghost commented 8 years ago

I posted a PSA that's helped 2 people so far.

Helped, as in without using the "VOLUME=0.0" workaround?

I don't know your reddit username.

I thought it'd be obvious. I'm /u/throwawaytactician on reddit. Figured I'd make it slightly more elegant on here by making it SapphireTactician.

Have you tried it yet?

I've tried the JDK as you suggested earlier in the afternoon (Eastern time) to no avail. I'll try uninstalling and reinstalling Java but I'm not expecting any new results.

How have your own tests gone on that other computer so far?

ghost commented 8 years ago

So I tested completely clean installs of all the following scenarios in Windows 7 64-bit to NO avail:

The only clue is that it occurs upon reaching the title screen, when the main theme would be called. This took up a good portion of my day and sadly I must report that in all trials I was met with the exact same bug, exact same error log.

That said, I am convinced that at least on a x64 PC, there is no way within Windows that FEMP can successfully run without the "VOLUME=0.0" workaround unless your environment has something that a stock environment doesn't.

Please advise.

HamaIndustries commented 8 years ago

Can you set up a development environment so we can test the variables?

ghost commented 8 years ago

Very well, give me step by step instructions (so that there's no room for error) on what I need to install and do. I presume I'll be running this in a debugger / a debug build to pinpoint exactly what's setting this off? I'm determined to help you stamp out this bug... and I failed, rayrobdod beat me to it. Congrats. GG

rayrobdod commented 8 years ago

class.getProtectionDomain().getCodeSource().getLocation() leaves a bad taste in my mouth. But there's nothing technically wrong with that part.

Anyway, I had no problems with this sound thing, until earlier today. The difference: a space in the file name. Again. You see, class.getProtectionDomain().getCodeSource().getLocation() is a java.net.URL, and java.net.URL::getPath is a URL Encoded string. The program proceeds to ask the filesystem about a file called C:\Users\Drew\Desktop\Fire%20Emblem%20Multiplayer\Fire_Emblem_Multiplayer_V2.jar, and the file system says "I have no idea what you're talking about". And then everything rapidly catches fire.

ghost commented 8 years ago

THIS.... (Cries on the inside...) why didn't I think of that?!

I'm going to sit in the corner now. I should've noticed that much sooner. Note to self, don't take filesystem nuances for granted.

No wonder why Linux ran fine and Windows didn't. In Linux, I'm conditioned to never use spaces in ANYTHING! With Windows, I'm more aesthetic about file and pathnames. The very cmd / terminal outputs here helped save the day, just SOOOOO glad rayrobdod decided to review them and point out what we both overlooked.

This explains why so many people are reporting the crash, somewhere in the pathname, most likely their user folder which might be their first and last name, contains one or more spaces.

eliatlarge, that's our problem. Until a new release, tell everyone that the path must NOT have spaces!

Btw, with rayrobdod's solution, it now works with just the JRE installed.

Feel free to close as fixed once patched.

rayrobdod, had I the money to spare, I'd treat you to dinner for this! Excellent job!

HamaIndustries commented 8 years ago

lol, it was a bit of a jury rig, and I did have issues with spaces. I'll make sure to remember that in the future :P