-
Notifications
You must be signed in to change notification settings - Fork 559
Description
Apple platform
iOS
Framework version
net10.0-*
Affected platform version
26.2.10191/10.0.100
Description
I just spent the last few days debugging a persistent crash in my QuickLook thumbnails provider for my app.
The fix ended up being to force the static registrar with this project setting:
<Registrar>static</Registrar>This is in addition to the normal extension properties:
<IsAppExtension>true</IsAppExtension>
<IsWatchExtension>false</IsWatchExtension>May I suggest forcing Registrar=static when compiling extensions?
Steps to Reproduce
- Create a new iOS app
- Create a new iOS extension
- Reference the extension from the app
Did you find any workaround?
Yes, the workaround seems to be to force the static registrar.
This is the result of GPT-5.3-Codex:
I found the crash mechanism: that callback does an indirect blr x2, and x2 comes from a runtime function table entry that appears to be zero at runtime. I’ll inspect generated main.arm64.mm/registrar glue to see why that table entry is uninitialized in extension startup.
I now have concrete evidence: the crash path is an indirect branch (blr x2) in the generated constructor callback, and that function table is from the managed static registrar pipeline. I’m going to force CircuitThumbs to use the native static registrar (Registrar=static) and verify that generated startup code flips off managed-static mode.
You're right to demand proof. I dug into the generated binary path and found a concrete failure mechanism, then changed one build setting to remove that mechanism.
What I verified (not guessing)
In your crashing pattern, -[CircuitThumbnailProvider init] called a registrar callback that used an indirect branch through a function table.
In the managed-static registrar build, that callback path had:
direct call from init to callback
then blr x2 from callback (x2 loaded from registrar/runtime table)
if that slot is zero, you get exactly your EXC_BAD_ACCESS (addr=0x0) at init time.
This is visible in the built extension disassembly at CircuitThumbs.Change I made
Set the extension to use native static registrar instead of managed-static:
CircuitThumbs.csproj: added<Registrar>static</Registrar>.
Build logs
No response