inspektify: Crash in iOS when Main Thread Checker is enabled

Description: In our KMP project, we encounter a crash on the iOS platform during startup when Inspektify is integrated, and the Main Thread Checker is enabled in the scheme.

Problem: At startup, the project crashes on iOS, with a stack trace indicating an issue in libdispatch.dylib and an error message:

"BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively". In our KMP project we observe a crash on the iOS platform on startup when inspektify integrated and the Main Thread Checker is enabled in the scheme. Is there a way to integrate inspektify and avoid this crash?

Edited: we found that the crash is only occurring when also UnityFramework is also integrated in the above described scenario

Stack trace:

libdispatch.dylib'.
_dispatch_once_wait.cold.1:
0x100770d2c <+0>: stp
x20, x21, Isp, #-0x10]!
0x100770d30 <+4>:
adrp
x20,
7
0x100770d34 <+8>:
add
x20, x20, #0xaf8
0x100770d38 <+12>: adrp
x21, 41
0x100770d3c <+16>: add
x21, x21, #0x220
0x100770d40 <+20>: str
x20
, [x21, #0x8]
0x100770d44 <+24>: 1dp
x20, x21, [sp], #0x10
0x100770d48 <+28>: brk
#0x1
; "BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively"
¡ gCRAnnotations

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 18 (10 by maintainers)

Most upvoted comments

Thank you @brunce for this report. Sadly I don’t have a lot of knowledge on Unity development, so I could be of any help here. I would suggest reporting a problem to the Unity team so they can fix it. One thing that might also be the root cause of this issue is also update of the macOS system I suspect. Because for me when I was on macOS 14.x everything worked with your sample as expected. It stopped working when I updated the system. It is worth mentioning this.

I hope you resolve this problem soon. If you find any problems with Inspektify let me know and I will investigate the problem as soon as possible. I will now close this issue since is Unity-related.

Thank you for your quick and thorough investigation of the issue.