Skip to content

test: Reproduce SubClassFinder crash with @available gesture types#8145

Draft
philprime wants to merge 1 commit into
mainfrom
test/subclassfinder-availability-crash-repro
Draft

test: Reproduce SubClassFinder crash with @available gesture types#8145
philprime wants to merge 1 commit into
mainfrom
test/subclassfinder-availability-crash-repro

Conversation

@philprime

@philprime philprime commented Jun 22, 2026

Copy link
Copy Markdown
Member

Add prototype to reproduce a crash where NSClassFromString in SentrySubClassFinder.actOnSubclassesOfViewController triggers Swift metadata resolution for types with @available(iOS 18+) protocol conformances (UIGestureRecognizerRepresentable). On older iOS where the protocol doesn't exist, this causes EXC_BAD_ACCESS in swift_getSingletonMetadata.

Adds:

  • HorizontalPanGesture view extension to iOS-SwiftUI sample app
  • LoremIpsumView uses the gesture to mirror real-world usage
  • UI test that launches the app to verify no crash on startup
  • Unit test with @available(iOS 26+) gesture types in the real ObjC runtime class list to exercise the SubClassFinder code path

Note: crash only reproduces on real iOS 17.x devices, not on simulators (the simulator Swift runtime handles missing protocol metadata without crashing).

#skip-changelog

Ref #8152

Add prototype to reproduce a crash where NSClassFromString in
SentrySubClassFinder.actOnSubclassesOfViewController triggers Swift
metadata resolution for types with @available(iOS 18+) protocol
conformances (UIGestureRecognizerRepresentable). On older iOS where the
protocol doesn't exist, this causes EXC_BAD_ACCESS in
swift_getSingletonMetadata.

Adds:
- HorizontalPanGesture view extension to iOS-SwiftUI sample app
- LoremIpsumView uses the gesture to mirror real-world usage
- UI test that launches the app to verify no crash on startup
- Unit test with @available(iOS 26+) gesture types in the real ObjC
  runtime class list to exercise the SubClassFinder code path

Note: crash only reproduces on real iOS 17.x devices, not on simulators
(the simulator Swift runtime handles missing protocol metadata without
crashing).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant