PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Gcode thumbnail process keeps crashing

Open HTMLdu opened this issue 2 years ago • 2 comments

Microsoft PowerToys version

0.66.0

Installation method

Microsoft Store

Running as admin

Yes

Area(s) with issue?

File Explorer: Preview Pane

Steps to reproduce

Install PowerToys 0.66.0 or 0.67.0 Enable Gcode file preview Check event viewer image

✔️ Expected Behavior

Not this many errors in event viewer

❌ Actual Behavior

Lots of unhandled exception errors

Other Software

No response

Update

Issue seems to have been caused by pull request #22217

HTMLdu avatar Jan 24 '23 16:01 HTMLdu

After reinstalling, I still experience this issue even on 0.67.0.

joshuafhiggins avatar Feb 02 '23 23:02 joshuafhiggins

I still get this issue after diasabling gcode thumbnail preview

HTMLdu avatar Feb 03 '23 21:02 HTMLdu

I can confirm this issue, and I believe I know WHY this is happening...

As pointed out by @HTMLdu, the changes made by @stefansjfw on #22217 caused this problem, and the reason is that the provider can return null, like here:

https://github.com/microsoft/PowerToys/blob/c180150d5413c58f8ab7a4eed551dd0ab71ec52e/src/modules/previewpane/GcodeThumbnailProvider/GcodeThumbnailProvider.cs#L41-L46

Yet the caller will always try and save a thumbnail (which can be null), like here:

https://github.com/microsoft/PowerToys/blob/c180150d5413c58f8ab7a4eed551dd0ab71ec52e/src/modules/previewpane/GcodeThumbnailProvider/Program.cs#L28-L30

I'm not sure of the reason for that code change, however it seems all thumbnail provider suffer from this issue!

pedrolamas avatar Feb 07 '23 16:02 pedrolamas

This is being fixed as we speak. Thanks for reporting the issue

stefansjfw avatar Feb 07 '23 16:02 stefansjfw

@pedrolamas Can you pass me some .gcode file that was causing a crash for you ? Thanks in advance

stefansjfw avatar Feb 07 '23 17:02 stefansjfw

I opened the sample.gcode file and removed everything between ; thumbnail begin and ; thumbnail end (including these 2 delimiters), that should be enough to basically strip this file from the embedded thumbnail data.

Here's the result:

sample.zip

pedrolamas avatar Feb 07 '23 17:02 pedrolamas

@crutkas I just tested 0.67.1 and I don't see any more crashes on the Event Log, so to me this issue is now fixed! Thank you and @stefansjfw for the quick fix!! 🙂

pedrolamas avatar Feb 08 '23 09:02 pedrolamas

@crutkas I just tested 0.67.1 and I don't see any more crashes on the Event Log, so to me this issue is now fixed! Thank you and @stefansjfw for the quick fix!! 🙂

Thank you once again for all the help :)

stefansjfw avatar Feb 08 '23 09:02 stefansjfw

This issue has been fixed in the 0.67.1 release. Please update PowerToys to get it. Thank you!

jaimecbernardo avatar Feb 09 '23 14:02 jaimecbernardo