Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0009762Dwarf FortressMiscellaneous Crashespublic2016-05-17 02:462021-03-16 19:11
alexchandel 
lethosor 
normalcrashalways
confirmedopen 
OS X10.11.4
0.43.02 
 
0009762: Dwarf Fortress immediately crashes when using system full screen toggle (green button) on OS X 10.10+
Dwarf Fortress immediately crashes whenever the window is maximized by clicking the standard green button in the corner of the window. Normally, the window would simply be resized to fullscreen. cropping or blacking what it needed to. But dwarf fortress immediately crashes. There is no opportunity to save the game state. No other OS X application does this. This crash is replicable and occurs 100% of the time.
1. Run dwarf fortress on OS X.
2. Click the green "Full Screen" icon in the corner of the window.
3. Dwarf fortress crashes immediately.
This happened to me the very first time I played DF, after spending hours in the game. All progress was lost. I've never seen a game with such a blatant, user-accessible crash.
Probable Quick Fix, SDL
has duplicate 0009912resolved lethosor game crash going full screen 
has duplicate 0011152resolved lethosor Input lags on fullscreen 
related to 0009962confirmed lethosor Window disappears when clicking on upper edge of title bar (32-bit DF only) 
Issue History
2016-05-17 02:46alexchandelNew Issue
2016-05-17 16:51lethosorNote Added: 0035208
2016-05-17 16:51lethosorAssigned To => lethosor
2016-05-17 16:51lethosorStatusnew => needs feedback
2016-05-18 05:28alexchandelNote Added: 0035225
2016-05-18 05:28alexchandelStatusneeds feedback => assigned
2016-05-18 05:33alexchandelNote Added: 0035226
2016-05-18 06:39Dame de la LicorneNote Added: 0035227
2016-05-18 06:40Dame de la LicorneNote Edited: 0035227bug_revision_view_page.php?bugnote_id=0035227#r14201
2016-05-24 14:33alexchandelNote Added: 0035287
2016-05-24 15:52Dame de la LicorneNote Added: 0035288
2016-05-30 17:14lethosorNote Added: 0035338
2016-05-30 17:16lethosorNote Edited: 0035338bug_revision_view_page.php?bugnote_id=0035338#r14249
2016-07-23 19:26lethosorNote Added: 0035698
2016-07-23 19:26lethosorStatusassigned => needs feedback
2016-08-09 11:45lethosorRelationship addedrelated to 0009962
2016-09-09 10:57lethosorNote Added: 0035862
2016-09-09 10:57lethosorStatusneeds feedback => confirmed
2016-09-09 10:58lethosorRelationship addedhas duplicate 0009912
2016-09-11 11:58lethosorSummaryDwarf Fortress immediately crashes when maximizing window on OS X => Dwarf Fortress immediately crashes when using system full screen toggle (green button) on OS X 10.10+
2016-10-26 12:52alexchandelNote Added: 0036000
2016-10-26 13:40alexchandelNote Added: 0036004
2017-04-29 11:56lethosorNote Added: 0036478
2017-05-01 18:20lethosorNote Added: 0036488
2017-05-12 09:55alexchandelNote Added: 0036525
2017-05-12 09:55alexchandelTag Attached: SDL
2017-05-17 14:05lethosorNote Added: 0036534
2017-11-11 16:54alexchandelNote Added: 0036862
2017-12-16 20:51alexchandelNote Added: 0037337
2017-12-16 21:41lethosorNote Added: 0037339
2017-12-16 21:41lethosorTag Attached: Probable Quick Fix
2018-01-06 21:28alexchandelNote Added: 0037538
2018-01-06 22:29lethosorNote Added: 0037539
2018-01-06 22:29lethosorNote Edited: 0037539bug_revision_view_page.php?bugnote_id=0037539#r15200
2018-01-07 13:01alexchandelNote Added: 0037543
2018-01-07 14:42lethosorNote Added: 0037547
2018-02-19 23:49jecowaNote Added: 0037811
2018-02-23 00:47jecowaNote Edited: 0037811bug_revision_view_page.php?bugnote_id=0037811#r15376
2018-02-23 00:50jecowaNote Edited: 0037811bug_revision_view_page.php?bugnote_id=0037811#r15377
2018-02-23 01:10jecowaNote Edited: 0037811bug_revision_view_page.php?bugnote_id=0037811#r15378
2019-01-06 03:18alexchandelNote Added: 0039089
2019-01-06 03:19alexchandelNote Edited: 0039089bug_revision_view_page.php?bugnote_id=0039089#r15896
2019-01-06 03:20alexchandelNote Edited: 0039089bug_revision_view_page.php?bugnote_id=0039089#r15897
2019-10-05 13:55lethosorRelationship addedhas duplicate 0011152
2021-03-09 20:30jecowaNote Added: 0040967
2021-03-16 19:11lethosorNote Added: 0040979

