Ultimaker / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
6.12k stars 2.06k forks source link

Cura crashes when using "Save To File" #9554

Closed kmcken closed 3 years ago

kmcken commented 3 years ago

cura.log cura_log1.log

Application Version

4.8.0

Platform

Windows 10

Printer

Ender 5

Reproduction steps

  1. Cura open for several hours.
  2. Attempt to save gcode with "Save To File."
  3. Cura crashes.
  4. Bug repeats if Cura is closed and reopened.
  5. Bug goes away only after PC restart.
  6. Bug returns if Cura open for several hours.

Actual results

  1. Cura crashes when using Save To File.
  2. PC restart required.

Expected results

  1. Save To Drive successfully without crashing Cura.
kmcken commented 3 years ago

Added log files to the original issue report.

nallath commented 3 years ago

Duplicate of #9057

kmcken commented 3 years ago

Can you explain why this is a duplicate? Different behavior occurs doing different things across both issues.

Ghostkeeper commented 3 years ago

I think that was a mistake. We've been getting a lot of reports about how Cura crashes when ejecting the removable drive.

Ghostkeeper commented 3 years ago

The log file doesn't mention anything about the crash. That means that the Python environment itself crashed, and that the problem lies within one of Cura's dependencies rather than Cura's own (Python) code.

There is a known issue with the same symptoms as you: https://github.com/Ultimaker/Cura/issues/1537 We've seen this reproduced by installing Windows Explorer extensions, that add things to the open file dialogue, such as Dropbox. Apparently Qt doesn't deal with that well, and it causes Cura to crash when creating the save dialogue. Do you have any such Explorer extensions? And if so, does (temporarily) uninstalling them help to prevent the crash?

In Cura 4.9 we've upgraded the Qt version, so it might also be worth your time to try Cura 4.9. Tell me how that goes!

kmcken commented 3 years ago

I do not use Internet Explorer and Dropbox isn't linked to my File Explorer. I do have PyCharm Community 2020.2, Python 3.6, 3.8, and Anaconda3 and Anaconda Navigator installed on my PC. None of these were updated between when the Cura 4.8 was working and the bug started.

I have installed Cura 4.9 and it works flawlessly. I like the new features; they are a major improvement over 4.8. However, the Save To Drive option that was in 4.8 doesn't show up when my SD drive is plugged in. In any event, I can save to the SD drive with Save To File with no problems.

kmcken commented 3 years ago

If I duplicate the crash again, I will upload the new logs.

Ghostkeeper commented 3 years ago

So in 4.9, for you, this issue transformed into "Cura is not able to find my removable drive any more at all"?

kmcken commented 3 years ago

@Ghostkeeper no, sorry that is a reference to my issue #9556.

I just repeated the #9554 crash in 4.9.0 beta. cura.log

Ghostkeeper commented 3 years ago

Ah okay. Then we'll close this issue in favour of #9556, to keep the discussions about that crash consolidated.

kmcken commented 3 years ago

@Ghostkeeper no! Don't close it! I just got this bug in 4.9.0 today and put the log file in the last comment.

Ghostkeeper commented 3 years ago

With 4.9, we have a similar issue (same result, different reproduction scenario) here: https://github.com/Ultimaker/Cura/issues/9668.

What is different with your case then? The log file looks similar; basically ending abruptly as it seems that Qt has crashed rather than Cura itself. Is there something different about your reproduction steps? Do you have Chitubox' STL thumbnailer installed?

kmcken commented 3 years ago

I do not have Chitubox installed on my PC. The crash happens for me only when Cura has been open for a couple hours and I go to save the gcode with the "Save To File" button. Using File -> Export does not cause a crash.

I have python 3.6 and 3.8 installed on my PC including Anaconda. Though these were installed long before I started using Cura and the crashes have only been recent.

kmcken commented 3 years ago

FYI - I am currently moving and my PC will be inop through next week meaning I can't test to give you a clearer answer until then.

kmcken commented 3 years ago

You may be right about Qt. Are there any steps that I can do to confirm if it's a Qt problem?

Ghostkeeper commented 3 years ago

It would be confirmed by getting an actual stack trace.

Sometimes you'll see more information just by running cura.exe through a command terminal. All of the things we log should also appear in the cura.log file, but Qt tends to put warnings and errors in stdcout sometimes, which isn't intercepted by Cura to put in its normal log file.

To get an actual stack trace, you'd have to open Cura through GDB or something similar, by:

  1. Calling gdb.exe "C:\Program Files\Ultimaker Cura 4.9\cura.exe"
  2. In GDB, call run.
  3. As Cura starts, try to trigger the crash by opening a file dialogue.
  4. When Cura has crashed, type bt in the GDB commands to get a backtrace. This will show the active call stack at the moment the application crashed.

If the most recent entries in the stack are in Qt DLLs, it's a Qt problem. If they are in Python, it's most likely some coding issue in Cura's source code. If they are about cx_freeze, you're looking at the wrong end of the stack.

If you have MS Visual Studio installed, I think the Windows crash dialogue also has an option to "Debug" which would open Visual Studio that also shows a stack trace.

So far we haven't been able to reproduce this issue other than by installing Windows Explorer extensions. Chitubox always crashes, and Dropbox and Google Drive seem to cause a crash only for some people (maybe depending on the version of those extensions).

kmcken commented 3 years ago

@Ghostkeeper

I don't use Chitubux, Dropbox, nor Google Drive. I do use OneDrive.

I haven't had this crash occur recently. I think it went away after a windows update. I'll backtrace and upload if I get it again.

no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Hughsosexy commented 3 years ago

cura.log I am experiencing this issue as well, on all my Curas (4.9, 4.9.1 and 4.10) Even when cura is just open for a few minutes. I cannot work on anything at the moment :(

I have attached the logs

Ghostkeeper commented 3 years ago

@Hughsosexy That log just ends abruptly, similar to kmcken's log. It indicates that Python crashed. Most likely this is the result of one of the C-libraries we load into Python, with PyQt as the main suspect.

To know precisely what crashed and why we'd need to reproduce the issue ourselves and do a backtrace, perhaps modify the code to skip some things to see where in our code it crashes, that sort of thing. It would help to narrow down what's causing it if you provide information about your computer that could be relevant, e.g. whether you have an STL thumbnail generator installed, if you have any explorer extensions like Google Drive or Dropbox installed, etc.