Intermittent crash in [NSPathControl mouseDown:] around `setHighlighted:`

I keep getting a particular type of crash report for my macOS app (FAF) that I cannot figure out.

Here's the top of the stack trace which all reports have in common:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib   … objc_msgSend + 29
1   com.apple.AppKit  … -[NSPathControl _performDragOfCell:fromMouseDown:] + 130
2   com.apple.AppKit  … -[NSPathControl mouseDown:] + 300
3   com.apple.AppKit  … -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961

What I figured out so far:

  • Is triggered by a click or double click on a segment of the NSPathControl.
  • For some users it has been happening more than once, but not often enough for me to figure out what's behind it.
  • I have not been able reproduce it even once.
  • Leads to a "Segmentation fault: 11"
  • Happens in macOS versions from at least 10.8 until the most current (11.4).
  • In both Intel and ARM code.
  • The call stack does not show any of my own code involved.
  • The app's other threads are all idle.
  • Some reports do not list any non-Apple extensions or dylibs as far as I can tell.

When I googled "crash NSPathControl setHighlighted", I could only find a single other mention of it, but that crash even happened in Finder, on OSX 10.8.1. The person reporting it had quite a few other system extensions loaded but eventually figured out that it got fixed when he changed his Wacom tablet's behavior from not issuing a triple click any more.

I tried to create triple clicks, along with combined drags, even using SteerMouse to have a triple click event generated by a separate mouse button, but to no avail.

Has anyone else seen this type of crash? Any idea what may be behind this?

I have two complete crash reports (with only some privacy related lines removed at the top) uploaded here:

  • Still getting these occasionally, including macOS 12.2.

    I just realize that the aforementioned crashes in 10.8 were actually more than one separate crashes in Finder, see http://www.applephoon.com/Finder-path-bar-makes-finder-crash-thread-75359-1-1.html

Add a Comment

Replies

One thing I found that is not right: I am setting the doubleClick action handler in code, but I forgot to also set the control's target property. Still, when I run the code in the debugger, the action handler gets called even without having assigned the target.

So I wonder if that might be the cause of the issue. But if the responder chain was temporarily changed so that the action handler would get called on an object that doesn't implement the action, then I should get an exception about the missing selector (which is pathCellDoubleClicked: in my case), right? But that's not the case as far as I can tell, so I guess the unset target is not the cause here. Or am I wrong?

  • In hindsight, setting the target property has not helped to prevent this crash, BTW.

Add a Comment