Bug 1880582 Comment 114 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Here's the NSWindow object being closed (the one that triggers the crash on a call to `-[NSWindow windowNumber]`). This happens before the events in comment #112 and comment #113.

```
(Thu Oct 17 11:42:54 2024) /Applications/Firefox Nightly.app/Contents/MacOS/firefox[77846] MainThread[0x1078cc240] Hook.mm: [NSWindow close]: self <ToolbarWindow: 0x138c7c100>
    (hook.dylib) PrintStackTrace() + 0x68
    (hook.dylib) -[NSWindow(MethodSwizzling) NSWindow_close] + 0x8f
    (XUL) nsCocoaWindow::DestroyNativeWindow() + 0x95
    (XUL) nsCocoaWindow::Destroy() + 0x89
    (XUL) mozilla::AppWindow::Destroy() + 0x1e5
    (XUL) mozilla::AppWindow::RequestWindowClose(nsIWidget*) + 0x1ec
    (XUL) mozilla::AppWindow::WidgetListenerDelegate::RequestWindowClose(nsIWidget*) + 0x1c
    (XUL) -[WindowDelegate windowShouldClose:] + 0x29
    (AppKit) __19-[NSWindow __close]_block_invoke + 0xc6
    (AppKit) -[NSWindow __close] + 0x1ad
    (AppKit) -[NSApplication(NSResponder) sendAction:to:from:] + 0x151
    (AppKit) -[NSControl sendAction:to:] + 0x56
    (AppKit) __26-[NSCell _sendActionFrom:]_block_invoke + 0x83
    (AppKit) -[NSCell _sendActionFrom:] + 0xab
    (AppKit) -[NSButtonCell _sendActionFrom:] + 0x60
    (AppKit) __29-[NSButtonCell performClick:]_block_invoke + 0x40
    (AppKit) -[NSButtonCell performClick:] + 0x24d
    (hook.dylib) invocation function for block in after_enumerateWithOptions(objc_object*, unsigned long, void (objc_object*, unsigned long, signed char*) block_pointer) + 0x5f
    (CoreFoundation) __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 0xc
    (CoreFoundation) __CFRunLoopDoBlocks + 0x18e
    (CoreFoundation) __CFRunLoopRun + 0x385
    (CoreFoundation) CFRunLoopRunSpecific + 0x22d
    (CoreFoundation) CFRunLoopRun + 0x28
    (hook.dylib) after_enumerateWithOptions(objc_object*, unsigned long, void (objc_object*, unsigned long, signed char*) block_pointer) + 0x42b
    (hook.dylib) -[NSObject(NSArraySwizzling) __NSArrayM_enumerateObjectsWithOptions:usingBlock:] + 0x5d
    (AppKit) -[_NSTrackingAreaAKManager _updateActiveTrackingAreasForWindowLocation:modifierFlags:] + 0x6f3
    (hook.dylib) -[NSObject(_NSTrackingAreaAKManagerSwizzling) _NSTrackingAreaAKManager__updateActiveTrackingAreasForWindowLocation:modifierFlags:] + 0xba
    (AppKit) __58-[_NSTrackingAreaAKManager _activeTrackingAreasNeedUpdate]_block_invoke + 0x13e
    (hook.dylib) Hooked_activeTrackingAreasNeedUpdate_block_invoke(_activeTrackingAreasNeedUpdate_literal*) + 0xba
    (AppKit) ___NSMainRunLoopPerformBlockInModes_block_invoke + 0x19
    (hook.dylib) Hooked____NSMainRunLoopPerformBlockInModes_block_invoke(_perform_block_literal*) + 0x74
    (CoreFoundation) __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 0xc
    (CoreFoundation) __CFRunLoopDoBlocks + 0x18e
    (CoreFoundation) __CFRunLoopRun + 0x385
    (CoreFoundation) CFRunLoopRunSpecific + 0x22d
    (HIToolbox) RunCurrentEventLoopInMode + 0x124
    (HIToolbox) ReceiveNextEventCommon + 0xc9
    (HIToolbox) _BlockUntilNextEventMatchingListInModeWithFilter + 0x42
    (AppKit) _DPSNextEvent + 0x370
    (AppKit) -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 0x4f9
    (XUL) -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 0x7c
    (AppKit) -[NSApplication run] + 0x25b
    (XUL) -[GeckoNSApplication run] + 0x42
    (XUL) nsAppShell::Run() + 0x13e
    (XUL) nsAppStartup::Run() + 0x3c
    (XUL) XREMain::XRE_mainRun() + 0x72e
    (XUL) XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) + 0x34d
    (XUL) XRE_main(int, char**, mozilla::BootstrapConfig const&) + 0xb1
    (firefox) main + 0x22f
    (dyld) start + 0x775
```
Here's the NSWindow object being closed (the one that, after it's deleted, triggers the crash on a call to `-[NSWindow windowNumber]`). This happens before the events in comment #112 and comment #113.

