Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0003000Dwarf FortressGeneralpublic2010-08-10 07:172020-10-05 15:36
dirkthedorf 
lethosor 
lowcrashalways
confirmedopen 
Mac (MacBook4.1)Mac OS X10.5.8
0.31.12 
 
0003000: Mac/OS X segfault when quitting game with graphics enabled
After having played in fortress mode, the Mac port of Dwarf Fortress will crash with the following error when attemped to quit using the title menu:
"~/Desktop/Dwarf Fortress/df: line 5: 16493 Segmentation fault ./dwarfort.exe logout"
Run Dwarf Fortress.
Play in fortress mode.
(Save world.)
Quit.
http://pastebin.com/FBVZJkiw [^]
No tags attached.
related to 0002617resolved Toady One Segfault on quit 
has duplicate 0005737resolved Footkerchief Error report when I try to quit from the main menu. 
has duplicate 0003697resolved Footkerchief Game Unexpectedly Quits on exit. 
Issue History
2010-08-10 07:17dirkthedorfNew Issue
2010-08-10 08:01FootkerchiefNote Added: 0011691
2010-08-10 08:01FootkerchiefRelationship addedrelated to 0002617
2012-02-16 08:30CespinarveNote Added: 0019794
2012-03-02 13:10dgliddenNote Added: 0020998
2012-03-31 10:34jrtomsicNote Added: 0021951
2012-03-31 12:21FootkerchiefIssue Monitored: Cespinarve
2012-03-31 12:21FootkerchiefIssue Monitored: dglidden
2012-03-31 12:21FootkerchiefNote Added: 0021953
2012-03-31 12:21FootkerchiefRelationship addedrelated to 0005737
2012-03-31 13:57dirkthedorfNote Added: 0021955
2012-03-31 20:42CespinarveNote Added: 0021968
2012-04-01 07:11dgliddenNote Added: 0021982
2012-04-01 09:05FootkerchiefAdditional Information Updatedbug_revision_view_page.php?rev_id=8178#r8178
2012-04-01 09:06FootkerchiefRelationship replacedhas duplicate 0005737
2012-04-01 09:07FootkerchiefSummarySegmentation fault when quitting (Mac) => Mac/OS X segfault when quitting game with graphics enabled
2014-11-25 16:28lethosorRelationship addedhas duplicate 0003697
2014-11-25 16:29lethosorNote Added: 0031187
2014-11-25 16:29lethosorAssigned To => lethosor
2014-11-25 16:29lethosorStatusnew => needs feedback
2014-11-30 13:10lethosorStatusneeds feedback => confirmed
2015-08-01 06:59lethosorNote Edited: 0031187bug_revision_view_page.php?bugnote_id=0031187#r13240
2015-08-01 07:01danarisNote Added: 0032945
2015-08-01 07:08danarisNote Edited: 0032945bug_revision_view_page.php?bugnote_id=0032945#r13242
2015-08-01 07:24lethosorNote Added: 0032946
2015-08-01 08:53lethosorNote Edited: 0032946bug_revision_view_page.php?bugnote_id=0032946#r13244
2015-08-03 19:41seanwessmithNote Added: 0032950
2015-08-03 19:42seanwessmithNote Edited: 0032950bug_revision_view_page.php?bugnote_id=0032950#r13248
2015-08-25 19:41lethosorNote Added: 0032999
2015-08-25 19:41lethosorDescription Updatedbug_revision_view_page.php?rev_id=13277#r13277
2015-08-25 19:42lethosorNote Edited: 0032999bug_revision_view_page.php?bugnote_id=0032999#r13279
2018-03-10 23:04polNote Added: 0037873
2018-03-10 23:05polNote Edited: 0037873bug_revision_view_page.php?bugnote_id=0037873#r15403
2020-10-05 15:36kiniryNote Added: 0040748

Notes
(0011691)
Footkerchief   
2010-08-10 08:01   
Congratulations on getting report # 3000.

