Skip to content

Crash in rendering code when double or triple clicking after a lot of uptime #419

@jansol

Description

@jansol

Not sure what exact circumstances cause this, but a file has been open in xi-mac for a long time (days) it seems to inevitably go into a state where double or triple clicking somewhere in the text view causes the frontend to crash. I haven't gotten around to reproducing the crash with a build connected to the Xcode debugger but here's a trace from the macOS crash report:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   io.xi-editor.XiEditor.Editor  	0x00000001030ebc82 specialized EditView.render(_:dirtyRect:) + 14066 (StyleMap.swift:280)
1   io.xi-editor.XiEditor.Editor  	0x00000001030e5399 protocol witness for TextPlaneDelegate.render(_:dirtyRect:) in conformance EditView + 9
2   io.xi-editor.XiEditor.Editor  	0x00000001030b24cf specialized TextPlaneLayer.draw(in:pixelFormat:forLayerTime:displayTime:) + 607
3   io.xi-editor.XiEditor.Editor  	0x00000001030b14c1 @objc TextPlaneLayer.draw(in:pixelFormat:forLayerTime:displayTime:) + 49
4   com.apple.QuartzCore          	0x00007fff36b79dee CAOpenGLLayerDraw(CAOpenGLLayer*, double, CVTimeStamp const*, unsigned int) + 1974
5   com.apple.QuartzCore          	0x00007fff36b793ca -[CAOpenGLLayer _display] + 579
6   com.apple.AppKit              	0x00007fff29420b97 -[NSOpenGLLayer display] + 240
7   com.apple.QuartzCore          	0x00007fff36adc258 CA::Layer::display_if_needed(CA::Transaction*) + 634
8   com.apple.QuartzCore          	0x00007fff36aca4cb CA::Context::commit_transaction(CA::Transaction*) + 319
9   com.apple.QuartzCore          	0x00007fff36ac9da8 CA::Transaction::commit() + 576
10  com.apple.QuartzCore          	0x00007fff36ac9ab4 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 66
11  com.apple.CoreFoundation      	0x00007fff2bb729cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
12  com.apple.CoreFoundation      	0x00007fff2bb72902 __CFRunLoopDoObservers + 452
13  com.apple.CoreFoundation      	0x00007fff2bb13d84 CFRunLoopRunSpecific + 523
14  com.apple.HIToolbox           	0x00007fff2adaaab5 RunCurrentEventLoopInMode + 293
15  com.apple.HIToolbox           	0x00007fff2adaa7eb ReceiveNextEventCommon + 618
16  com.apple.HIToolbox           	0x00007fff2adaa568 _BlockUntilNextEventMatchingListInModeWithFilter + 64
17  com.apple.AppKit              	0x00007fff29065363 _DPSNextEvent + 997
18  com.apple.AppKit              	0x00007fff29064102 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
19  com.apple.AppKit              	0x00007fff2905e165 -[NSApplication run] + 699
20  com.apple.AppKit              	0x00007fff2904d8a3 NSApplicationMain + 780
21  io.xi-editor.XiEditor.Editor  	0x0000000103096559 main + 9 (AppDelegate.swift:80)
22  libdyld.dylib                 	0x00007fff58d65ed9 start + 1

Given how long the issue takes to manifest itself it might well be caused some endless source of Fun such as losing our rendering context during sleep mode.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions