-
Notifications
You must be signed in to change notification settings - Fork 468
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
Linking images on a different drive crashes on Windows (was: Freeze and crash on saving images) #1423
Comments
I did some more testing, and it seems I was wrong, and it does have something to do with file location. If the image is not on the same drive as the slvs file, it fails, and the specific image has nothing to do with it. (i.e image from I also tested it with an older solvespace build ( |
It turns out images on a different drive are currently not supported. Here is what happens: First it tries to make the path to the linked image relative in this context:
Since the image is on a different drive this fails and returns an empty path here: solvespace/src/platform/platform.cpp Line 366 in 727b015
And then it should (intentionally) crash here: Line 250 in 727b015
@jkrei0 doesn't it do that for you? |
It does eventually give me that dialog, if I let it sit for a while (not sure how long, it took letting it sit overnight). But until then, it just seems frozen - with a spinny mouse cursor, and cpu usage goes up to a mostly consistent 20% (for reference, when saving a file "normally", it spikes to ~ 20% cpu for only a second). And windows never complains about it like it usually does for unresponsive programs. I'll try letting it go for a while again and see if I can get it to generate a debug report. |
It does the same for me if I run it "alone" (not debugging from Visual Studio). |
Edit: I just read your comment, and yes, I get an error box pretty much immediately if I |
No need to generate a debug report - I debugged it - and it is perfectly clear what happens. Linked files on different drives are simply not supported right now because SolveSpace wants to store a relative path in the .slvs file. This applies only to Windows since Unix-es do not have drive letters so all paths can be relative. Whether this should be supported or not is not clear. The advantage of relative paths is that if the top level directory of a complex project with many linked files (in sub directories) is moved to a different location everything continues to work. The disadvantage is obviously this issue. Even if we decide not to support absolute paths on Windows (that would be my preference) I think it should not be a crash but a "civilized" error message with an explanation. But this will take some doing. |
System information
SolveSpace version: 3.1~0fd3af58 (latest, plus some fixes in my fork)
Operating system: Windows 10 Pro 19045
Expected behavior
File saves as normal
Actual behavior
When attempting to save files with (some) images, SolveSpace freezes and cpu usage spikes. If you let it run for many hours, it'll eventually crash.
Additional information
It seems to be dependent on the image file (crash happens only with some image files, but consistently), although I can't tell what the pattern is. Filename, path, drive, etc all seem to make no difference (I can move and rename a file and the issue persists).
It also doesn't seem to change anything if there are other things in the file, or if the file has been saved previously.
Here's some example images and save files:
test_crash_save.zip
The text was updated successfully, but these errors were encountered: