FinishedLaunching method body with below:var geometry = ARSCNPlaneGeometry.Create(new ARSCNView().Device);
var body = SCNPhysicsBody.CreateStaticBody();
body.PhysicsShape = SCNPhysicsShape.Create(geometry, new SCNPhysicsShapeOptions { ShapeType = SCNPhysicsShapeType.ConcavePolyhedron });
return true;
App operates normally, as it does when SCNPhysicsShapeType.BoundingBox or SCNPhysicsShapeType.ConvexHull is provided for ShapeType.
App 'soft crashes' (?), dumping a SIGSEV to the output (see below) while continuing to run with some issues. For example, in a non-minimal repro using SCNPhysicsShapeType.ConcavePolyhedron somewhere like here, the AR video feed stops, but various other UI elements continue to respond to changes in AR tracking and the user can touch the 'exit' button to leave the demo. After returning to the menu, menu music resumes and animations proceed but user interaction no longer seems to work. Force closing the app takes much longer than usual, made obvious by the fact that the music continues to play for several seconds after returning to Springboard.
The issue seems to occur with any overloads of SCNPhysicsShape.Create that take a SCNPhysicsShapeType parameter.
SIGSEV:
=================================================================
Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
=================================================================
Basic Fault Adddress Reporting
=================================================================
Memory around native instruction pointer (0x19bb8c9f0):0x19bb8c9e0 01 0c c0 3d 20 dc 20 6e 09 00 38 1e 29 39 1f 12 ...= . n..8.)9..
0x19bb8c9f0 09 01 00 79 01 04 0c 5e 29 00 38 1e 29 39 1f 12 ...y...^).8.)9..
0x19bb8ca00 00 04 14 5e 0a 00 38 1e 4a 39 1f 12 09 05 00 79 ...^..8.J9.....y
0x19bb8ca10 0a 09 00 79 c0 03 5f d6 08 40 40 f9 40 00 c0 3d ...y.._..@@.@..=
=================================================================
Native stacktrace:
=================================================================
0x100df8de8 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100defc18 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100dfc838 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : mono_pmip
0x186f199ec - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x19bb8c364 - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x19bba992c - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x19bba1a30 - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x19bba19c4 - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x19b94fd28 - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x19b94e788 - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x19b9c74f4 - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x19bb1582c - /System/Library/Frameworks/SceneKit.framework/SceneKit : <redacted>
0x18729a898 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x1872955c0 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x187295b3c - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x187295350 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
0x18949579c - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
0x1b439982c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
0x100dca964 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100db2ecc - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100db2e8c - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100be5f20 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100d46158 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100dffc34 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : mono_pmip
0x100e865e4 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : mono_pmip
0x100e8b9ac - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : mono_pmip
0x100de5588 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x100f29620 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : _Z9__isctypeim
0x100be5e24 - /var/containers/Bundle/Application/02C2064B-080A-43A0-917C-C8CAAF26FE51/ConcavePolyhedron.app/ConcavePolyhedron : (null)
0x186d5a8e0 - /usr/lib/system/libdyld.dylib : <redacted>
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at UIKit.UIApplication:UIApplicationMain <0x00007>
at UIKit.UIApplication:Main <0x0002b>
at UIKit.UIApplication:Main <0x000ab>
at ConcavePolyhedron.Application:Main <0x0007f>
at System.Object:runtime_invoke_dynamic <0x000f7>
=================================================================
2019-04-23 18:46:16.903 ConcavePolyhedron[3659:641392] XPC connection interrupted
=== Visual Studio Community 2019 for Mac ===
Version 8.0.4 (build 0)
Installation UUID: 878dd934-e422-4da6-a7ed-281dfe787f4a
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.6.0.2 (d16-0 / 040682909)
Package version: 518010003
=== Mono Framework MDK ===
Runtime:
Mono 5.18.1.3 (2018-08/fdb26b0a445) (64-bit)
Package version: 518010003
=== NuGet ===
Version: 4.8.2.5835
=== .NET Core ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.9
2.1.2
2.1.1
2.1.0-preview1-26216-03
2.0.5
2.0.3
SDK: /usr/local/share/dotnet/sdk/2.1.505/Sdks
SDK Versions:
2.1.505
2.1.302
2.1.301
2.1.300-preview1-008174
2.1.4
2.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Sdks
=== Xamarin.Profiler ===
Version: 1.6.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Xamarin.Android ===
Version: 9.2.3.0 (Visual Studio Community)
Android SDK: /Users/rdavis/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
5.1 (API level 22)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.0
SDK Build Tools Version: 27.0.3
Build Information:
Mono: mono/mono/2018-08-rc@5ac37ccd385
Java.Interop: xamarin/java.interop/d16-0@c987483
LibZipSharp: grendello/LibZipSharp/d16-1@44de300
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
MXE: xamarin/mxe/xamarin@b9cbb535
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.26.0@325e91a
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-0@0a7edd6
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/rdavis/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android Device Manager ===
Version: 1.2.0.14
Hash: 86df26f
Branch: remotes/origin/d16-0
Build date: 2019-04-05 16:58:56 UTC
=== Apple Developer Tools ===
Xcode 10.1 (14460.46)
Build 10B61
=== Xamarin.Mac ===
Version: 5.8.0.0 (Visual Studio Community)
Hash: 0aa84521
Branch: d16-0
Build date: 2019-04-02 16:01:19-0400
=== Xamarin.iOS ===
Version: 12.8.0.0 (Visual Studio Community)
Hash: 0aa84521
Branch: d16-0
Build date: 2019-04-02 16:01:19-0400
=== Xamarin Designer ===
Version: 4.17.4.418
Hash: 3d086e814
Branch: remotes/origin/d16-0
Build date: 2019-04-01 09:20:10 UTC
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Build Information ===
Release ID: 800040000
Git revision: 09831ae7eef8ea58cdfad2e923c65a5bf70d27fd
Build date: 2019-04-15 23:04:13+00
Build branch: master
Xamarin extensions: 5efedb990d786142d3b54351c01ce867af7b7680
=== Operating System ===
Mac OS X 10.13.6
Darwin 17.7.0 Darwin Kernel Version 17.7.0
Thu Jun 21 22:53:14 PDT 2018
root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
https://gist.github.com/rdavisau/d3db0d18fe99dfa0e2bb7751c473a188
Thank you for the very detailed bug report.
With it, I was easily able to reproduce your issue. On top of that I was able to verify that this is an Apple bug.
This ObjC code will reproduce the crash in SCNPhysicsShapeTypeConcavePolyhedron but not SCNPhysicsShapeTypeBoundingBox.
Please consider reporting this issue to Apple directly, that way you can get notifications if they fix this in the future. Apple does not make it possible to "cc" other's reports.
@import ARKit;
@import SceneKit;
- (void)viewDidLoad {
[super viewDidLoad];
ARSCNView * view = [[ARSCNView alloc] init];
[self.view addSubview:view];
ARSCNPlaneGeometry * geo = [ARSCNPlaneGeometry planeGeometryWithDevice:[view device]];
SCNPhysicsBody * body = [SCNPhysicsBody staticBody];
NSMutableDictionary<SCNPhysicsShapeOption, id> * options = [[NSMutableDictionary alloc] init];
#if true
options[SCNPhysicsShapeTypeKey] = SCNPhysicsShapeTypeConcavePolyhedron;
#else
options[SCNPhysicsShapeTypeKey] = SCNPhysicsShapeTypeBoundingBox;
#endif
body.physicsShape = [SCNPhysicsShape shapeWithGeometry:geo options:options];
NSLog (@"Done");
}
Ah, I did not even think to reproduce it natively. Thank you for including the code you used, I have reproduced it natively and submitted a bug to Apple.