Notes
(0035208)
lethosor   
2016-05-17 16:51   
Does the fix in 0005260 work?
Sorry about this :/. Toady uses an older version of OS X than what you're using, so if that is the issue, he wouldn't be experiencing this.
(0035225)
alexchandel   
2016-05-18 05:28   
... Sort of. It still crashes sometimes, for example 100% of the time during the opening movie, but not 100% of the time for the game.

However, it's not ideal. It produces a buggy fullscreen, with the window chrome still drawn around the window. It appears that dwarffortress realizes that it's in fullscreen, and redraws itself in a new window inside the fullscreen space. This means that repeatedly clicking the green button in the window chrome will repeatedly produce other (non-functional, blank, completely white) fullscreen window that can never be removed. Moreover, because dwarffortress is still drawing itself in this small subwindow, it can now never be taken out of fullscreen mode.

All of this might be fixed by building against the correct version of SDL. Could this happen sooner? I install via Homebrew, the OS X package manager, and unless a maintainer here submits a PR updating the package formula, it'll probably take an additional few weeks for even that to get updated :\
(0035226)
alexchandel   
2016-05-18 05:33   
Actually, it turns out that even trying to bring it back to normal, after having maximized it, by clicking the green button sometimes crashes it during normal gameplay. Man, I feel like I'm walking on broken glass with this window chrome.
(0035227)
Dame de la Licorne   
2016-05-18 06:39   
(edited on: 2016-05-18 06:40)
I just tested this (simply to confirm that it does the same thing on my OSX machine). I don't normally use the green button to full-screen my game, but if you start with the window at a small size, then double-click on the DF title bar (the one that contains the three buttons), it will become "full-screen" (it's not really, but it adjusts to the computer screen size) without crashing.

Note: I have my init file set to allow in-game window resizing.

Does that work for you?

(0035287)
alexchandel   
2016-05-24 14:33   
It does, but that's the same as just resizing the window as large as possible. The window chrome is still visible however, as is the menu bar. And other programs below it are free to open popups/panels, which are displayed on top of dwarf fortress.

OSX's fullscreen mode is special, and should be supported. It essentially gives a separate desktop to the program, with no window chrome, menu bar, or other programs' windows. Distraction-free dwarf fortress is the goal, anyways.

Dame, were you able to confirm the fullscreen crash, and the crash & glitches with the swapped-in-place SDL framework?
(0035288)
Dame de la Licorne   
2016-05-24 15:52   
I did confirm the fullscreen crash, but haven't attempted to reproduce the SDL-related stuff.
(0035338)
lethosor   
2016-05-30 17:14   
(edited on: 2016-05-30 17:16)
It sounds like this is an SDL issue, and we really can't fix SDL. I'm surprised that SDL 1.2.15 is still crashing, as most people have reported that it works just fine. If it really is, there's not much we can do here, unless Toady decides to update to SDL 2, which would be a lot of work.

(0035698)
lethosor   
2016-07-23 19:26   
Has this changed in 0.43.05?
(0035862)
lethosor   
2016-09-09 10:57   
Confirmed in 0.43.05 with PRINT_MODE:STANDARD.
(0036000)
alexchandel   
2016-10-26 12:52   
Confirmed in 0.43.05 with PRINT_MODE:STANDARD on macOS 10.12.0.

Note that PRINT_MODE:STANDARD is still necessary on macOS 10.12 because PRINT_MODE:2D uses 57% CPU, which is unacceptable.

You should really consider updating to SDL 2, it has perfect support for OSX's fullscreen. Is there are crash log somewhere I can upload for you to fix this?
(0036004)
alexchandel   
2016-10-26 13:40   
Crash confirmed as well with PRINT_MODE:VBO, PRINT_MODE:SHADER, PRINT_MODE:PARTIAL:0, PRINT_MODE:PARTIAL:1, PRINT_MODE:PARTIAL:2, and PRINT_MODE:FRAME_BUFFER.

In short, every mode but 2D. And PRINT_MODE:2D is basically unusable due to its massive CPU usage WHEN PAUSED.
(0036478)
lethosor   
2017-04-29 11:56   
Just a note: holding down "alt" when pressing the green button makes the window as large as possible without entering full-screen mode (similar to double-clicking the title bar).
(0036488)
lethosor   
2017-05-01 18:20   
Mifki has put together an SDL build that seems to fix this, at least for him and me: https://www.dropbox.com/s/vobjcytkiguxky9/SDL.framework.zip?dl=0 [^]

(Replace libs/SDL.framework with this one)
(0036525)
alexchandel   
2017-05-12 09:55   
Mifki's SDL build fixes this issue. I notice it opts out of the "resize to fullscreen" animation, so I wonder if that animation influenced the crash.
(0036534)
lethosor   
2017-05-17 14:05   
It doesn't have anything to do with the animation - on my end, the window animates (somewhat) but the contents don't until it reaches its final size, which is also the case when maximizing the window with "alt" (with and without mifki's SDL build).
(0036862)
alexchandel   
2017-11-11 16:54   
Any chance of Mifki's SDL build making it into the upcoming version of DF?
(0037337)
alexchandel   
2017-12-16 20:51   
This is broken in 44.02 in a different way. Now, clicking the fullscreen button in anything other than PRINT_MODE:2D (which is unusable, as it requires 50%-100% CPU to update the screen vs <10% CPU for other modes) causes DF to resize (as though the alt key were held), not enter fullscreen. Hitting it a second time usually moves it to a fullscreen space, but I can't return my window to its original size, which is moderately annoying.

With some PRINT_MODE values, like STANDARD, hitting the green button spawns an additional blank fullscreen window that can't be closed.

Can't Toady just bundle Mifki's SDL build?
(0037339)
lethosor   
2017-12-16 21:41   
The SDL libraries included in 0.43.05 and 0.44.02 are identical. Maybe the behavior changes depending on your OS version or just randomly.

I'll tag this issue to make it more obvious that it's a simple enough change. There are obviously security concerns with including random files from Dropbox (there's no indication that the one I linked to is from Mifki), so Toady might want to verify where it came from first.
(0037538)
alexchandel   
2018-01-06 21:28   
That's very perplexing then. I'll have to check again when I can redownload it, but IIRC, diff claimed the 0.43.05 and 0.44.02 SDL binaries differed, and only 0.44.02 had the bizarre behavior.

Is https://github.com/rofl0r/df-libgraphics/tree/0_43_05_official [^] still the latest graphics code? I almost want to update it to SDL2 myself...
(0037539)
lethosor   
2018-01-06 22:29   
I've found that https://github.com/svenstaro/dwarf_fortress_unfuck [^] is usually kept more up-to-date, but neither is official. Note that you cannot use 0.43.05 libgraphics with 0.44 because of new keybindings.

(0037543)
alexchandel   
2018-01-07 13:01   
Nice, dwarf_fortress_unfuck has a 0.44.03 commit. The CMakeLists mentions Linux, but is the g_src the same for Windows and macOS? The macOS downloads don't include any source.
(0037547)
lethosor   
2018-01-07 14:42   
The same g_src is used on all platforms, but it's only distributed in the Linux packages because that's the only platform where you could compile your own libgraphics and have DF use it.
(0037811)
jecowa   
2018-02-19 23:49   
(edited on: 2018-02-23 01:10)
Just a note that Mifki's universal SDL library causes a crash when exiting full-screen mode. Tested in OSX 10.6, 10.7, and 10.8 using both 32-bit and 64-bit Dwarf Fortress, and it crashed every time when trying to exit full-screen mode.

Edit: Also in 10.12 Sierra, It still causes crashes when exiting from full screen mode, but it also causes full screen to look odd – the window border is still visible but it's the only window visible. It does fix the green-button crash that occurs while in Standard print mode, though.

Edit 2: Just tested in 10.10 Yosemite. It was the same as in Sierra, but there was not an issue with the green button in Standard print mode. It maximized the Dwarf Fortress Window. I exited Dwarf Fortress and relaunched a couple more times to try to get the green button to make it crash, but it just reliably maximized the window like it does in 10.6 Snow Leopard, 10.7 Lion, and 10.8 Mountain Lion.

(0039089)
alexchandel   
2019-01-06 03:18   
(edited on: 2019-01-06 03:20)
Just tested on 10.14.2 Mojave on a vanilla OS reinstallation, in STANDARD and TWBT modes.

The default SDL bundle still has erratic maximizing and restoring. The green button stretches the window to fill the desktop, rather expanding it to its own desktop. Clicking it again expands it to a new desktop in an extremely glitchy fashion, where the original desktop is completely occluded by a blank window. There is no way to remove this.

Mifki's SDL bundle works perfectly, both entering and exiting fullscreen. No window border is visible in fullscreen. Is it possible the crashes you saw with it were caused by something else?

(0040967)
jecowa   
2021-03-09 20:30   
I'm not having this issue. Tested with 0.43.02, 0.43.05, and 0.47.05 in Mac OS X 10.13 High Sierra. The green button makes it enter and exit full screen in both 2D and STANDARD print modes. Tested from the main menu and from the Object Testing Arena.

They worked for me in 10.14 Mojave too, except DF 0.43.02 doesn't launch at all for me on 10.14 Mojave.

[code]
...copying shared history...dyld: Library not loaded: /usr/X11R6/lib/libfreetype.6.dylib
  Referenced from: /Applications/DF v0.43.02/libs/SDL_ttf.framework/Versions/A/SDL_ttf
  Reason: image not found
[/code]

Is the full screen crash from STANDARD Print_Mode still an issue?
(0040979)
lethosor   
2021-03-16 19:11   
The SDL version that DF uses hasn't changed, to my knowledge. Are you using unmodified vanilla downloads?