Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatalError message not captured by BugSnag #1679

Open
0xpablo opened this issue Jul 16, 2024 · 3 comments
Open

fatalError message not captured by BugSnag #1679

0xpablo opened this issue Jul 16, 2024 · 3 comments
Labels
backlog We hope to fix this feature/bug in the future needs discussion Requires internal analysis/discussion

Comments

@0xpablo
Copy link

0xpablo commented Jul 16, 2024

Describe the bug

Hi there, we are in the process of evaluating BugSnag to switch from Crashlytics.
We use GRDB and sometimes have fatalConversionError crashes. This crash happens when there is an attempt to read a value from a missing column for instance.
I noticed that Crashlytics populates a crash_info_entry_0 key with data such as this:

/Users/distiller/Library/Developer/Xcode/DerivedData/xxx-gkoktxxwoccurtcsovqddkqarggu/SourcePackages/checkouts/GRDB.swift/GRDB/Core/DatabaseValueConversion.swift:160: Fatal error: could not read Bool from missing column `feature_enabled` (row: [id:"xxx" parent_folder_id:"yyy" lww_parent_folder_id:Data(48 bytes) root_folder_id:"zzz" item_id:"..., sql: `SELECT folder_to_folder_items.*, CASE documents.document_type WHEN 0 THEN pages.thumbnail_tag WHEN 1 THEN problems.thumbnail_tag

I checked GRDB's source and it's using a fatalError with a dynamic message:

func fatalConversionError<T>(
    to: T.Type,
    from dbValue: DatabaseValue?,
    conversionContext: ValueConversionContext?,
    file: StaticString = #file,
    line: UInt = #line)
    -> Never
{
    fatalError(
        conversionErrorMessage(
            to: T.self,
            from: dbValue,
            conversionContext: conversionContext),
        file: file,
        line: line)
}

We can't see the error message in BugSnag

image image

I noticed there was this old PR fixing fatalError reporting #948 and #1010
I'm wondering if something's changed in the swift runtime that might have broken this.

Environment

  • Bugsnag version: v6.29.0
  • iOS/tvOS/macOS version(s): iOS 17.5.1
  • Simulator or physical device: Physical device
  • Xcode version: Xcode 15.4
  • Swift version: 5.10
@clr182
Copy link

clr182 commented Jul 16, 2024

Hi @0xpablo

Thank you for bringing this to our attention.

Although we were previously able to capture this message, it does appear that it is only available in debug builds using our current mechanism. We'll need to investigate this issue further to determine whether the message is available elsewhere in a location that we can access at crash time.

Can you confirm if you were previously seeing the message in Crashlytics, even in a release build?

@clr182 clr182 added awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. needs discussion Requires internal analysis/discussion labels Jul 16, 2024
@0xpablo
Copy link
Author

0xpablo commented Jul 16, 2024

Hi @0xpablo

Thank you for bringing this to our attention.

Although we were previously able to capture this message, it does appear that it is only available in debug builds using our current mechanism. We'll need to investigate this issue further to determine whether the message is available elsewhere in a location that we can access at crash time.

Can you confirm if you were previously seeing the message in Crashlytics, even in a release build?

Hi @clr182, yes, this is accessible in Crashlytics on release builds. AFAIK we don't have any specific config, and we haven't changed any build config when switching from Crashlytics to BugSnag.
This thread might be relevant: getsentry/sentry-cocoa#662

@clr182 clr182 removed the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Jul 17, 2024
@clr182
Copy link

clr182 commented Jul 18, 2024

Hi @0xpablo

Thank you for sharing.

We do have an item on our backlog aimed at investigating this issue further. However I should mention that this is not a trivial fix. As such I do not currently have a timeframe for this issue, however we will be sure to update you via this ticket thread once we have more information to share.

@clr182 clr182 added the backlog We hope to fix this feature/bug in the future label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future needs discussion Requires internal analysis/discussion
Projects
None yet
Development

No branches or pull requests

2 participants