Page 1 of 1

Crash when switching renderers

Posted: Sun Dec 09, 2018 6:55 am
by Graf Zahl
It now happened multiple times to me that when I switched from software to hardware I got a crash in MemcpyCommand::Execute.

Apparently some worker thread is left hanging, even after the software renderer has been taken down.

Re: Crash when switching renderers

Posted: Sun Dec 09, 2018 10:20 am
by dpJudas
I'm not able to reproduce this on master. Is this on some branch?

If the source of the problem is what you're describing, then the call stack of the main thread should be past the DrawerThreads::WaitForWorkers function when it crashes.

Re: Crash when switching renderers

Posted: Sun Dec 09, 2018 10:26 am
by Graf Zahl
I had it happen once on Master and today 3 times altogether on Texture_Cleanup, but those might be related to broken texture data having trashed some memory.
But the one time on Master was totally out of the blue.

Re: Crash when switching renderers

Posted: Sun Dec 09, 2018 10:28 am
by Rachael
I've had this happen to me before. The crash was so random, and I have experience with random crashes enough that I really didn't want to try and track down the exact cause of the issue to make a report.

Re: Crash when switching renderers

Posted: Sun Dec 09, 2018 10:44 am
by dpJudas
I need a call stack from the main thread next time someone experiences it. It could also be crashing due to it going out of bounds somehow, which overall is more likely as the variables controlling the worker threads are guarded by std::mutex and std::condition_variable.

Re: Crash when switching renderers

Posted: Mon Dec 10, 2018 5:30 am
by drfrag
Has happened to me several times with the legacy build and MinGW debug builds.

Unrelated but vid_rendermode can take weird values which causes funny effects when looking up and down.
Pushed a fix here:
https://github.com/drfrag666/gzdoom/com ... a2b7d37956

Re: Crash when switching renderers

Posted: Mon Dec 10, 2018 5:56 am
by Graf Zahl
Can you please make a PR from that commit? It's not that easy to cherry pick it out of another repository.

Re: Crash when switching renderers

Posted: Mon Dec 10, 2018 6:03 am
by Rachael

Code: Select all

git fetch https://github.com/drfrag/gzdoom legacy
git cherry-pick 3993aca50808d3e9156764a02d9c3ca2b7d37956
Not difficult - Cherry-picked as cbb5f8a0dc7c3b7facfb348672d09310b41bd289

Re: Crash when switching renderers

Posted: Mon Dec 10, 2018 6:38 am
by Graf Zahl
The problem is the fetch, it'd pollute the local data with everything from that other repo which I do not want in my local copy, especially if it's just go get access to a single commit.

Re: Crash when switching renderers

Posted: Tue Dec 11, 2018 4:34 am
by drfrag
Rachael wrote:Cherry-picked
Thanks. :wub:

With the command line that Rachael posted one should be able to fetch only one branch and there are other methods explained at Stack Overflow but i don't know if it's possible with TortoiseGit.

Re: Crash when switching renderers

Posted: Tue Dec 11, 2018 7:32 am
by Rachael
drfrag wrote:With the command line that Rachael posted one should be able to fetch only one branch and there are other methods explained at Stack Overflow but i don't know if it's possible with TortoiseGit.
Graf Zahl wrote:The problem is the fetch, it'd pollute the local data with everything from that other repo which I do not want in my local copy, especially if it's just go get access to a single commit.
Don't ask me. ¯\_(ツ)_/¯

I know what he's saying, but this is why you consolidate repositories if you're really worried about such things. Git is designed from the ground up to handle multiple workflows like this seamlessly. Unless your disk space is really really tight, this shouldn't even be a problem, and eventually Git cleans it up anyway.