```
(Thu Oct 17 11:42:54 2024) /Applications/Firefox Nightly.app/Contents/MacOS/firefox[77846] MainThread[0x1078cc240] Hook.mm: [NSWindow close]: self <ToolbarWindow: 0x138c7c100>
    (hook.dylib) PrintStackTrace() + 0x68
    (hook.dylib) -[NSWindow(MethodSwizzling) NSWindow_close] + 0x8f
    (XUL) nsCocoaWindow::DestroyNativeWindow() + 0x95
    (XUL) nsCocoaWindow::Destroy() + 0x89
    (XUL) mozilla::AppWindow::Destroy() + 0x1e5
    (XUL) mozilla::AppWindow::RequestWindowClose(nsIWidget*) + 0x1ec
    (XUL) mozilla::AppWindow::WidgetListenerDelegate::RequestWindowClose(nsIWidget*) + 0x1c
    (XUL) -[WindowDelegate windowShouldClose:] + 0x29
    (AppKit) __19-[NSWindow __close]_block_invoke + 0xc6
    (AppKit) -[NSWindow __close] + 0x1ad
    (AppKit) -[NSApplication(NSResponder) sendAction:to:from:] + 0x151
    (AppKit) -[NSControl sendAction:to:] + 0x56
    (AppKit) __26-[NSCell _sendActionFrom:]_block_invoke + 0x83
    (AppKit) -[NSCell _sendActionFrom:] + 0xab
    (AppKit) -[NSButtonCell _sendActionFrom:] + 0x60
    (AppKit) __29-[NSButtonCell performClick:]_block_invoke + 0x40
    (AppKit) -[NSButtonCell performClick:] + 0x24d
    (hook.dylib) invocation function for block in after_enumerateWithOptions(objc_object*, unsigned long, void (objc_object*, unsigned long, signed char*) block_pointer) + 0x5f
    (CoreFoundation) __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 0xc
    (CoreFoundation) __CFRunLoopDoBlocks + 0x18e
    (CoreFoundation) __CFRunLoopRun + 0x385
    (CoreFoundation) CFRunLoopRunSpecific + 0x22d
    (CoreFoundation) CFRunLoopRun + 0x28
    (hook.dylib) after_enumerateWithOptions(objc_object*, unsigned long, void (objc_object*, unsigned long, signed char*) block_pointer) + 0x42b
    (hook.dylib) -[NSObject(NSArraySwizzling) __NSArrayM_enumerateObjectsWithOptions:usingBlock:] + 0x5d
    (AppKit) -[_NSTrackingAreaAKManager _updateActiveTrackingAreasForWindowLocation:modifierFlags:] + 0x6f3
    (hook.dylib) -[NSObject(_NSTrackingAreaAKManagerSwizzling) _NSTrackingAreaAKManager__updateActiveTrackingAreasForWindowLocation:modifierFlags:] + 0xba
    (AppKit) __58-[_NSTrackingAreaAKManager _activeTrackingAreasNeedUpdate]_block_invoke + 0x13e
    (hook.dylib) Hooked_activeTrackingAreasNeedUpdate_block_invoke(_activeTrackingAreasNeedUpdate_literal*) + 0xba
    (AppKit) ___NSMainRunLoopPerformBlockInModes_block_invoke + 0x19
    (hook.dylib) Hooked____NSMainRunLoopPerformBlockInModes_block_invoke(_perform_block_literal*) + 0x74
    (CoreFoundation) __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 0xc
    (CoreFoundation) __CFRunLoopDoBlocks + 0x18e
    (CoreFoundation) __CFRunLoopRun + 0x385
    (CoreFoundation) CFRunLoopRunSpecific + 0x22d
    (HIToolbox) RunCurrentEventLoopInMode + 0x124
    (HIToolbox) ReceiveNextEventCommon + 0xc9
    (HIToolbox) _BlockUntilNextEventMatchingListInModeWithFilter + 0x42
    (AppKit) _DPSNextEvent + 0x370
    (AppKit) -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 0x4f9
    (XUL) -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 0x7c
    (AppKit) -[NSApplication run] + 0x25b
    (XUL) -[GeckoNSApplication run] + 0x42
    (XUL) nsAppShell::Run() + 0x13e
    (XUL) nsAppStartup::Run() + 0x3c
    (XUL) XREMain::XRE_mainRun() + 0x72e
    (XUL) XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) + 0x34d
    (XUL) XRE_main(int, char**, mozilla::BootstrapConfig const&) + 0xb1
    (firefox) main + 0x22f
    (dyld) start + 0x775
```
(Following up comment #111)

Here's the NSWindow object being closed (the one that, after it's deleted, triggers the crash on a call to `-[NSWindow windowNumber]`). This happens before the events in comment #112 and comment #113.

