Source Code Project Mantis - FSSCP
View Issue Details
0003006FSSCPFREDpublic2014-02-06 21:122020-04-14 13:30
Assigned To 
PlatformPCOSWindowsOS VersionWindows 7 64 bit
Product Version3.7.1 
Target VersionFixed in Version 
Summary0003006: FRED crashes when left open and idle for long periods of time.
DescriptionBy Kara's request -

FRED locks up and stops responding when left idle for long periods of time. This may be tied to OS sleep/hibernation behavior, but it's not clear. While a bunch of people have confirmed encountering this bug and some think it's tied to leaving the events window open, others don't get encounter it at all.

I don't think this issue is a major priority. It's only a serious concern when the FREDder has to leave the computer without saving and can't return for a long time (a pretty rare use case unless, well, you are being dragged away, which is not a bad problem to have but which can really set your missions back!).
Steps To ReproduceWe're working to narrow this down. I'm gonna try leaving FRED on overnight WITHOUT the events window open to see if that alters the outcome.
TagsNo tags attached.
Attached Filespng vector subscript.png (84,171) 2016-12-29 23:55

png Clipboard01.png (121,925) 2016-12-31 15:38

2014-02-09 08:33   
Could be a memory leak of some form.
2014-03-31 11:57   
Has there been any progress on this?
2016-12-29 23:59   
Attached a screenshot from Brian See, reported in this thread:

This makes things more interesting. Just spitballing here - I wonder if the Event Editor is updating some sort of log, tally, or other vector-based structure, and leaving the window open for a long time causes the index to exceed INT_MAX.
2016-12-31 15:39   
I managed to reproduce something sorta related. The same error message as Bryan See anyway. I added a bunch of new messages and events in the event editor, let it sit for like 3 hours and when I hit the okay button, I got that error message.
2016-12-31 15:39   
(Should note I attached a picture of the debugger trying to trace it down, its something messages related)
2016-12-31 15:45   
Okay, after trying again, this happens all the time with Debug FRED. No idling required. It'll happen all the time if you add a message and then click OK in the event editor.

It may not be the same bug, but it is a bug.
2017-01-01 00:42   
Well, I've opened a PR for at least the issue Axem reported (since I could actually reproduce it):
2017-01-01 17:49   
I was going to look into this today but I see MageKing17 already beat me to it, with the correct identification and solution. :yes:

That doesn't fix the root cause of the idling bug, though, since OnOk only runs when you click Ok.

While looking into this I found another issue, for which I've opened a PR here:
2017-01-01 18:09   
I wouldn't rule out PR 0001123 fixing the idling bug; given that it was writing past the end of the vector, we were in nasal demon territory. The undefined behavior could very well have meant that, if messages were added and ok was clicked at least once, FRED could've been left in a "ticking time bomb" state that made a future crash inevitable. We won't know for sure until/unless the idling crash happens again in the future.
2020-04-14 13:30   
I ran FRED overnight with a complex mission on the screen and the Event Editor open, and it responded fine in the morning. I'm calling this fixed.

Issue History
2014-02-06 21:12GeneralBattutaNew Issue
2014-02-09 08:33Echelon9Note Added: 0015621
2014-03-31 11:57Goober5000Note Added: 0015695
2016-12-29 23:54Goober5000Statusnew => confirmed
2016-12-29 23:55Goober5000File Added: vector subscript.png
2016-12-29 23:59Goober5000Note Added: 0016841
2016-12-31 15:39AxemFile Added: Clipboard01.png
2016-12-31 15:39AxemNote Added: 0016842
2016-12-31 15:39AxemNote Added: 0016843
2016-12-31 15:45AxemNote Added: 0016844
2017-01-01 00:42MageKing17Note Added: 0016845
2017-01-01 17:49Goober5000Note Added: 0016846
2017-01-01 18:09MageKing17Note Added: 0016847
2020-04-14 13:30Goober5000Statusconfirmed => resolved
2020-04-14 13:30Goober5000Resolutionopen => fixed
2020-04-14 13:30Goober5000Note Added: 0016979