XmacsLabs / mogan

Mogan STEM Suite (based on GNU TeXmacs): Enjoy exploring science and technology!
https://mogan.app
GNU General Public License v3.0
392 stars 32 forks source link

Crash when `Use native menubar` is activated #47

Closed YiqiXu closed 3 months ago

YiqiXu commented 2 years ago

When Use native menubar is activated, Mogan crashes a lot on macOS. I first noticed this issue when I found out about the following problem. And it turned out to be related to the native menubar.

image

After clicking the following button Mogan v1.0 alpha3 always gets stuck.

image
da-liii commented 2 years ago

Try it the second time? For me, for the first time when I click Documentations..., it has no effect. And then, I click again it works.

Turn off native menu bar (#40) and restart and try again?

YiqiXu commented 2 years ago

Following your setting, it doesn't get stuck anymore. But I still need to click the button twice to get the popup window.

YiqiXu commented 2 years ago

I have renamed this issue and updated the description, highlighting the actual bug.

pan93412 commented 2 years ago

I can also reproduce this issue in another way:

  1. “Help” → “About” → “About Qt”
  2. Click on “Ok”. In my case, it always made Mogan freeze & crash.

https://user-images.githubusercontent.com/28441561/204327246-a26c03a3-083c-4510-9866-8a9dc655f502.mp4

Mogan in my Mac runs under Rosetta 2. May it be a key to this issue?

da-liii commented 2 years ago

Mogan in my Mac runs under Rosetta 2. May it be a key to this issue?

Here is guide to build the macOS app by yourself on macOS M1.

https://github.com/XmacsLabs/mogan/blob/main/docs/Develop_on_macOS.en.md

You may try to see if the root cause is Rosetta 2.

I haven't upgraded my macOS M1 device to macOS 13.x yet. I guest macOS 13.x might also be a problem.

pan93412 commented 2 years ago

Mogan in my Mac runs under Rosetta 2. May it be a key to this issue?

Here is guide to build the macOS app by yourself on macOS M1.

https://github.com/XmacsLabs/mogan/blob/main/docs/Develop_on_macOS.en.md

You may try to see if the root cause is Rosetta 2.

I haven't upgraded my macOS M1 device to macOS 13.x yet. I guest macOS 13.x might also be a problem.

I've attempted to build it; however, I encountered some issues:

image

Some tricks seems needed to workaround this issue. Maybe I'll try it later.

ammkrn commented 1 year ago

I'm experiencing a similar crash on MacOS (11.7.1) regardless of whether use native menubar is on or off when I try the Mogan and Planet options. The editor just locks up until I kill the process externally.

da-liii commented 1 year ago

I've upgraded Qt from Qt 5 to Qt 6 since Mogan Research 1.2.0 beta16, let's see if this bug still exists.

da-liii commented 11 months ago

There are still errors:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib                 0x1a5baa1b0 __pthread_kill + 8
1   libsystem_pthread.dylib                0x1a5be0cec pthread_kill + 288
2   libsystem_c.dylib                      0x1a5b1a2c8 abort + 180
3   libc++abi.dylib                        0x1a5b9ab18 abort_message + 132
4   libc++abi.dylib                        0x1a5b8aa0c demangling_terminate_handler() + 336
5   libobjc.A.dylib                        0x1a588f774 _objc_terminate() + 160
6   libc++abi.dylib                        0x1a5b99eb4 std::__terminate(void (*)()) + 20
7   libc++abi.dylib                        0x1a5b9cc2c __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 36
8   libc++abi.dylib                        0x1a5b9cbd8 __cxa_throw + 140
9   MoganResearch                          0x101d2d030 tm_throw(char const*) + 272
10  libsystem_platform.dylib               0x1a5c0f2a4 _sigtramp + 56
11  libqcocoa.dylib                        0x102c04414 0x102be4000 + 132116
12  libqcocoa.dylib                        0x102c07264 0x102be4000 + 143972
13  libqcocoa.dylib                        0x102c06710 0x102be4000 + 141072
14  libqcocoa.dylib                        0x102c0708c 0x102be4000 + 143500
15  QtWidgets                              0x103f7876c QMenuBar::actionEvent(QActionEvent*) + 232
16  QtWidgets                              0x103e1c6b8 QWidget::event(QEvent*) + 132
17  QtWidgets                              0x103dd32f8 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272
18  QtWidgets                              0x103dd4ca0 QApplication::notify(QObject*, QEvent*) + 3396
19  MoganResearch                          0x101d03ac4 0x100d9c000 + 16153284
20  QtCore                                 0x1043eb06c QCoreApplication::notifyInternal2(QObject*, QEvent*) + 292
21  QtWidgets                              0x103e1219c QWidget::insertAction(QAction*, QAction*) + 340
22  MoganResearch                          0x1018fe81c 0x100d9c000 + 11937820
23  MoganResearch                          0x1018ff750 0x100d9c000 + 11941712
24  MoganResearch                          0x101578778 0x100d9c000 + 8243064
YiqiXu commented 7 months ago

A solution has been announced in the mailing list. And it works fine on my MacBook.