New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening and Empty .slvs File Causes a Crash (Was: "Crash after autosave-restore dialog wth file from v2.3") #918
Comments
I tried again. The problem is the empty autosave file, which v2.3 created at some point. After putting it back into the same dir than the file I want to open, it crashes after trying to load the real file, if I click on "Load autosave". Same with both versions of Solvespace. If I click not to load it, then it works with both versions, the same if I delete the autosave-file. |
There is a problem when opening empty (0 bytes long) .SLVS files. The problem is that here: Line 480 in 11a8a0a
we clear all groups. Then we try to read an empty file and therefore this while exists immediately:Line 487 in 11a8a0a
and we come to here: Line 548 in 11a8a0a
where there is no fileLoadError and thus we are left with no groups, and so this assert fails:solvespace/src/graphicswin.cpp Line 394 in 11a8a0a
since is is not allowed to have no groups :-) |
Fixes: solvespace#918 The problem was that here: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/file.cpp#L480 we cleared all groups. Then we tried to read an empty file and therefore this `while` exited immediately: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/file.cpp#L487 and we came to here: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/file.cpp#L548 where there was no `fileLoadError` and thus we were left with no groups, and so this assert failed: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/graphicswin.cpp#L394 since is is not allowed to have no groups :-)
Fixed. |
Fixes: #918 The problem was that here: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/file.cpp#L480 we cleared all groups. Then we tried to read an empty file and therefore this `while` exited immediately: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/file.cpp#L487 and we came to here: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/file.cpp#L548 where there was no `fileLoadError` and thus we were left with no groups, and so this assert failed: https://github.com/solvespace/solvespace/blob/11a8a0abd5e21a0da6c818674f8b4b657a401a6c/src/graphicswin.cpp#L394 since is is not allowed to have no groups :-)
System information
Expected behavior
Autosave file from v2.3 should open on v3 when I click to load it in the startup dialog.
Actual behavior
Crash.
Additional information
Shell:
(solvespace:18054): Gtk-CRITICAL **: 10:57:23.745: gtk_file_chooser_widget_set_current_name: assertion 'priv->action == GTK_FILE_CHOOSER_ACTION_SAVE || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER' failed
File ./src/graphicswin.cpp, line 394, function Init:
Assertion failed: !SK.groupOrder.IsEmpty().
Message: Group order can't be empty since we will activate the last group..
Aborted
Chuwi-Guard.slvs.zip
The text was updated successfully, but these errors were encountered: