I've had similar experiences and think I have a pattern. In general, I use a lot of tabs (400-600) and have gotten these corrupt sessions from time to time (JSON parsing errors when loading sessions), but seems to be happening more consistently now. I currently have SM save the session every hour. When I inspect my sessions folder, I can see that each session (in this case) is about 110MB. For sessions that have become corrupt, they are only around 40MB. For me, my regular backup sessions are good (there are a few exceptions) but it is the session that is saved when closing down Firefox that is usually bad. This has happened enough that I have a workaround I do now. Before I close Firefox, I go into SM and manually save the session as this works.
My guess is that Firefox imposes some type of "time restriction" for add-ons to shutdown and if they don't complete\respond within that time they are terminated to ensure Firefox closes down in a timely manner. I am not sure if that is the case, but it fits the pattern I am seeing. (Especially, given that when I manually save the session right before closing Firefox tells me that I don't have any corrupt information being saved) Windows has a similar mechanism when it comes to shutting down services when Windows is shutting down. There is a timeout value in the registry that can be changed when to prompt the user to forcefully shutdown a service. I doubt Firefox has something similar in about:config. (Although I do see some dom.ipc.plugins.*timeout* values I might look into)
I am not sure if it is the processing time or the volume of data that is being written out with the sessions. (110MB for 500 tabs seems a bit much) Does anyone know if there are ways to trim down the information being saved? (I have already reduced the number of back buttons entries to save and put the forward entries to 0)
Sorry I didnt get back sooner. I was discouraged by the post that said this thread was no longer being supported.
Session Manager is probably my most valued utility. I had used for many years with no problems. All of a sudden this problem with the sessions started and I for the past year or so I cant solve it.
It's become a tedious chore trying to work around this issue by manually managing sessions. Every time I think I have it cleaned up, it eventually re-occurs.
I think you may be on the right track. I have several manually saved session collected over time, and never have had a problem with any of them.
When I posed this question in the past, it was explained that it was the saved content that corrupted the session.
Because of the way I would get a series of corrupted sessions in succession, I had an unfounded notion that maybe one corrupt saved session could corrupt another uncorrupted session somehow.
Even though it didn't make sense, as an experiment I recently converted all my clean sessions sessions to bookmarks, deleted those sessions, and then recreated sessions from the bookmarks, thus eliminating even the tiniest chance those old sessions could present a problem.
Everything was fine. I still have these sessions and they are uncorrupted.
But some offshoots of these sessions have become corrupted, as well as some of the new sessions that don't resemble the previous ones.
The evidence of this theory would be that not all instances of a session with identical or nearly identical content become corrupted.
I hope someone here will consider this possibility.
I have heard the same explanation about data corrupting the save session. However, in my case it is very clear that manually saved sessions work 100% of the time, regularly saved sessions (hourly) work almost all the time, and sessions saved while closing down the browser work very rarely when dealing with large (400+) tabs. I have unfortunately just got used to saving my session manually before closing the browser or using the last good saved session which means I lose at most an hour of changes.
My work machine has less than 150 tabs open and I never have any problems with that machine regardless of situation. I am fairly convinced either Firefox is forcefully stopping the add-on during shutdown if it does not respond within a given time OR there is some separate logic to saving sessions during shutdown vs. regular backups.
PS. At any given moment, I normally only have 20-30 of these tabs "loaded" and the rest are "unloaded".