```
(Thu Oct 17 11:42:54 2024) /Applications/Firefox Nightly.app/Contents/MacOS/firefox[77846] MainThread[0x1078cc240] Hook.mm: [NSWindow close]: self <ToolbarWindow: 0x138c7c100>
    (hook.dylib) PrintStackTrace() + 0x68
    (hook.dylib) -[NSWindow(MethodSwizzling) NSWindow_close] + 0x8f
    (XUL) nsCocoaWindow::DestroyNativeWindow() + 0x95
    (XUL) nsCocoaWindow::Destroy() + 0x89
    (XUL) mozilla::AppWindow::Destroy() + 0x1e5
    (XUL) mozilla::AppWindow::RequestWindowClose(nsIWidget*) + 0x1ec
    (XUL) mozilla::AppWindow::WidgetListenerDelegate::RequestWindowClose(nsIWidget*) + 0x1c
    (XUL) -[WindowDelegate windowShouldClose:] + 0x29
    (AppKit) __19-[NSWindow __close]_block_invoke + 0xc6
    (AppKit) -[NSWindow __close] + 0x1ad
    (AppKit) -[NSApplication(NSResponder) sendAction:to:from:] + 0x151
    (AppKit) -[NSControl sendAction:to:] + 0x56
    (AppKit) __26-[NSCell _sendActionFrom:]_block_invoke + 0x83
    (AppKit) -[NSCell _sendActionFrom:] + 0xab
    (AppKit) -[NSButtonCell _sendActionFrom:] + 0x60
    (AppKit) __29-[NSButtonCell performClick:]_block_invoke + 0x40
    (AppKit) -[NSButtonCell performClick:] + 0x24d
    (hook.dylib) invocation function for block in after_enumerateWithOptions(objc_object*, unsigned long, void (objc_object*, unsigned long, signed char*) block_pointer) + 0x5f
    (CoreFoundation) __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 0xc
    (CoreFoundation) __CFRunLoopDoBlocks + 0x18e
    (CoreFoundation) __CFRunLoopRun + 0x385
    (CoreFoundation) CFRunLoopRunSpecific + 0x22d
    (CoreFoundation) CFRunLoopRun + 0x28
    (hook.dylib) after_enumerateWithOptions(objc_object*, unsigned long, void (objc_object*, unsigned long, signed char*) block_pointer) + 0x42b
    (hook.dylib) -[NSObject(NSArraySwizzling) __NSArrayM_enumerateObjectsWithOptions:usingBlock:] + 0x5d
    (AppKit) -[_NSTrackingAreaAKManager _updateActiveTrackingAreasForWindowLocation:modifierFlags:] + 0x6f3
    (hook.dylib) -[NSObject(_NSTrackingAreaAKManagerSwizzling) _NSTrackingAreaAKManager__updateActiveTrackingAreasForWindowLocation:modifierFlags:] + 0xba
    (AppKit) __58-[_NSTrackingAreaAKManager _activeTrackingAreasNeedUpdate]_block_invoke + 0x13e
    (hook.dylib) Hooked_activeTrackingAreasNeedUpdate_block_invoke(_activeTrackingAreasNeedUpdate_literal*) + 0xba
    (AppKit) ___NSMainRunLoopPerformBlockInModes_block_invoke + 0x19
    (hook.dylib) Hooked____NSMainRunLoopPerformBlockInModes_block_invoke(_perform_block_literal*) + 0x74
    (CoreFoundation) __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 0xc
    (CoreFoundation) __CFRunLoopDoBlocks + 0x18e
    (CoreFoundation) __CFRunLoopRun + 0x385
    (CoreFoundation) CFRunLoopRunSpecific + 0x22d
    (HIToolbox) RunCurrentEventLoopInMode + 0x124
    (HIToolbox) ReceiveNextEventCommon + 0xc9
    (HIToolbox) _BlockUntilNextEventMatchingListInModeWithFilter + 0x42
    (AppKit) _DPSNextEvent + 0x370
    (AppKit) -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 0x4f9
    (XUL) -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 0x7c
    (AppKit) -[NSApplication run] + 0x25b
    (XUL) -[GeckoNSApplication run] + 0x42
    (XUL) nsAppShell::Run() + 0x13e
    (XUL) nsAppStartup::Run() + 0x3c
    (XUL) XREMain::XRE_mainRun() + 0x72e
    (XUL) XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) + 0x34d
    (XUL) XRE_main(int, char**, mozilla::BootstrapConfig const&) + 0xb1
    (firefox) main + 0x22f
    (dyld) start + 0x775
```

Back to Bug 1880582 Comment 114