Bug 1765391 Comment 53 Edit History

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

(In reply to Steven Michaud [:smichaud] (Retired) from comment #51)
> I *am* able to reproduce the following, which makes a lot more sense as the top of this bug's crash stacks:
> 
> ```
> (Fri Nov 15 15:38:34 2024) /Applications/Firefox Nightly.app/Contents/MacOS/firefox[6379] MainThread[0x1118d4280] Hook.mm: -[NSCarbonMenuImpl _menuLostMainMenuStatus]
>     (hook.dylib) PrintStackTrace() + 0x68
>     (hook.dylib) -[NSObject(NSCarbonMenuImplSwizzling) NSCarbonMenuImpl__menuLostMainMenuStatus] + 0x68
>     (AppKit) -[NSMenu _setMenuName:] + 0x27e
>     (AppKit) -[NSApplication setMainMenu:] + 0x15e
>     (AppKit) -[NSMenu _setMenuName:] + 0x405
>     (XUL) nsMenuBarX::Paint() + 0xad
> ...
> ```
> Maybe the App Notes' stacks are corrupt. Or maybe (and I think this is more likely) there are problems with `atos`.

There should be a call to `(AppKit) -[NSApplication setMainMenu:]` above `(XUL) nsMenuBarX::Paint() + 0xad` and below ` (AppKit) -[NSMenu _setMenuName:] + 0x405`. The reason there isn't is because `(AppKit) -[NSApplication setMainMenu:]`, at its end, `jmp`s to ` (AppKit) -[NSMenu _setMenuName:]`. This puts the two calls on the same line in the call stack, so that the latter overwrites the former.
(In reply to Steven Michaud [:smichaud] (Retired) from comment #51)
> I *am* able to reproduce the following, which makes a lot more sense as the top of this bug's crash stacks:
> 
> ```
> (Fri Nov 15 15:38:34 2024) /Applications/Firefox Nightly.app/Contents/MacOS/firefox[6379] MainThread[0x1118d4280] Hook.mm: -[NSCarbonMenuImpl _menuLostMainMenuStatus]
>     (hook.dylib) PrintStackTrace() + 0x68
>     (hook.dylib) -[NSObject(NSCarbonMenuImplSwizzling) NSCarbonMenuImpl__menuLostMainMenuStatus] + 0x68
>     (AppKit) -[NSMenu _setMenuName:] + 0x27e
>     (AppKit) -[NSApplication setMainMenu:] + 0x15e
>     (AppKit) -[NSMenu _setMenuName:] + 0x405
>     (XUL) nsMenuBarX::Paint() + 0xad
> ...
> ```
> Maybe the App Notes' stacks are corrupt. Or maybe (and I think this is more likely) there are problems with `atos`.

There should be a call to `(AppKit) -[NSApplication setMainMenu:]` above `(XUL) nsMenuBarX::Paint() + 0xad` and below ` (AppKit) -[NSMenu _setMenuName:] + 0x405`. The reason there isn't is because `(AppKit) -[NSApplication setMainMenu:]`, at its end, `jmp`s to ` (AppKit) -[NSMenu _setMenuName:]`. This puts the two calls at the same offset in the call stack, so that the latter overwrites the former.

Back to Bug 1765391 Comment 53