Source Code Project Mantis - FSSCP
View Issue Details
0002042FSSCP---------public2009-11-18 20:292009-11-26 12:18
ReporterFUBAR-BDHR 
Assigned Toportej05 
PriorityhighSeverityblockReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.6.11 
Target Version3.6.12 RC1Fixed in Version3.6.11 
Summary0002042: Standalones using mods will not run at all from launcher
DescriptionUpdated the standalones to 5666 today. Running from F5 I have no problems. Running from the launcher errors out but only if a mod is enabled. Here's the error, call stack and variables.
Additional InformationERANGE: String error. Please Report.
Trying to put into 128 byte buffer:
C:\Program Files\The Babylon Project\
ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ\
<no module>! KiFastSystemCallRet
<no module>! WaitForSingleObject + 18 bytes
<no module>! SCP_DumpStack + 260 bytes
<no module>! Error + 229 bytes
<no module>! scp_strcpy_s + 297 bytes
<no module>! scp_strcpy_s<128> + 56 bytes
<no module>! cf_get_packfile_count + 121 bytes
<no module>! cf_build_pack_list + 49 bytes
<no module>! cf_build_root_list + 503 bytes
<no module>! cf_build_secondary_filelist + 158 bytes
<no module>! cfile_init + 398 bytes
<no module>! game_init + 286 bytes
<no module>! game_main + 505 bytes
<no module>! WinMain + 330 bytes
<no module>! __tmainCRTStartup + 358 bytes
<no module>! WinMainCRTStartup + 15 bytes
<no module>! RegisterWaitForInputIdle + 73 bytes

> fs2_open_3_6_11d_sse2.exe!debug_int3(char * file=0x00e750f8, int line=458) Line 760 C++
     fs2_open_3_6_11d_sse2.exe!cf_build_root_list(char * cdrom_dir=0x00000000) Line 458 + 0x13 bytes C++
     fs2_open_3_6_11d_sse2.exe!cf_build_secondary_filelist(char * cdrom_dir=0x00000000) Line 796 + 0x9 bytes C++
     fs2_open_3_6_11d_sse2.exe!cfile_init(char * exe_dir=0x0012f854, char * cdrom_dir=0x00000000) Line 215 + 0xb bytes C++
     fs2_open_3_6_11d_sse2.exe!game_init() Line 1965 + 0x23 bytes C++
     fs2_open_3_6_11d_sse2.exe!game_main(char * cmdline=0x0015232b) Line 7395 C++
     fs2_open_3_6_11d_sse2.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * hPrev=0x00000000, char * szCmdLine=0x0015232b, int nCmdShow=10) Line 7522 + 0x9 bytes C++
     fs2_open_3_6_11d_sse2.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
     fs2_open_3_6_11d_sse2.exe!WinMainCRTStartup() Line 182 C
     kernel32.dll!7c817077()
     [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

Autos:

+ root 0x03119ba0 {path=0x03119ba0 "C:\Games\FreeSpace2" roottype=-842150451 } cf_root *
+ root->path 0x03119ba0 "C:\Games\FreeSpace2" char [256]
+ str_temp 0x0012f360 "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ" char [256]

Locals:

+ cdrom_dir 0x00000000 <Bad Ptr> char *
+ root 0x03119ba0 {path=0x03119ba0 "C:\Games\FreeSpace2" roottype=-842150451 } cf_root *
+ str_temp 0x0012f360 "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ" char [256]
+ cur_pos 0x031182ce "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ" char *

Up one level autos:

- cdrom_dir 0x00000000 <Bad Ptr> char *
            CXX0030: Error: expression cannot be evaluated

TagsNo tags attached.
Attached Files

Notes
(0011309)
chief1983   
2009-11-19 10:14   
By the way portej05, I assigned this to you since it has to do with buffers. Figured you'd have an idea.
(0011310)
portej05   
2009-11-21 03:16   
The two call stacks appear to be from different points in execution.

This kind of comment doesn't help :P:
"//This for statement is a work of art :D"
(0011311)
portej05   
2009-11-21 03:18   
CF_MAX_PATHNAME_LENGTH == 256
MAX_PATH_LEN == 128

The code is trying to copy the contents of the first buffer (of length CF_MAX_PATHNAME_LENGTH) into the second (MAX_PATH_LEN).

Acknowledged.
(0011316)
portej05   
2009-11-22 03:44   
I can't reproduce this error using the set up I've got.
"C:\Program Files\The Babylon Project\" is longer than 32 characters though, have you tried putting into a smaller directory?
Somewhere there may be an unsafe strings call writing past the end of the buffer, followed by a safe_strings call where the buffer sizes are checked.
(0011319)
chief1983   
2009-11-22 11:39   
The full path can be longer than 32 characters I thought. I thought only filenames got stuck in that 32 byte buffer.
(0011323)
portej05   
2009-11-22 23:45   
Seems double NULL termination is not occurring on Cmdline_mod
(0011324)
portej05   
2009-11-22 23:46   
Potential fix committed.
(0011345)
FUBAR-BDHR   
2009-11-26 02:39   
Looks good. Resolve away............
(0011346)
portej05   
2009-11-26 12:18   
Fixed.

Issue History
2009-11-18 20:29FUBAR-BDHRNew Issue
2009-11-18 20:29FUBAR-BDHRStatusnew => assigned
2009-11-18 20:29FUBAR-BDHRAssigned To => chief1983
2009-11-18 23:52chief1983Assigned Tochief1983 => portej05
2009-11-18 23:52chief1983Prioritynormal => high
2009-11-18 23:52chief1983CategoryBuild system => ---------
2009-11-18 23:52chief1983Target Version => 3.6.12 RC1
2009-11-19 10:14chief1983Note Added: 0011309
2009-11-21 03:16portej05Note Added: 0011310
2009-11-21 03:18portej05Note Added: 0011311
2009-11-21 03:18portej05Statusassigned => acknowledged
2009-11-22 03:44portej05Note Added: 0011316
2009-11-22 11:39chief1983Note Added: 0011319
2009-11-22 23:45portej05Note Added: 0011323
2009-11-22 23:45portej05Statusacknowledged => confirmed
2009-11-22 23:46portej05Note Added: 0011324
2009-11-22 23:46portej05Statusconfirmed => feedback
2009-11-26 02:39FUBAR-BDHRNote Added: 0011345
2009-11-26 12:18portej05Note Added: 0011346
2009-11-26 12:18portej05Statusfeedback => resolved
2009-11-26 12:18portej05Fixed in Version => 3.6.11
2009-11-26 12:18portej05Resolutionopen => fixed