Source Code Project Mantis - FSSCP
View Issue Details
0001748FSSCPFREDpublic2008-08-13 00:122008-12-04 13:31
Reporterchief1983 
Assigned Tophreak 
PrioritylowSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.6.9 
Target VersionFixed in Version 
Summary0001748: FRED crashes when attempting to change Squad Logo
DescriptionNot sure how reproducable this will be for other people. I have my Freespace and FotG standalone folders in E:\Games\. When I run FRED for either one, using a recent build, and set a wing, then go to the wing editor and click the Squad Logo button, the game crashes with a Debug Assertion failure in drive.c, line 109.

Expression: ("Invalid drive index", 0)

For all I know this is a bug related to the VS 2008 compiler with FSOpen. Just thought I'd throw it out there in case anyone else can reproduce it.
TagsNo tags attached.
Attached Files

Notes
(0009562)
karajorma   
2008-08-14 03:19   
I'm not getting that. What folder does FRED default to when you try to save?
(0009563)
chief1983   
2008-08-14 21:16   
Not sure. Like I said, all I know is that my games are on E:\ and my Windows is on C:\, and I have several other drives. I am out of town right now, I'll find out the answer to your question after Sunday.
(0009568)
phreak   
2008-08-17 23:10   
(Last edited: 2008-08-17 23:18)
Works here, and i'm using the same compiler. Does this happen all the time for you? Try going to C:\Windows\ and delete every fred2_open*.ini file.

drive.c sounds like a system level source file.

Edit: That being said, I don't think writing to C:\windows is allowable for non-admin accounts. That file may want to be stored in My Documents\My Games\Fred2_Open or something.

(0009587)
chief1983   
2008-08-21 21:50   
Deleted all the inis, I still get the error with recent 3.6.10 builds, but not with 3.6.9. FRED defaults to my My Documents folder when I go to save a mission. No one else can reproduce this issue with my builds then? Seems to be pretty isolated to me. I am on an admin account btw. The INIs were in the first place you said.
(0009588)
phreak   
2008-08-21 23:22   
I can try to reproduce this using my laptop, since that is running Vista
(0009590)
chief1983   
2008-08-22 10:53   
Go ahead, but I'm on XP myself. XP32. I should probably try someone else's recent 3.6.10 builds just to see what happens.
(0009591)
phreak   
2008-08-22 10:54   
Works on the laptop with Vista and VC2008. Don't know how else I can help.
(0009604)
chief1983   
2008-08-24 05:38   
Well, it definitely seems to be something with my builds again. At least, I can't reproduce it with WMC's 8/21 build, but I can on my 8/18 build.

But aha! I found one more build lurking on the forums that crashes. phreak, your build crashes for me. So, it seems to be a combination of the VS2008 profile builds, and my particular setup. Now to figure out what the problem is...
(0009609)
chief1983   
2008-08-25 20:42   
As far as figuring out that problem, I'm open to investigating any more ideas anyone has...
(0009613)
phreak   
2008-08-26 00:14   
i don't know, other than run a stack trace. I see the issue appears in the _chdrive() function.
(0009618)
chief1983   
2008-08-29 01:21   
I just noticed, I'm able to generate the error when I run FRED from another drive, like with the exe just sitting on the desktop. If someone else can reproduce it this way, perhaps they'd have better luck figuring out why it's a crash, and not at least a friendly error message? Either way, I think the crash on mine is related to the file open dialog box, so they're probably coming from different places.
(0009626)
chief1983   
2008-08-29 21:57   
Compiled a build with MSVC6, no problems for me. Seems related to MSVC 2008 somehow, that and the combination of being on my E: drive, in a sequence which goes up through K:, and there's also a Z:
(0009895)
chief1983   
2008-10-09 12:38   
Since this only seems to affect me, and only with VS2008 builds, I'm lowering priority. It is however, still a bug, I just can't expect anyone to fix it if they can't reproduce it. Maybe someone else will someday though.
(0010320)
chief1983   
2008-12-02 16:03   
Ok, just happened to feel like looking at this bug again. I was able to reproduce it on my work PC, also XP32, using VS2008 builds. It's still crashing on me. Kara, the save window defaults to my missions folder. The game is installed to C:\Games\FS2, a pretty basic path. I don't even have any other hard drives or partitions in this PC, but there are a couple of network mounts. If phreak doesn't get this on XP32 then I'm not sure what to do, but I have been able to reproduce it on two computers now with VS2008 nightly builds. I'm tempted to bump this back up in priority.
(0010322)
karajorma   
2008-12-02 16:16   
There is an issue with DDS vs PCX squad logos at the moment. Do you only have PCX ones? Cause if you have any DDS logos kicking about this could be the same bug.
(0010323)
chief1983   
2008-12-02 18:08   
I was using retail data, no DDS present. Same with when I test with the FotG data, there's only PCX at the moment.
(0010324)
Zacam   
2008-12-02 22:04   
Given that I never run FRED, I tried this out.

Opened FRED2_Open (Builds 4939-4968). Shift+N. Put in a Name "101st Test". Hit the Logo Button. Crash.

Hmmm.

Re-Opened FRED2. Placed 4 ships, formed BLAZI--err, wing (CTRL+W). Right-Clicked lead and chose Edit Wing. Hit Squad Logo, Crash.

Retail and MediaVP's (3.6.8zeta+710 and Internal 3.6.10).

Debug generates this:

Debug Assertion Failed!

Program: C\Freespace2\fred2_open_3_6_10d.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\drive.c
Line: 109

Expression: ("Invalid Drive Index",0)

For information on how your program can cause an assert
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
(0010325)
FUBAR-BDHR   
2008-12-02 22:15   
Crashes only if you don't have a data\players\squads directory.
(0010326)
Zacam   
2008-12-02 23:43   
No. I do have a data\players\squads dir in both retail and SVN working dir when I had those crashes.

Why? Left them trying to solve for custom Insignia not displaying as available in multiplayer.
(0010327)
phreak   
2008-12-03 00:38   
Oddly enough for me this didn't crash if FRED was started from visual studio. I was able to trace back the problem if I started FRED outside the debugger and attached to the process.

Anyway the fix has been committed.
(0010328)
chief1983   
2008-12-03 01:50   
phreak, I think the lowercasing should be done in the #ifdef _WIN32 like the other one. Also, the function below it is set up very similarly, and would likely suffer from the same problem, so I put a fix in for it too. I put a patch up at http://swc.fs2downloads.com/files/fred_logo_crash_fix.diff

I was about to mention this in this bug and saw you managed to get a fix in before I could. Sneaky bastard :)
(0010329)
phreak   
2008-12-03 09:49   
Since OriginalDirectory is only really used in that one spot in both functions, it would be more efficient to just use tolower() on the drive letter than to lowercase the entire string.
(0010330)
chief1983   
2008-12-03 13:55   
That's not to say it would always be that way. It could end up getting used elsewhere, who knows? Until that point in the function it's wrong. I think for consistency it would be better to keep them all lowercased on Windows, and it should probably be within that #ifdef anyway still. Either fix needs to be applied to both cfile_push_chdir and cfile_chdir though. It may also be a good idea to put an assert in such that the DriveNum is positive.
(0010331)
Zacam   
2008-12-03 22:27   
(Last edited: 2008-12-03 22:28)
So, on firing up FRED build 4973 and doing a Squad Logo, I was greeted with a message telling me that a folder I had set as a mod way back when the last time was I fired up fred (and now no longer exists) couldn't be found.

It then let me proceed as normal (or so I am assuming) in looking for a PCX file for the logo.

2 issues with that: A: It was only looking for/allowing the selection of a PCX file. B: What if I was using a squadron from retail? I would then have to extract the squad logo in question from the retail VP's before I could as it will not allow me to manually enter a PCX file name or replace the resulting name from a selected PCX file. Or, I would have to touch up the mission in notepad. At which point, well.....n/m.

Other than those two items, the issue as stated appears to have been resolved for both Logo assignation from within Mission Specs and Wing Edit.

(0010332)
chief1983   
2008-12-04 00:04   
Yeah, Karajorma's aware of that problem, but you may want to report it for thoroughness anyway. Then you might be able to bump him back up to 13 bugs too (he'd hate that) :)
(0010333)
karajorma   
2008-12-04 03:59   
Is DDS the only other format it will accept or will it take jpg and tga too?
(0010336)
chief1983   
2008-12-04 13:31   
Closing as resolved in 4973. Discussion on the DDS for dropdown has been moved to new bug 0001836.

Issue History
2008-08-13 00:12chief1983New Issue
2008-08-14 03:19karajormaNote Added: 0009562
2008-08-14 21:16chief1983Note Added: 0009563
2008-08-17 23:10phreakNote Added: 0009568
2008-08-17 23:12phreakNote Edited: 0009568
2008-08-17 23:18phreakNote Edited: 0009568
2008-08-21 21:50chief1983Note Added: 0009587
2008-08-21 23:22phreakNote Added: 0009588
2008-08-22 10:53chief1983Note Added: 0009590
2008-08-22 10:54phreakNote Added: 0009591
2008-08-24 05:38chief1983Note Added: 0009604
2008-08-25 20:42chief1983Note Added: 0009609
2008-08-26 00:14phreakNote Added: 0009613
2008-08-29 01:21chief1983Note Added: 0009618
2008-08-29 21:57chief1983Note Added: 0009626
2008-10-09 12:38chief1983Note Added: 0009895
2008-10-09 12:38chief1983Prioritynormal => low
2008-12-02 16:03chief1983Note Added: 0010320
2008-12-02 16:16karajormaNote Added: 0010322
2008-12-02 18:08chief1983Note Added: 0010323
2008-12-02 22:04ZacamNote Added: 0010324
2008-12-02 22:15FUBAR-BDHRNote Added: 0010325
2008-12-02 23:43ZacamNote Added: 0010326
2008-12-03 00:38phreakNote Added: 0010327
2008-12-03 01:50chief1983Note Added: 0010328
2008-12-03 09:49phreakNote Added: 0010329
2008-12-03 13:55chief1983Note Added: 0010330
2008-12-03 22:27ZacamNote Added: 0010331
2008-12-03 22:28ZacamNote Edited: 0010331
2008-12-04 00:04chief1983Note Added: 0010332
2008-12-04 03:59karajormaNote Added: 0010333
2008-12-04 13:31chief1983Note Added: 0010336
2008-12-04 13:31chief1983Assigned To => phreak
2008-12-04 13:31chief1983Statusnew => resolved
2008-12-04 13:31chief1983Resolutionopen => fixed