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

Pencil2D crashing after deleting sound layer #1659

Closed
Jose-Moreno opened this issue Aug 26, 2021 · 11 comments · Fixed by #1731
Closed

Pencil2D crashing after deleting sound layer #1659

Jose-Moreno opened this issue Aug 26, 2021 · 11 comments · Fixed by #1731
Assignees
Labels
Bug Crash Not Our Bug Caused by a bug in a software other than Pencil2D Sound Windows

Comments

@Jose-Moreno
Copy link
Member

Jose-Moreno commented Aug 26, 2021

Issue Summary

Pencil2D 0.6.6 nightly versions are crashing after deleting a sound layer

Expected Results

Moving or even touching the playhead shouldn't lead to the app crashing.

Steps to reproduce

  1. File > Import > Sound > Create Layer > Load a sound file (format doesn't matter. I tested WAV & MP3's of different lengths)
  2. Once loaded and the layer is created click on the playhead and be sure to move it at least one frame to the right (or any frames as long as it's been moved) Note: It seems even just clicking on the playhead on the first frame will allow the app to crash after the layer has been deleted but to be sure the event is registered move the playhead
  3. Now delete the layer (doesn't matter if you use the buttons on the timeline or the delete layer action menu option)
  4. It will crash 100%

System Information

Nightly Build Aug 12 2021

commit: d2d8907
date: 2021-08-12_16:58:31

Operating System: Windows 10 Version 2009
CPU Architecture: x86_64
Qt Version: 5.15.2

@davidlamhauge
Copy link
Contributor

I've downloaded the Nightly build Aug 12 2021, and tried several times. I can't get it to crash. The same goes for the master branch.
Maybe I don't know what the 'playhead' is? I've tried to press on the line with framenumbers, where you can scroll your animation, I've tried the 'PLAY'-button and I've tried the button to turn the speaker on/off. Nothing can make the app crash so far?
What is the 'playhead'?

@Jose-Moreno
Copy link
Member Author

Jose-Moreno commented Sep 4, 2021

@davidlamhauge Hi David. Playhead, scrubber or frame indicator is the vertical red bar on the timeline. I personally can crash it with the reproduction steps everytime and I submitted this ticket mainly because two other users in the discord server complained about the same issue and I began to investigate the problem.

It could be a problem specific to our Windows version, which I just noticed it's wrongly reported in the about panel since I have version 20H2 and not 2009 🤔

@davidlamhauge
Copy link
Contributor

Thanks @Jose-Moreno . I just tested it again, and still no crash. I have Windows 10, version 21H1, so it migth be the version. No matter what, I can't reproduce the crash.

@J5lx
Copy link
Member

J5lx commented Oct 18, 2021

I just realised I still have 2009 (which, for the record, is just another name for 20H2) on my old laptop, so I gave this a try but I still couldn’t make it crash. There must be some other reason this happens.

@Jose-Moreno
Copy link
Member Author

@J5lx This is still happening on the latest nightly (just tested) I can very easily crash the software by following the steps verbatim.

Here are some additional conditions to test this, however note that none of these matter in my case. The app will still crash 100% of the time.

  1. Make sure that you just opened Pencil2D
  2. The document file you're using is the one created automatically by the application.
  3. Do not save, just use the unnamed default and follow the steps.
  4. Try out with File > Import > MovieAudio instead of File > Import > Sound. Crash.
  5. Try import/create the sound/layer on a different frame. The app still crashes.
  6. Try again, now save the file after importing the audio. Same result.
  7. Try playing back the audio several times, but then when you stop move the playback by hand agan. App crashes (if you don't move it deleting the layer won't crash the program)

I've just tested every troubleshooting item. I noticed that the trigger is moving the playback by hand. If you don't do that, deleting the sound file won't crash the app.

@chchwy
Copy link
Member

chchwy commented Oct 22, 2021

Can't replicate, either. will try again later on.

@MrStevns
Copy link
Member

Hmm... can't seem to replicate either...

tested with Nightly Build Oct 22 2021
commit: 34ea916
date: 2021-10-22_14:41:53

Would you mind uploading the crash log you get?

@Jose-Moreno
Copy link
Member Author

@MrStevns @chchwy Hey. I showed this issue to @scribblemaniac in a debugging session we had last monday night on EST timezone. I ran the latest master in Qt, built it, go through the steps and crashed it sucessfully every single time.

He commented on his experience with the debugging session in the #general-development channel on the discord server but I haven't seen anyone answer that so you might want to read his account as well. https://discord.com/channels/342369662710972417/342670204351938562/899878433562177556

As for logs I can share a screenshot of the stack trace we got that day. Basically it's as he explained, the SoundPlayer() object is being destroyed twice leading to a SEGFAULT.

image
image
image

Additionally here are some logs for the debugging session directly from the event viewer.

One without the faulting module
image

And the only one that reported said module during
image

@chchwy
Copy link
Member

chchwy commented Oct 25, 2021

One question: why the LayerSound destructor is called twice?

This is how the callstack should look like when deleting a sound layer.
Callstack

@scribblemaniac
Copy link
Member

One question: why the LayerSound destructor is called twice?

I think you're barking up the wrong tree. Here's what I get when I set a breakpoint in SoundPlayer::~SoundPlayer:
Screenshot of Call Stack

Notice in both my screenshot and Jose's, the "two calls" are on different lines. Likely it has something to do how c++ handles deleting member objects and calls to the parent class's destructor (ex. perhaps in the compiled code it is requires a separate call, but it still resolves to the destructor since there is no corresponding line in the source code).

@J5lx J5lx self-assigned this Oct 20, 2022
@J5lx J5lx added Windows Not Our Bug Caused by a bug in a software other than Pencil2D labels Oct 20, 2022
@J5lx J5lx linked a pull request Oct 20, 2022 that will close this issue
@Jose-Moreno
Copy link
Member Author

I just want to say thank you to everyone that discussed, tested and worked on fixing this. I can confirm that on the current Windows nightly build for November 8th, this issue no longer happens 😄 🎉

@J5lx J5lx moved this to Closed in Bug Fix Priority Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Crash Not Our Bug Caused by a bug in a software other than Pencil2D Sound Windows
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

6 participants