mapeditor/tiled

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Freezing with high CPU usage on Apple Silicon (M1/M2) #3876

bjorn posted onGitHub

Since a long time many different people are reporting issues running Tiled on their M1 / M2 Macs, most frequently on this forum thread.

I hoped a Universal build that included native ARM64 support would help with the issue, but that shipped with Tiled 1.10.2 and the problem is still being reported.

Describe the bug

Various quotes from the above forum thread:

I installed Tiled 1.10, 1.9 and 1.8 and all versions have the same problem. Tiled is randomly stuck loading. I use an older Macbook Pro 2015 but with Monterey installed.

The latest version freezes randomly. High CPU usage.

I’m using mac (M1 chip) ,OS Sonoma 14.2.1, I tried using older versions of Tiled as well. Current issue is that I get the spinning wheel of death, this happens after a minute of using the App. This causes the app to freeze and I have to close it out and restart it. It always crashes after the same amount of time.

To Reproduce

So far this problem has only been reported on M1 / M2 hardware, which is likely necessary to reproduce the problem. I don't have access to such hardware myself.

Tiled Version: Reportedly happened also with 1.7.2 (possibly earlier) and up to 1.10.2

How to Help

If you can reproduce this issue on your macOS system, please try to set up a Qt development environment by installing Qt and Xcode, then see if you can also reproduce the issue with your own build of Tiled. If it happens, it could help to run Tiled in the debugger and pause it, to see where it is getting stuck.


I got this to work by downloading source to my m2 Mac and compiling under qt.

The file dialogs all pause when opening but become responsive within a couple seconds. Probably something there just haven’t had time to look yet.

I wonder if the author has access to a Mac m[n] environment or access to GitHub actions to handle the binary compile?

Hats off to the developer for having a super clear readme file allowing me to easily build it.

Let me know if/how I can help @bjorn

posted by raishey about 1 year ago

I also notice that having a map open and opening another one results in the following out of range exception when running on my m2 (I don't have an M1 -I assume it's the same). It happens with 1.10.2 and 1.10.1.

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndexedSubscript:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000018e3e0570 __exceptionPreprocess + 176
    1   libobjc.A.dylib                     0x000000018ded1eb4 objc_exception_throw + 60
    2   CoreFoundation                      0x000000018e356d10 -[__NSCFString hasSuffix:] + 0
    3   libqcocoa.dylib                     0x0000000102fe656c -[QMacAccessibilityElement initWithId:role:] + 296
    4   libqcocoa.dylib                     0x0000000102fe65ec +[QMacAccessibilityElement elementWithId:] + 64
    5   libqcocoa.dylib                     0x0000000102fe4b88 _ZN19QCocoaAccessibility25notifyAccessibilityUpdateEP16QAccessibleEvent + 104
    6   QtWidgets                           0x000000010561a888 _ZN9QListView16selectionChangedERK14QItemSelectionS2_ + 204
    7   QtCore                              0x0000000103bf8b00 _Z10doActivateILb0EEvP7QObjectiPPv + 1248
    8   QtCore                              0x0000000103d5aa74 _ZN19QItemSelectionModel20emitSelectionChangedERK14QItemSelectionS2_ + 792
    9   QtCore                              0x0000000103d5a5f8 _ZN19QItemSelectionModel6selectERK14QItemSelection6QFlagsINS_13SelectionFlagEE + 368
    10  QtCore                              0x0000000103d5a45c _ZN19QItemSelectionModel6selectERK11QModelIndex6QFlagsINS_13SelectionFlagEE + 60
    11  QtCore                              0x0000000103d5ae60 _ZN19QItemSelectionModel15setCurrentIndexERK11QModelIndex6QFlagsINS_13SelectionFlagEE + 212
    12  QtWidgets                           0x00000001054ac2e8 _ZN16QComboBoxPrivate15setCurrentIndexERK11QModelIndex + 612
    13  QtWidgets                           0x00000001054abb5c _ZN9QComboBox15setCurrentIndexEi + 112
    14  QtWidgets                           0x00000001054af038 _ZN16QComboBoxPrivate12rowsInsertedERK11QModelIndexii + 344
    15  QtCore                              0x0000000103bf88f8 _Z10doActivateILb0EEvP7QObjectiPPv + 728
    16  QtCore                              0x0000000103d47ec4 _ZN18QAbstractItemModel13endInsertRowsEv + 160
posted by raishey about 1 year ago

I got this to work by downloading source to my m2 Mac and compiling under qt.

To make sure I understand this, do you mean you had this issue with the Tiled 1.10.2 release, so you've installed Qt and compiled Tiled yourself? And does the problem still happen for your own build?

I wonder if the author has access to a Mac m[n] environment or access to GitHub actions to handle the binary compile?

I don't have a physical M1 or M2. To see if I could reproduce this, I've recently rented an M1 Mac Mini at Scaleway, using VNC to access it. However, I had both the Tiled 1.10.2 release and a local build running there for a while and I could not reproduce the issue. :-(

I also notice that having a map open and opening another one results in the following out of range exception when running on my m2

Hmm, it could help to include the full call stack, because yours doesn't show which Tiled function is involved in this. However, it appears to be QTBUG-118585, which is marked as fixed in Qt 6.6.2, which isn't released yet. There are more accessibility released issues reportedly fixed in Qt 6.6.2, so when that release happens I think it could be a good time to make a new Tiled release against it.

posted by bjorn about 1 year ago

Had the same issue (NSRangeException using Apple M2 hw). Recompiling using a Qt 6.8 snapshot has been super stable for me; hopefully the 6.6.2 includes the same fixes.

posted by anders-n08 about 1 year ago

Hmm, it could help to include the full call stack, because yours doesn't show which Tiled function is involved in this. However, it appears to be QTBUG-118585, which is marked as fixed in Qt 6.6.2, which isn't released yet. There are more accessibility released issues reportedly fixed in Qt 6.6.2, so when that release happens I think it could be a good time to make a new Tiled release against it.

been testing with qt 6.6.2 on M1. The issue I had before was gone (was not able to open a map file) and it is so far so good.

posted by stoner-jack about 1 year ago

It would be nice if people affected by this issue could test whether it still happens with Tiled 1.11, which was released against Qt 6.7.2.

Earlier comments from @anders-n08 and @stoner-jack indicate this issue might finally be fixed now.

posted by bjorn 10 months ago

I am on my Macbook M1 using the 1.11.2 version and it freezing for me. Any solution what so ever that can be it to work?

posted by Haseebshah936 5 days ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests