Author Topic: joy-sdl.cpp crash on mission start  (Read 580 times)

0 Members and 1 Guest are viewing this topic.

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem.
    • Skype
    • Steam
    • Twitter
joy-sdl.cpp crash on mission start
Upon starting a mission after a briefing/ship selection/loadout screen, an Assert message appeared:

Code: [Select]
Assert: "index >= 0 && index < numHats()"
File: joy-sdl.cpp
Line: 445
Invalid index 0!

ntdll.dll! NtWaitForSingleObject + 20 bytes
KERNELBASE.dll! WaitForSingleObjectEx + 143 bytes
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
KERNEL32.DLL! BaseThreadInitThunk + 20 bytes
ntdll.dll! RtlUserThreadStart + 33 bytes
[...]
[ This info is in the clipboard so you can paste it somewhere now ]


Use Debug to break into Debugger, Exit will close the application.

ntdll.dll! NtWaitForSingleObject + 20 bytes
KERNELBASE.dll! WaitForSingleObjectEx + 143 bytes
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
fs2_open_3_7_5_20161201_be27e65_x64_SSE2-FASTDBG.exe! <no symbol>
KERNEL32.DLL! BaseThreadInitThunk + 20 bytes
ntdll.dll! RtlUserThreadStart + 33 bytes

It may be related to joystick part of SDL, I presume.
Bryan See - My FreeSpace Wiki User Page (Talk, Contributions)

Campaigns:
FreeSpace: Reunited - Shattered Stars

Ships:
GTS Hygeia, GTT Argo, SC Raguel

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: joy-sdl.cpp crash on mission start
Looks like some of the input code was assuming any joystick would have at least 1 hat; I've opened a PR to fix this assumption.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem.
    • Skype
    • Steam
    • Twitter
Re: joy-sdl.cpp crash on mission start
Thanks for the tip, Admiral Ralwood! And this includes taking into account whether any joystick is connected or not, internally or externally.
Bryan See - My FreeSpace Wiki User Page (Talk, Contributions)

Campaigns:
FreeSpace: Reunited - Shattered Stars

Ships:
GTS Hygeia, GTT Argo, SC Raguel

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: joy-sdl.cpp crash on mission start
Thanks for the tip, Admiral Ralwood! And this includes taking into account whether any joystick is connected or not, internally or externally.
The code already checked for a joystick actually being present; the problem only occurred if you had a joystick connected and that joystick had no hat switches.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem.
    • Skype
    • Steam
    • Twitter
Re: joy-sdl.cpp crash on mission start
Still happened even after a fix, here's a link: http://www.hard-light.net/forums/index.php?topic=93045.0#new.
Bryan See - My FreeSpace Wiki User Page (Talk, Contributions)

Campaigns:
FreeSpace: Reunited - Shattered Stars

Ships:
GTS Hygeia, GTT Argo, SC Raguel