Skip to content
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

Play ► a very simple content in [Audio] mode will crash Shotcut #1172

Closed
chenx77 opened this issue Oct 27, 2021 · 19 comments
Closed

Play ► a very simple content in [Audio] mode will crash Shotcut #1172

chenx77 opened this issue Oct 27, 2021 · 19 comments
Labels
Milestone

Comments

@chenx77
Copy link

chenx77 commented Oct 27, 2021

A. How to reproduce

Create a simple project, e.g., to have a simple text on a empty canvas as the one in attached
Study.zip

Switch work mode from tab [Editing] to [Audio] (yellow oral), then play (► button in red circle), as depicted in attached screenshot: Screenshot (687)

In most cases the Shotcut crashs at no more than 50 frames (total frame counts 250).

There is no problem to generate a decent mp4 clip, no matter in [Editing] or [Audio] mode. I'm using the default video export: 1920 x 1080, 50 frames/sec, YADIF, Bilinear (good).

B. Environment

Windows 10 Pro
Processor: Intel(R) Pentium(R) Gold G5500 CPU @ 3.80GHz 3.79 GHz
RAM: 8.00 GB (7.79 GB usable)
System Type: 64-bit operating system, x64-based processor
Shotcut version Win 64, 21.10.17

@ddennedy
Copy link
Member

I was not able to reproduce this, and I tested it several times. Thank you for the good report. It would have been better if the MLT XML did not include unnecessary files (see playlist) and referenced the file Empty.png included in the zip. I will test it on some other OS and running in a debugger, which sometimes helps show a problem.

@chenx77
Copy link
Author

chenx77 commented Oct 28, 2021

I was not able to reproduce this, and I tested it several times. Thank you for the good report. It would have been better if the MLT XML did not include unnecessary files (see playlist) and referenced the file Empty.png included in the zip. I will test it on some other OS and running in a debugger, which sometimes helps show a problem.

You are right, the sample didn't crash Always, but it did some times. I removed unused files from Crash.mlt, and keep only two PNG files in the project, and insert the other one to the Timeline as well. Seems that increases the changce of crash. Here you are the Study.zip with two necessary PNGs.

Usually I double click the Crash.mlt to open the project.

Another observation, if I launch, load, play it in [Audio] layout many times, can reduce the orpportunity of happening. Or if there are less other applications running at same time, also reduce the crash. Guess maybe relate to RAM cunsumption.

And this is one of the 10 crashes recorded by Reliability Monitor:

Description
Faulting Application Path: C:\Program Files\Shotcut-211017\Shotcut\shotcut.exe

Problem signature
Problem Event Name: APPCRASH
Application Name: shotcut.exe
Application Version: 0.0.0.0
Application Timestamp: 616c6aaf
Fault Module Name: Qt5Core.dll
Fault Module Version: 5.15.2.0
Fault Module Timestamp: 00000000
Exception Code: c0000005
Exception Offset: 000000000020c358
OS Version: 10.0.19043.2.0.0.256.48
Locale ID: 2057
Additional Information 1: 85a5
Additional Information 2: 85a531d2212e57d6d482a06b27bb95e5
Additional Information 3: 5d40
Additional Information 4: 5d405da667987f3e3d52cbf66a3aff34

Extra information about the problem
Bucket ID: 8017f33abccfb132d2e817bf62ce0975 (1362364998043437429)

@ddennedy
Copy link
Member

Is it necessary to switch from Editing to Audio to cause the crash, or will it also occur if Shotcut starts up in Audio layout?

@chenx77
Copy link
Author

chenx77 commented Oct 28, 2021

Originally I thought that is a necessary step. But in the second test, it crashes without switching. Because already in Audio, as I exited the Shotcut in Audio state on last run.

@ddennedy
Copy link
Member

I was not able to reproduce after trying at least 10 times each across 4 different computers running Windows, Linux, M1 Mac, and Intel Mac. I also tested in a debugger in Linux several times. I also tested with and without Settings > Realtime turned on. Sometimes I switched layouts; other times I started in Audio layout.

@chenx77
Copy link
Author

chenx77 commented Oct 29, 2021

A nother wied guess, the crash is due to the differente version of Qt5Core.dll. As I cheked around 30 recent crashes, only one RM report pointing to StackHash_1516, and all other crashes related to Qt5Core.dll, version: 5.15.2.0. as invoked earlier and bellow.

