| Summary: | Crash on startup when using empty command-line argument. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | yrizoud |
| Component: | main | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P1 | CC: | jspradlin |
| Version: | 1.2.14 | ||
| Hardware: | x86 | ||
| OS: | Windows (95/98/ME) | ||
Thank you for your bug report! We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible. Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot? http://www.libsdl.org/tmp/SDL-1.3.zip Thanks! Sorry I can't say for 1.3, can't get the full toolchain to build it. The source for this part had almost no change. However, I just noticed something important about this issue: It only occurs when running the SDL program using GDB or MSYS's shell! So it's only an annoyance for developers. So I lowered "importance" to trivial. It's probably one of the side effects of such environment causes a different string for GetCommandLine(), especially a mix of / and \ like: "D:\\Data\\C\\GFX2\\grafx2\\src/..\\bin\\grafx2.exe arg1 arg2" Or if a space is present in path: "\"D:\\Data\\C\\GFX2\\grafx2\\src/..\\bin\\test space\\grafx2.exe\" arg1 arg2" Bumping priority on a few bugs that I would like examined more closely before 1.2.15 is finalized. This is not a promise that a bug will be fixed. We may close it with WONTFIX or WORKSFORME or something, but I just want to make sure attention is paid. --ryan. Oh, I see the problem here. I'll have a fix shortly. This is fixed, thanks! http://hg.libsdl.org/SDL/rev/19c7412a6345 |
Run a SDL program with "" as one of the command-line arguments: crash on startup. Program received signal SIGSEGV, Segmentation fault. 0x0047b2ea in ParseCommandLine (cmdline=<value optimized out>, argv=0x0) at ./src/main/win32/SDL_win32_main.c:100 100 while ( *bufp && ( *bufp != '"' || *lastp == '\\' ) ) { (gdb) bt #0 0x0047b2ea in ParseCommandLine (cmdline=<value optimized out>, argv=0x0) at ./src/main/win32/SDL_win32_main.c:100 #1 0x0047b5bb in WinMain@16 (hInst=0x400000, hPrev=0x0, szCmdLine=0x81c530e0 "a \"\" b", sw=10) at ./src/main/win32/SDL_win32_main.c:374 #2 0x0047af28 in main () --- The problem is that on Windows when you make a shortcut, and want it to accept drag-and-dropped files, the good way to make it work work with files that have spaces in their names or paths is make this argument "%1" (with the surrounding quotes). But then when you run it without dropping a file into it, it's resolved as "", and triggers this bug.