Crash on update to Build 30

RESOLVED FIXED

Status

()

Firefox for iOS
Data Storage
--
blocker
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: rnewman, Assigned: rnewman)

Tracking

({crash})

unspecified
Unspecified
iOS
crash

Firefox Tracking Flags

(fxios+)

Details

Attachments

(1 attachment)

47 bytes, text/x-github-pull-request
sleroux
: review+
bnicholson
: review+
Details | Review | Splinter Review
(Assignee)

Description

3 years ago
https://gist.github.com/sleroux/968b706df81ac45fb42a#file-testflight-crash

Storage!_TFFC7Storage12BrowserTable11updateTableFS0_FTCS_18SQLiteDBConnection4fromSi2toSi_SbU_FCS_5SDRowSS + 0x108
     fp = 0x000000016fdfc850    lr = 0x00000001005b11f4
     sp = 0x000000016fdfc840    pc = 0x00000001005c4c14
    Found by: previous frame's frame pointer
(Assignee)

Comment 1

3 years ago
            let urls = db.executeQuery("SELECT DISTINCT url FROM \(TableHistory)", factory: { $0["url"] as! String })

versus

            "url TEXT UNIQUE, " +                 // May only be null for deleted records.

That looks like one possible culprit.
(Assignee)

Comment 2

3 years ago
I can repro with a SIGABRT at that line with a similar stack if I null out a URL in the DB. The log shows

  Could not cast value of type '__NSCFNumber' (0x10cd8ccf0) to 'NSString' (0x10bebd8e0).

which is presumably a null -> 0 sqlite/SwiftData confusion.
(Assignee)

Comment 3

3 years ago
Created attachment 8646082 [details] [review]
Pull req.
Attachment #8646082 - Flags: review?(sleroux)
Attachment #8646082 - Flags: review?(sarentz)
Attachment #8646082 - Flags: review?(bnicholson)
Comment on attachment 8646082 [details] [review]
Pull req.

The code looks good. What scenario would we have a null url? Would this happen if we try restoring a saved 'home panel' tab?
Attachment #8646082 - Flags: review?(sleroux) → review+
Attachment #8646082 - Flags: review?(bnicholson) → review+
(Assignee)

Comment 5

3 years ago
This would happen if you have a deleted history item that hasn't yet synced to the server. There might be other root causes that I haven't yet identified.
(Assignee)

Comment 6

3 years ago
b48f840
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
(Assignee)

Updated

3 years ago
Attachment #8646082 - Flags: review?(sarentz)
You need to log in before you can comment on or make changes to this bug.