View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002941 | FSSCP | modular tables | public | 2013-10-25 05:18 | 2013-11-20 09:59 |
Reporter | Yarn | Assigned To | karajorma | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | x64 | OS | Windows 7 | ||
Product Version | 3.7.1 | ||||
Summary | 0002941: FSO crashes if any *-lcl.tbm is missing current language | ||||
Description | If any parsed *-lcl.tbm lacks an entry for the current language, the game crashes on startup. Adding another *-lcl.tbm with the appropriate language entry does not prevent the crash. Because of this bug and the fact that the MediaVPs (as of 3.6.12) include their own mv_core-lcl.tbm, any mod that supports any language other than English, German, French, or Polish will need to include their own mv_core-lcl.tbm simply to override the MediaVP version (and that file will probably be renamed to mv_root-lcl.tbm in the next MediaVP version). | ||||
Steps To Reproduce | (The following steps assume that you're using the 3.6.12 MediaVPs.) 1. In the mediavps_3612\data\tables folder, create an empty file with a name ending in "-lcl.tbm". 2. (Optional) Add some text to the file. A single space character is sufficient. (The error message that you get at the end depends on whether you perform this step.) 3. Run FSO with the 3.6.12 MediaVPs as the selected mod. 4. Crash. | ||||
Additional Information | This is the error that I get if I perform step 2: a-lcl.tbm is corrupt ntdll.dll! ZwWaitForSingleObject + 21 bytes kernel32.dll! WaitForSingleObjectEx + 67 bytes kernel32.dll! WaitForSingleObject + 18 bytes fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> kernel32.dll! BaseThreadInitThunk + 18 bytes ntdll.dll! RtlInitializeExceptionChain + 99 bytes ntdll.dll! RtlInitializeExceptionChain + 54 bytes If I don't perform step 2, then I get this error: Assert: 0 File: cfile.cpp Line: 868 ntdll.dll! ZwWaitForSingleObject + 24 bytes kernel32.dll! WaitForSingleObjectEx + 67 bytes kernel32.dll! WaitForSingleObject + 18 bytes fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> fs2_open_3_7_1-DEBUG-20131024_r9974.exe! <no symbol> kernel32.dll! BaseThreadInitThunk + 18 bytes ntdll.dll! RtlInitializeExceptionChain + 99 bytes ntdll.dll! RtlInitializeExceptionChain + 54 bytes | ||||
Tags | No tags attached. | ||||
|
mantis2941.patch (643 bytes)
Index: code/localization/localize.cpp =================================================================== --- code/localization/localize.cpp (revision 10115) +++ code/localization/localize.cpp (working copy) @@ -307,8 +307,10 @@ strcpy_s(language_tag, "#"); strcat_s(language_tag, Lcl_languages[Lcl_current_lang].lang_name); - if ( skip_to_string(language_tag) != 1 ) - Error(LOCATION, "%s is corrupt", filename); + if ( skip_to_string(language_tag) != 1 ) { + mprintf(("Current language not found in %s\n", filename)); + return; + } // parse all the strings in this section of the table while ( !check_for_string("#") ) { |
|
I've attached a simple patch that hopefully solves this problem safely. Once applied, if the game tries to parse a strings.tbl or *-lcl.tbm file that lacks the current language, then instead of throwing an error, it skips parsing that file and prints "Current language not found in [file name]" to fs2_open.log. |
|
I don't think that's the best solution but since I planned to work on this yesterday and then ran out of time, this will help me when I do finally have the time. |
|
On checking the code, I think the solution above is fine. I'll commit it. |
|
Fix committed to trunk@10130. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-10-25 05:18 | Yarn | New Issue | |
2013-10-25 06:30 | karajorma | Assigned To | => karajorma |
2013-10-25 06:30 | karajorma | Status | new => assigned |
2013-11-18 20:25 | Yarn | File Added: mantis2941.patch | |
2013-11-18 20:25 | Yarn | Note Added: 0015419 | |
2013-11-18 23:30 | karajorma | Note Added: 0015420 | |
2013-11-20 09:48 | karajorma | Note Added: 0015433 | |
2013-11-20 09:59 | karajorma | Changeset attached | => fs2open trunk r10130 |
2013-11-20 09:59 | karajorma | Note Added: 0015434 | |
2013-11-20 09:59 | karajorma | Status | assigned => resolved |
2013-11-20 09:59 | karajorma | Resolution | open => fixed |