godotengine / godot-ios-plugins

MIT License
126 stars 48 forks source link

ARKit - crashing on basic project: SIGABRT pointer being freed was not allocated #25

Open itslenny opened 2 years ago

itslenny commented 2 years ago

I'm trying to build a basic app using the ARKit Plugin

As a starting point I pulled down the example project and started it up.

The camera turns on and it starts painting black on top of it. Then, after a few seconds I get a SIGABRT in xCode.

I went through the project commenting stuff out and it seems like as long as arkit.ar_is_anchor_detection_enabled = true the crash occurs after a few seconds even with with basically all other code commented out in the project.

2021-12-07 18:05:14.403095-0600 ARKit[11923:1119420] ERROR: Condition "!_p" is true.
2021-12-07 18:05:14.403211-0600 ARKit[11923:1119420]    at: _unref (core/dictionary.cpp:173) - Condition "!_p" is true.
ERROR: Condition "!_p" is true.
   at: _unref (core/dictionary.cpp:173) - Condition "!_p" is true.
ARKit(11923,0x10411f8c0) malloc: *** error for object 0x127293e10: pointer being freed was not allocated
ARKit(11923,0x10411f8c0) malloc: *** set a breakpoint in malloc_error_break to debug
Screen Shot 2021-12-07 at 6 05 47 PM
itslenny commented 2 years ago

Also, intermittently getting this error as well.

Screen Shot 2021-12-07 at 6 32 28 PM
akien-mga commented 2 years ago

CC @BastiaanOlij

BastiaanOlij commented 2 years ago

Dang it, I have long ago lost access to hardware to do any MacOS based development :( The last time I worked on ARKit was before it was turned into a iOS plugin.. I do plan to buy an iMac one of these days so I can get back into Apple development but right now my hands are tied.

From the error log my best guess is that the dictionary that keeps track of the anchors found by ARKit is being released prematurely.

akien-mga commented 2 years ago

CC @godotengine/ios

marius-se commented 1 year ago

I can confirm ar_is_anchor_detection_enabled = true still causes the app to crash on my iPhone 11 Pro. Compiled with Godot 3.5 stable/ Xcode 13.4.1. Is there any workaround? I enabled the Address Sanitiser in Xcode and got the following error message:

Thread 21: signal SIGABRT

-[MTLDebugDevice newBufferWithBytesNoCopy:length:options:deallocator:]:687: failed assertion `Buffer Validation
newBufferWithBytesNoCopy:pointer 0x12cabc800 is not 4096 byte aligned.