And the Qt installed, independently, to my machine may confused the Shotcut?
Screenshot (688)

Crashed due to StackHash_1516

Problem signature
Problem Event Name: APPCRASH
Application Name: shotcut.exe
Application Version: 0.0.0.0
Application Timestamp: 616c6aaf
Fault Module Name: StackHash_1516
Fault Module Version: 10.0.19041.1288
Fault Module Timestamp: a280d1d6
Exception Code: c0000374
Exception Offset: PCH_65_FROM_ntdll+0x000000000009D8C4
OS Version: 10.0.19043.2.0.0.256.48
Locale ID: 2057
Additional Information 1: 1516
Additional Information 2: 151660b4d68a3493f7c8f29dd1fc212a
Additional Information 3: 7480
Additional Information 4: 7480b71e2743c5598b56ff5e06d0680c

Crashed due to Qt5Core.dll

Description
Faulting application name: shotcut.exe, version: 0.0.0.0, time stamp: 0x616c6aaf
Faulting module name: Qt5Core.dll, version: 5.15.2.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x00000000001ef73b
Faulting process ID: 0x5cd4
Faulting application start time: 0x01d7cb531d273298
Faulting application path: C:\Program Files\Shotcut-211017\Shotcut\shotcut.exe
Faulting module path: C:\Program Files\Shotcut-211017\Shotcut\Qt5Core.dll
Report ID: a67a639f-e9ab-4ce4-a9fa-29b5de316d73
Faulting package full name:
Faulting package-relative application ID:

@bmatherly
Copy link
Member

I also tried mulitiple times but did not experience a crash.

Usually I double click the Crash.mlt to open the project.

Is this necessary to cause a crash? Does it crash if you open the file in other ways (like drag to the screen or "file->open")?

@chenx77
Copy link
Author

chenx77 commented Oct 30, 2021

Usually I double click the Crash.mlt to open the project.

Is this necessary to cause a crash? Does it crash if you open the file in other ways (like drag to the screen or "file->open")?

It's not necessary. Other ways I open are 1) Lanuch Shoutcut first, then click on Recent Projects, like Crash.mlt; 2) Lanuch Shoutcut, then Open File from Toolbar and load Crash.mlt. No matter in each of 3 ways, [Play ►] will crash 99% times. Here is a screenshot video recorded the process that leads to a crash: https://drive.google.com/file/d/1pstgKE9mtqIKaHE5PP2FaOFIwzXgE633/view?usp=sharing.

If your machine is more powerful than mine, in terms of CPU, RAM etc. (see begining of this thread), or BIO settings, e.g. I have my PC "AESM Service: SGX Enabled", those may explain the difference.

@ddennedy
Copy link
Member

And the Qt installed, independently, to my machine may confused the Shotcut?

It will not unless you are trying to launch Shotcut from the tool's project, possibly from our SDK. Or, if any of the Qt SDKs are in any member of the %PATH% environment variable.

Are you able to use Shotcut in general without much crashing? Or, is this example project like the only thing you have ever done with Shotcut?

@chenx77
Copy link
Author

chenx77 commented Oct 30, 2021

And the Qt installed, independently, to my machine may confused the Shotcut?

It will not unless you are trying to launch Shotcut from the tool's project, possibly from our SDK. Or, if any of the Qt SDKs are in any member of the %PATH% environment variable.

No, when I use Shotcut, it's just the well-built Shotcut, I'm not touch Qt or its Creator at all. I noticed that Shotcut installs Qt5Core.dll into its own file structure (i.e., C:\Program Files\Shotcut\Qt5Core.dll), while Qt/Creator have their own a dozen Qt5Core.dll under Qt path, as a screenshot presented bellow, they shouldn't be mixed up, right?

Screenshot (691)

Are you able to use Shotcut in general without much crashing? Or, is this example project like the only thing you have ever done with Shotcut?

Yes, I'm able (using version Win 64, 21.10.17) to generate several decent videos with length of several minutes, without single crash. But when I try to explore more functionalities with layout [Audio], any of those successful projects crash immediately by Play. And that is the reason why I created an as small as possoble project Crash.mlt, to help you to identify the problem.

