View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003146 | FSSCP | user interface | public | 2015-02-27 02:50 | 2015-03-31 08:33 |
| Reporter | Yarn | Assigned To | m_m | ||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Platform | x64 | OS | Windows 7 | ||
| Product Version | 3.7.2 RC5 | ||||
| Summary | 0003146: Crash when pressing enter key in empty region of main hall | ||||
| Description | Normally, when a main hall is being displayed, pressing the enter key selects whatever door the mouse cursor is hovering over. Of course, if the mouse cursor isn't pointing at a door, then nothing should happen when the enter key is pressed. Starting at revision 10941, however, pressing the enter key while the cursor isn't hovering over a door produces this error message: Region -1 doesn't have an action! ntdll.dll! ZwWaitForSingleObject + 21 bytes kernel32.dll! WaitForSingleObjectEx + 67 bytes kernel32.dll! WaitForSingleObject + 18 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! SCP_DumpStack + 354 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! Error + 279 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! main_hall_do + 2038 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! game_do_state + 205 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! gameseq_process_events + 232 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! game_main + 782 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! WinMain + 328 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! __tmainCRTStartup + 296 bytes fs2_open_3_7_1_SSE2-DEBUG.exe! WinMainCRTStartup + 13 bytes kernel32.dll! BaseThreadInitThunk + 18 bytes ntdll.dll! RtlInitializeExceptionChain + 99 bytes ntdll.dll! RtlInitializeExceptionChain + 54 bytes The error is being thrown from line 825 of mainhallmenu.cpp. Commenting out that line prevents the crash. | ||||
| Steps To Reproduce | Just load any main hall, move the mouse cursor away from the doors, and press enter. FSO will crash when you do. | ||||
| Tags | No tags attached. | ||||
|
|
Replacing line 825 of mainhallmenu.cpp with a break statement should fix this issue properly, as far as I can tell. |
|
|
If a region actually doesn't have an action (which shouldn't be possible but it's better to be on the safe side) the error could still be reached. If code is -1 nothing should be done, I have uploaded a patch that implements that behavior. |
|
|
mainhallmenu.cpp.patch (567 bytes)
Index: code/menuui/mainhallmenu.cpp
===================================================================
--- code/menuui/mainhallmenu.cpp (revision 11289)
+++ code/menuui/mainhallmenu.cpp (working copy)
@@ -814,6 +814,11 @@
if (code == ESC_PRESSED) {
region_action = ESC_PRESSED;
} else {
+ if (code == -1) {
+ // User didn't click on a valid button, just ignore the event
+ break;
+ }
+
for (it = Main_hall->regions.begin(); Main_hall->regions.end() != it; ++it) {
if (it->mask == code) {
region_action = it->action;
|
|
|
Patch works for me, and the code looks fine as well. |
|
|
Fix committed to trunk@11296. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2015-02-27 02:50 | Yarn | New Issue | |
| 2015-02-27 11:53 | niffiwan | Status | new => confirmed |
| 2015-02-28 09:27 | LotF | Note Added: 0016519 | |
| 2015-03-25 12:21 | m_m | Note Added: 0016575 | |
| 2015-03-25 12:21 | m_m | File Added: mainhallmenu.cpp.patch | |
| 2015-03-25 12:22 | m_m | Assigned To | => m_m |
| 2015-03-25 12:22 | m_m | Status | confirmed => code review |
| 2015-03-31 08:25 | niffiwan | Note Added: 0016595 | |
| 2015-03-31 08:33 | m_m | Changeset attached | => fs2open trunk r11296 |
| 2015-03-31 08:33 | m_m | Note Added: 0016596 | |
| 2015-03-31 08:33 | m_m | Status | code review => resolved |
| 2015-03-31 08:33 | m_m | Resolution | open => fixed |