The NSQuickDrawView thing is unrelated -- it was previously reported as 0002624.
(0019794)
Cespinarve   
2012-02-16 08:30   
I have the same segmentation fault every time I quit - it doesn't cause any problems or anything, but it is a thing that happens.
(0020998)
dglidden   
2012-03-02 13:10   
Same thing here - 10.7.3, DF 0.34.04
(0021951)
jrtomsic   
2012-03-31 10:34   
I'm getting a very similar issue. I've found that it's only happening when I'm using a tileset that has [GRAPHICS:YES] in the init.txt file. If I turn that off, the game quits without error.

Are you guys (cespinarve, dglidden, and dirkthedwarf) playing with a graphical tileset (eg phoebus, ironhand, lazy newb pack, masterwork, etc)?
(0021953)
Footkerchief   
2012-03-31 12:21   
Reminder sent to: Cespinarve, dglidden, dirkthedorf

Does this still occur with GRAPHICS:NO?
(0021955)
dirkthedorf   
2012-03-31 13:57   
While I cannot recall whether GRAPHICS were set to NO, I believe that they were since I rarely play with tilesets. I am unable to verify as I have since upgraded, but I can, however, say that the current version of Dwarf Fortress (0.34.07) quits without any error. Running Lion (10.7.3) on the same old MacBook4,1.
(0021968)
Cespinarve   
2012-03-31 20:42   
I have yet to have it recur, but I'm not using a tileset right now, and I'm not running the game for a long period of time before quitting (too busy at present).
(0021982)
dglidden   
2012-04-01 07:11   
I can't reproduce this with GRAPHICS:NO whereas with GRAPHICS:YES it happens every single time.
(0031187)
lethosor   
2014-11-25 16:29   
(edited on: 2015-08-01 06:59)
I can't reproduce this with GRAPHICS:YES in 0.40.16 or 0.40.18. Has anyone seen this occur in 0.40.xx?
Edit: Confirmed by someone else (I assume)

(0032945)
danaris   
2015-08-01 07:01   
(edited on: 2015-08-01 07:08)
I've also been experiencing this, and saved this crash log: http://topazgryphon.org/~tcollett/df/dfhack-crash.2015-08-01.txt [^]

Hopefully this can be of some help.

[Edit] The above is with PRINT_MODE:2D. I have reproduced it with PRINT_MODE:STANDARD, with DFHack disabled, and it produced a slightly different crash log: http://topazgryphon.org/~tcollett/df/df-crash.2015-08-01.txt [^]

(0032946)
lethosor   
2015-08-01 07:24   
(edited on: 2015-08-01 08:53)
For reference, just starting and quitting the game isn't enough to produce this crash (at least for me) - you have to do something that involves loading graphics first, e.g. starting a new arena.

Edit: It looks like the crash occurs when SDL_FreeSurface() is called on a surface that has already been freed. If I interpose SDL_FreeSurface and prevent the actual function from being called in this sort of situation, there are two more calls (not necessarily successive) with already-freed surfaces, and the crash does not occur.

(0032950)
seanwessmith   
2015-08-03 19:41   
(edited on: 2015-08-03 19:42)
Running Mac OS X 10.11 El Capitan, I have the NSQuickDrawView error when trying to start from the terminal.

(0032999)
lethosor   
2015-08-25 19:41   
(edited on: 2015-08-25 19:42)
As Footkerchief pointed out, that is 0002624, which is not related to this issue and can be fixed by upgrading to SDL 1.2.15.

(0037873)
pol   
2018-03-10 23:04   
(edited on: 2018-03-10 23:05)
Just to add another stone to the pile, this is still happening for me on MacOS 10.12.6. Graphics is enabled (though I am using the built-in graphics).

On quitting I get something like:

dwarfort.exe(61442,0x7fff9879b3c0) malloc: *** error for object 0x11e580ee0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

I suppose it isn't precisely a segfault, so maybe it's not the same thing, but it seems enough like it that this seemed like the right place.

(0040748)
kiniry   
2020-10-05 15:36   
This seems to still exist. I see it on 10.15.7 every time I quit 47.04. Here is a prefix of a crash report. Thread 0 is the culprit on cleanup.

Process: dwarfort.exe [46895]
Path: /Users/USER/*/dwarfort.exe
Identifier: dwarfort.exe
Version: ???
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Terminal [8962]
User ID: 502

Date/Time: 2020-10-05 15:30:53.726 -0700
OS Version: Mac OS X 10.15.7 (19H2)
Report Version: 12
Bridge OS Version: 4.6 (17P6610)
Anonymous UUID: 32F665C7-8A5B-4378-A833-2CE8089907AD

Sleep/Wake UUID: AB548F7B-AB87-40A0-82AF-4DFC1A8729B1

Time Awake Since Boot: 260000 seconds
Time Since Wake: 120000 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
dwarfort.exe(46895,0x10de80dc0) malloc: *** error for object 0x18aaf6e00: pointer being freed was not allocated
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff6bb0133a __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff6bbbde60 pthread_kill + 430
2 libsystem_c.dylib 0x00007fff6ba88808 abort + 120
3 libsystem_malloc.dylib 0x00007fff6bb7e50b malloc_vreport + 548
4 libsystem_malloc.dylib 0x00007fff6bb8140f malloc_report + 151
5 SDL 0x00000001026b45fe SDL_FreeSurface + 189
6 dwarfort.exe 0x0000000101373255 0x100000000 + 20394581
7 dwarfort.exe 0x000000010042c3ef 0x100000000 + 4375535
8 dwarfort.exe 0x0000000100955c9d 0x100000000 + 9788573
9 libsystem_c.dylib 0x00007fff6ba6313c __cxa_finalize_ranges + 319
10 libsystem_c.dylib 0x00007fff6ba63412 exit + 55
11 dwarfort.exe 0x00000001013ac3f8 0x100000000 + 20628472
12 com.apple.CoreFoundation 0x00007fff3193f7a3 ___CFXRegistrationPost1_block_invoke + 63
13 com.apple.CoreFoundation 0x00007fff3193f718 _CFXRegistrationPost1 + 372
14 com.apple.CoreFoundation 0x00007fff3193f384 ___CFXNotificationPost_block_invoke + 80
15 com.apple.CoreFoundation 0x00007fff3190f4fd -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1554
16 com.apple.CoreFoundation 0x00007fff3190e9a9 _CFXNotificationPost + 1351
17 com.apple.Foundation 0x00007fff33f8c786 -[NSNotificationCenter postNotificationName:object:userInfo:] + 59
18 com.apple.AppKit 0x00007fff2ebc34f3 -[NSApplication _postDidFinishNotification] + 312
19 com.apple.AppKit 0x00007fff2ebc3232 -[NSApplication _sendFinishLaunchingNotification] + 208
20 com.apple.AppKit 0x00007fff2ebc02f3 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 549
21 com.apple.AppKit 0x00007fff2ebbff38 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 688
22 com.apple.Foundation 0x00007fff33fb7a26 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 308
23 com.apple.Foundation 0x00007fff33fb7890 _NSAppleEventManagerGenericHandler + 98
24 com.apple.AE 0x00007fff32cbc203 0x7fff32caf000 + 53763
25 com.apple.AE 0x00007fff32cbb929 0x7fff32caf000 + 51497
26 com.apple.AE 0x00007fff32cb3bd7 aeProcessAppleEvent + 449
27 com.apple.HIToolbox 0x00007fff305867fa AEProcessAppleEvent + 54
28 com.apple.AppKit 0x00007fff2ebba2d1 _DPSNextEvent + 1547
29 com.apple.AppKit 0x00007fff2ebb8880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
30 com.apple.AppKit 0x00007fff2ebaa58e -[NSApplication run] + 658
31 dwarfort.exe 0x00000001013aca56 0x100000000 + 20630102