@ddennedy
Copy link
Member

Please download the Shotcut SDK for Windows from this page: https://shotcut.org/notes/windowsdev/

It contains a debug build of Shotcut with an integrated crash reporter for use with the MinGW runtime that we use (not MSVC). It is not an online reporter. Rather, when there is a crash, it writes the text file shotcut.RPT to the Shotcut program folder. Then, you can upload that here (might need to rename it .txt) or copy and paste its contents. You do not need to follow all of the directions on that page to make a custom build. You should be able to simply extract it and run shotcut.exe to run the debug build.

@chenx77
Copy link
Author

chenx77 commented Nov 1, 2021

Please download the Shotcut SDK for Windows from this page: https://shotcut.org/notes/windowsdev/

It contains a debug build of Shotcut with an integrated crash reporter for use with the MinGW runtime that we use (not MSVC). It is not an online reporter. Rather, when there is a crash, it writes the text file shotcut.RPT to the Shotcut program folder. Then, you can upload that here (might need to rename it .txt) or copy and paste its contents. You do not need to follow all of the directions on that page to make a custom build. You should be able to simply extract it and run shotcut.exe to run the debug build.

Here you are, the Report file shotcut.txt. The build is a bit harder to crash, but I still manage to crash it by shifting between [Audio] & [Editing], of course via [►].

@ddennedy
Copy link
Member

ddennedy commented Nov 1, 2021

Your log shows a crash inside Qt when Shotcut is updating a text label in its Audio Loudness scope. However, what is more interesting is that the function call backtrace between these two points shows a number of function calls within a UIAutomationCore.dll. I have never seen that before, and it is strange. This is some DLL that is specific to your computer environment that has hooked itself into the process. These kinds of system hooks are not supported as they can interfere with normal operations and introduce unknown variables. So, I am closing this as will not fix. Instead, you can try to fix your operating system environment or reinstall it. You can learn about this DLL here:
https://en.wikipedia.org/wiki/Microsoft_UI_Automation

@ddennedy ddennedy closed this as completed Nov 1, 2021
bmatherly added a commit that referenced this issue Nov 2, 2021
@bmatherly
Copy link
Member

bmatherly commented Nov 2, 2021

From this trace, I notice that QLable::setText() is called outside of the GUI thread.

> Qt5Widgets.dll!QLabel::setText
> shotcut.exe!AudioLoudnessScopeWidget::refreshScope
> shotcut.exe!ScopeWidget::refreshInThread

I do not know if that is causing this specific problem, but i changed it here to use the GUI thread: 6c8264b

@chenx77
Copy link
Author

chenx77 commented Nov 2, 2021

From this trace, I notice that QLable::setText() is called outside of the GUI thread.

> Qt5Widgets.dll!QLabel::setText
> shotcut.exe!**AudioLoudness**ScopeWidget::refreshScope
> shotcut.exe!ScopeWidget::refreshInThread

In deed! This can be proved by a test: whenever the [Audio Loudness] widget is switch on (yellow rectangle), the crash is inevitable, no matter in [Audio] or [Editing] (red oval) layout. If [Audio Loudness] is not present, no crash happens, even in [Audio] layout!
Screenshot (698)

@chenx77
Copy link
Author

chenx77 commented Nov 2, 2021

I do not know if that is causing this specific problem, but i changed it here to use the GUI thread: 6c8264b

This might fix the crash, hope to get a release containing this soon.

@ddennedy
Copy link
Member

ddennedy commented Nov 2, 2021

You can test this change with the nightly build here: https://github.com/mltframework/shotcut/actions/runs/1411352735

@chenx77
Copy link
Author

chenx77 commented Nov 2, 2021

You can test this change with the nightly build here: https://github.com/mltframework/shotcut/actions/runs/1411352735

Thank you! The reported crash no longer exist, the issue has been fixed by build 21.11.02. The original report didn't hit the major point, the problem is NOT at mode [Audio] or [Editing], but relys on if widget [Audio Loudness] is presented or not.

Thank you again, and suggest tag this report as FIXED.

@ddennedy
Copy link
Member

ddennedy commented Nov 2, 2021

Thank you for testing! This will be in the next release due by end of year (there is a possibility that 21.11 will be converted to 21.12 to be released in December instead of November).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants