dotnet / dotnet/macios

Native crash using UIDynamicAnimator in UICollectionViewFlowLayout

Open
#6,686 4 comments 0 reactions 0 assignees View on GitHub
bug iOS
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 12h
Merged PRs (30d)
123

Description

### Steps to Reproduce

1. Run the sample project
2. Try scrolling
3. See the error in the log

### Expected Behavior
The app should not crash

### Actual Behavior
The app crashes with the following log:
```
2019-07-30 10:39:28.509232+0100 TestBounceLayout[40862:1388475] (1.333640s) in {{0, 0}, {0, 0}}: body type: representedObject:[ index path: ( {length = 2, path = 0 - 4}); frame = (37.6667 1240; 300 300); ] 0x7f9969426860 PO:(187.666672,1390.000000) AN:(0.000000) VE:(0.000000,0.000000) AV:(0.000000) dy:(1) cc:(0) ar:(1) rs:(1) fr:(0.200000) re:(0.200000) de:(1.000000) gr:(0) without representedObject for item index path: ( {length = 2, path = 0 - 4}); frame = (37.6667 1240; 300 300);

=================================================================
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 (0x1256264fd):0x1256264ed 1f 02 05 00 4c 89 f7 48 89 de ff 15 6b 8b 04 00 ....L..H....k...
0x1256264fd f3 0f 10 40 28 0f 29 85 70 ff ff ff f3 0f 10 40 ...@(.).p......@
0x12562650d 2c 0f 29 85 60 ff ff ff f2 0f 10 40 20 0f 29 85 ,.).`......@ .).
0x12562651d 50 ff ff ff 4c 89 ff 48 89 de ff 15 3b 8b 04 00 P...L..H....;...

=================================================================
Native stacktrace:
=================================================================
0x10f1505dd - /Users/osiris/Library/Developer/CoreSimulator/Devices/EF5C4827-CD61-4FDA-8811-553423A2D81D/data/Containers/Bundle/Application/9454785D-016A-4FF1-8A99-17A8DA30526E/TestBounceLayout.app/TestBounceLayout : mono_dump_native_crash_info
0x10f144c35 - /Users/osiris/Library/Developer/CoreSimulator/Devices/EF5C4827-CD61-4FDA-8811-553423A2D81D/data/Containers/Bundle/Application/9454785D-016A-4FF1-8A99-17A8DA30526E/TestBounceLayout.app/TestBounceLayout : mono_handle_native_crash
0x10f156dd8 - /Users/osiris/Library/Developer/CoreSimulator/Devices/EF5C4827-CD61-4FDA-8811-553423A2D81D/data/Containers/Bundle/Application/9454785D-016A-4FF1-8A99-17A8DA30526E/TestBounceLayout.app/TestBounceLayout : mono_sigsegv_signal_handler_debug
0x11eba8b5d - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x0 - Unknown
0x1256263da - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/PhysicsKit.framework/PhysicsKit : +[PKPhysicsJointDistance jointWithBodyA:bodyB:localAnchorA:localAnchorB:]
0x1233ad9a3 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIAttachmentBehavior _reevaluateJoint]
0x1233b2a77 - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIDynamicAnimator _registerBehavior:]
0x1233b282a - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIDynamicAnimator addBehavior:]
0x10f394579 - /Users/osiris/Library/Developer/CoreSimulator/Devices/EF5C4827-CD61-4FDA-8811-553423A2D81D/data/Containers/Bundle/Application/9454785D-016A-4FF1-8A99-17A8DA30526E/TestBounceLayout.app/TestBounceLayout : xamarin_dyn_objc_msgSend
0x14175d9a8 - Unknown

=================================================================
Managed Stacktrace:
=================================================================
at <0xffffffff>
at ObjCRuntime.Messaging:void_objc_msgSend_IntPtr <0x00117>
at UIKit.UIDynamicAnimator:AddBehavior <0x0021a>
at TestBounceLayout.UIDynamicAnimatorExtensions:AddBehavior <0x00134>
at TestBounceLayout.BounceCollectionViewFlowLayout:PrepareLayout <0x00452>
at System.Object:runtime_invoke_void__this__ <0x001e5>
at <0xffffffff>
at UIKit.UIApplication:UIApplicationMain <0x002a1>
at UIKit.UIApplication:Main <0x000d2>
at UIKit.UIApplication:Main <0x00152>
at TestBounceLayout.Application:Main <0x000b2>
at :runtime_invoke_void_object <0x001e8>
=================================================================
```

### Environment
```
Visual Studio Community 2019 for Mac
Version 8.2 (build 1105)
Installation UUID: 000a1881-bf07-4cfa-adda-541dd71622b2
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.14.0.85 (d16-2-fix-mac-updates / 86973979)

Package version: 600000311

Mono Framework MDK
Runtime:
Mono 6.0.0.311 (2019-02/494641b300c) (64-bit)
Package version: 600000311

NuGet
Version: 5.1.0.6013

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.2.5
2.2.1
2.1.9
2.1.2
2.1.1
2.0.6
2.0.5
2.0.0
1.0.1
SDK: /usr/local/share/dotnet/sdk/2.2.300/Sdks
SDK Versions:
2.2.300
2.2.103
2.1.505
2.1.302
2.1.301
2.1.101
2.1.4
2.0.0
1.0.0-preview2-003131
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/Current/bin/Sdks

Xamarin.Profiler
Version: 1.6.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Apple Developer Tools
Xcode 10.3 (14492.2)
Build 10G8

Xamarin.Mac
Version: 5.14.0.110 (Visual Studio Community)
Hash: a8bcecce
Branch: d16-2
Build date: 2019-06-28 07:31:43-0400

Xamarin.iOS
Version: 12.14.0.110 (Visual Studio Community)
Hash: a8bcecce
Branch: d16-2
Build date: 2019-06-28 07:31:42-0400

Xamarin Designer
Version: 16.2.0.354
Hash: 5f80a14f8
Branch: remotes/origin/d16-2
Build date: 2019-07-11 17:28:26 UTC

Xamarin.Android
Version: 9.4.0.51 (Visual Studio Community)
Commit: xamarin-android/d16-2/9fa7775
Android SDK: /Users/osiris/Library/Android/sdk
Supported Android versions:
5.1 (API level 22)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.1
SDK Build Tools Version: 29.0.0

Build Information:
Mono: mono/mono/2019-02@e6f5369c2d2
Java.Interop: xamarin/java.interop/d16-2@d64ada5
LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-2@6f6c969

Microsoft Mobile OpenJDK
Java SDK: /Users/osiris/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.58
Hash: d03e3ea
Branch: remotes/origin/d16-2~1
Build date: 2019-07-16 17:37:14 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: 802001105
Git revision: a187f6852ae62ba52b944b47e53702957edfcf7b
Build date: 2019-07-22 18:20:10+00
Build branch: release-8.2
Xamarin extensions: 34bd2378d8d707df25989727c23ce68d9a232a67

Operating System
Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
Thu Apr 25 23:16:27 PDT 2019
root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
```

### Build Logs
Not provided, but can if required

### Example Project (If Possible)
[project.zip](https://github.com/xamarin/xamarin-macios/files/3446610/project.zip)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.