WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

SIGABRT: _wantsForwardingFromResponder:toNextResponder:withEvent: > current deallocating: %i, next dealloc...

Open sentry-io[bot] opened this issue 1 year ago • 9 comments

Sentry Issue: JETPACK-IOS-7B

SIGABRT: _wantsForwardingFromResponder:toNextResponder:withEvent: > current deallocating: %i, next deallocationg: %i, current: %@, next: %@, self: %@, event: %@, cmd: "%s" > current deallocating: 0, next deallocationg: 1, current: <private>, next: <private>, self: <private>, event: <private>, cmd: "_wantsForwardingFromResponder:toNextResponder:withEvent:"
  File "main.swift", line 7, in main
...
(23 additional frame(s) were not displayed)

By July 3rd, 2023, this issue has impacted 275 users.

sentry-io[bot] avatar Jul 03 '23 15:07 sentry-io[bot]

This issue is impacting around 0.02% of users in version 22.5.1.0. Based on the stack trace, it's hard to tell where the crash is happening. Several events are associated with UICompatibilityInputViewController and UIPredictionViewController, but I haven't found any clue about how it's caused. For now, I'll consider it as a crash (high severity) but with low impact, and set the issue as a Medium priority.

NOTE: Most of the events are happening in version 22.3.0.2, so it's likely that it's less reproducible in newer versions.

fluiddot avatar Jul 03 '23 16:07 fluiddot

Fails 🚫 Please add a feature label to this issue. e.g. 'Stats'

The crash doesn't seem to be specific to an area. However, I noticed after checking recent events that most of them reference the Gutenberg editor. Hence, I'll set the Gutenberg label.

fluiddot avatar Jul 03 '23 16:07 fluiddot

Sentry also groups PUPickerRemoteViewController related crashes with this report.

Created a separate https://github.com/wordpress-mobile/WordPress-iOS/issues/22518 issue for them.

staskus avatar Feb 01 '24 13:02 staskus

There are a lot of different crashes in this Sentry issue. Looking at the counts for crashes in 24.1 (there's none in 24.1):

  1. 25 occurrences - SIGABRT: Cannot form weak reference to instance ... of class PUPickerRemoteViewController.
  2. 12 occurrences - SIGABRT: AttributeGraph precondition failure: attribute failed to set an initial value
  3. 12 occurrences - SIGABRT: Cannot form weak reference to instance ... _UIRemoteInputViewController
  4. 5 occurrences - SIGABRT: _wantsForwardingFromResponder:toNextResponder:withEvent: > current deallocating: %i, next dealloc

Taking the second most frequent crash, AttributeGraph, it has a consistent error message:

SIGABRT: AttributeGraph precondition failure: attribute failed to set an initial value: 233496, ForEachChild<Array<UIImage>, UIImage, ModifiedContent<ModifiedContent<ModifiedContent<ModifiedContent<Image, _FrameLayout>, _BackgroundStyleModifier<Color>>, _ClipEffect<Circle>>, _OverlayModifier<_ShapeView<_StrokedShape<Circle>, Color>>>>

It's a SwiftUI issue and could happen in a ForEach over a list of images cropped to circles. We have a lot of code that does this, so I couldn't pinpoint the area of the codebase that could cause this. To make a guess, @wargcm , do you think JetpackSocialNoConnectionViewModel could be related to this crash due to the async fetching of images? Any additional thoughts on what could cause this crash are appreciated 🙇

The crash was first seen in 23.8, and I think the Jetpack Social work may have happened earlier so there's no clear link there, but I'm not sure.

guarani avatar Feb 01 '24 21:02 guarani

@guarani I'd say that's a good guess. The modifiers match the icon Image's modifiers. Looking online, it appears the issue might be something related to the ID of the objects and possibly the state updates? It isn't exactly clear. I'm also not sure why it started crashing recently. Maybe some previous events have been deleted?

One option that may resolve the issue is we can use AsyncImage now. IIRC, our minimum supported version wasn't 15.0 yet when I wrote the code. That would remove the state on the view model object and should simplify it a bit. I can toss up a PR making that change since it should be fairly quick.

Created #22526.

wargcm avatar Feb 01 '24 23:02 wargcm

That sounds like a good idea. I don't have much experience with this, though. Thanks for creating the separate issue 👍

guarani avatar Feb 02 '24 00:02 guarani

In the events for 24.5 (there are none in 24.6 yet), we have a mixed bag of crashes:

  • 7 events - Cannot form weak reference ... of class PUPickerRemoteViewController...`, tracked in https://github.com/wordpress-mobile/WordPress-iOS/issues/22518
  • 4 events - SIGABRT: Signal 6, Code 0
    • I can't see any actionable info in this crash, it seems like the system terminated the app, but there's no info on how it happened
  • 3 events - Cannot form weak reference ... of class _UIRemoteInputViewController...`
    • Again, no clear indication of the cause
  • 3 events - _wantsForwardingFromResponder:toNextResponder:withEvent: > current deallocating...
    • Again, no clear indication of the cause

I only briefly investigated each, but I think this GitHub issue involves separate crashes, each with a low number of events, that need to be addressed individually.

guarani avatar Apr 11 '24 01:04 guarani

I unassigned you from the Sentry issue here @kean as you're not assigned to this GitHub issue and I assume you're not working on this.

guarani avatar Apr 11 '24 01:04 guarani

I wasn't working on it.

kean avatar Apr 15 '24 15:04 kean