Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upCrash when minimizing or alt-tabbing to the desktop #24528
Comments
Night-Pryanik
added
<Crash / Freeze>
Info / User Interface
labels
Jul 29, 2018
This comment has been minimized.
This comment has been minimized.
|
Having same issue on Windows XP, build 7626, but only on version without tiles. Screen resize works good on both versions. |
This comment has been minimized.
This comment has been minimized.
|
You are right, tested again now and minimizing with the tiles version and it works. Screen resize is still pretty bad for me though. In the tiles version you can resize the window in the main menu and ingame, if you try during during character creation or while in the options menu it will blank the screen then crash. In the curses version you can resize the screen only in the main menu I think, ingame and in the submenus it blanks and crashes. |
This comment has been minimized.
This comment has been minimized.
DAOWAce
commented
Aug 3, 2018
•
|
Crashes when tabbing out of fullscreen as well. After the crash the size resets to default. Borderless doesn't like to be minimized either; it tries to keep itself the active window and may also crash when attempting to minimize it. The only way to play without it terminating is in regular windowed mode. I haven't had any real issues with resizing/minimizing there. I have had the screen blank on resize in the menu, but just activate a redraw (move selector) and it comes back fine. This is for the Tiles version. |
This comment has been minimized.
This comment has been minimized.
|
I get a crash if I resize or minimize the window on any screen other than the main menu. |
This comment has been minimized.
This comment has been minimized.
|
Can't confirm on latest experimental as of 07 February 2019, Windows 10 Pro x64, tiles, neither in fullscreen nor windowed mode. Is this still an issue for anyone? |
Night-Pryanik
added
the
(S1 - Need confirmation)
label
Feb 7, 2019
This comment has been minimized.
This comment has been minimized.
DAOWAce
commented
Feb 7, 2019
|
Still crashes when tabbing out in fullscreen on build #8505 But upon further testing, it only appears to do this under the d3d9 renderer. I haven't gotten it to crash with d3d11 in my limited testing. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, it seems that using d3d9 renderer indeed crashes the game. |
This comment has been minimized.
This comment has been minimized.
DSeyka
commented
Feb 7, 2019
Night-Pryanik
added
(S2 - Confirmed)
and removed
(S1 - Need confirmation)
labels
Feb 7, 2019
This comment has been minimized.
This comment has been minimized.
|
I took a few notes while debugging the problem. I don't have a fix... yet :) Ok, please bear with me this is a bit complex. Crash Repro
Restart the game; wait for the window to appear; then ALT-TAB: crash! Crash analysisFirst you need to compile SDL2 in debug mode to get all the symbols. Here the stack trace at time of crash:
Since we obviously don't have the DirextX source code, here's the assembly location (in
So basically RBX is some kind of class or structure; the code tries to get a pointer at offset 0x4118 from that structure and dereference it (so this value is expected to be a pointer) but that pointer is NULL so we get a crash. Checking what is RBX is pretty simple as the stack trace in D3D is small enough to backtrack visually. Moreover we have the source for SDL:
Here's the
Note: Now, RBX at time of crash:
As you can see the RBX register is Sadly the big offset (0x4118) is way outside of the publicly defined source and symbols for the So in these kind of cases, a good idea is usually to restart the program and see what actually changes this offset. Going from the startDirectX Device InitializationThe
And then the device is initialized in the same function using
Now, just after the above line has executed we set a breakpoint to capture any overwrite of the At some point after ALT-TABing the data-on-write breakpoint is triggered and leads to the following stack trace:
In
If we compare data ( Before:
With the big offset (we can see there is pointer there, so it's still present):
And after (the content at that memory address is 0 just after calling
From now on, all invocation on the renderer (that is every call made by SDL to directX) will fail with the following return code (from DirectX);
It happens this is the following code:
Which confirm that once the renderer is reset, there no point in continuing calling any API on it, simply because it's no more valid. Root Cause (Somewhat...)By reading the stack trace it is clear that the renderer is invalidated during the minimization of the Windows. This is in the CDDA code:
A bit before the crash in
The event is type 0x6 (type = 0x200 indicates it's a window event) which simply means the window is changing its size:
I did a bit of SDL logging by placing some breakpoints and here are the messages which transit into SDL before the crash:
It's pretty clear that when we are in fullscreen and we get out of the window, it is minimized and the renderer is invalidated. At this point I don't know if it is a normal behavior or not... (to be continued) |
This comment has been minimized.
This comment has been minimized.
Alicecomma
commented
Jul 2, 2019
|
Just chiming in: Settings > Graphics > Renderer = x
|


ranseur commentedJul 29, 2018
•
edited
Game version: 0.C-29754-g34eea34 (console) (build 7627, latest experimental)
Operating system: Windows 8.1 64bit
Tiles or curses: curses (but tiles still has problems with screen resizing)
Mods active: any
Expected behavior
No crash, minimizes/alt-tabs fine.
Actual behavior
Steps to reproduce the behavior
Launch the game then minimize the game or alt-tab to the desktop (alt-tabbing to other windows is fine).
Other notes
After the crash the terminal width and height returns to the defaults 80 and 24 regardless of what it was to before. (The game also crashes and behaves erratically when trying to resize the window)
The log doesn't produce anything useful.