Closed Bug 1331984 Opened 8 years ago Closed 8 years ago

Crash: EncryptedJSON.cleartext -> static Bytes.decodeBase64 EXC_CRASH

Categories

(Firefox for iOS :: Sync, defect)

All
iOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Tracking Status
fxios 6.1 ---

People

(Reporter: sleroux, Assigned: rnewman)

References

Details

(Keywords: crash, steps-wanted)

Attachments

(3 files)

Pulled from the 6.0 (2) libsystem_kernel.dylib crash bucket. Looks to be related to related to syncing which might be a cause of the crashes we're seeing in [1] and [2]. Relevant stack frame: Thread 7 name: Thread 7: 0 Shared 0x0000000100bb0a54 static Bytes.decodeBase64(String) -> NSData + 152 (Bytes.swift:33) 1 Sync 0x00000001011dfebc EncryptedJSON.cleartext.getter + 232 (EncryptedJSON.swift:68) 2 Sync 0x000000010126c074 specialized KeyBundle.(factory<A where ...> ((JSON) -> A) -> (String) -> A?).(closure #1) + 244 (KeyBundle.swift:157) 3 Sync 0x00000001011cb45c specialized Sync15CollectionClient.(getSince(UInt64, sort : SortOption?, limit : Int?, offset : String?) -> Deferred<Maybe<StorageResponse<[Record<A>]>>>).(closure #1).(recordify #1)(JSON) -> Record<A>? + 456 (Record.swift:53) 4 Sync 0x00000001011df124 _TPA__TTSg5C4Sync11TabsPayload___TTRGRxC4Sync20CleartextPayloadJSONrXFo_oC6Shared4JSON_oGSqGCS_6Recordx__zoPs9ErrorType__XFo_iS2__iGSqGS3_x__zoPS4___ + 72 (StorageClient.swift:0) 5 Sync 0x00000001011df4e4 _TPA__TTSg5C4Sync13ClientPayload___TTRGRxC4Sync20CleartextPayloadJSONrXFo_oC6Shared4JSON_oGSqGCS_6Recordx__zoPs9ErrorType__XFo_iS2__iGSqGS3_x__zoPS4___ + 12 6 Sync 0x00000001011d01f4 specialized specialized SequenceType.flatMap<A> ((A.Generator.Element) throws -> A1?) throws -> [A1] + 256 (StorageClient.swift:0) 7 Sync 0x00000001011c8958 specialized Sync15CollectionClient.(getSince(UInt64, sort : SortOption?, limit : Int?, offset : String?) -> Deferred<Maybe<StorageResponse<[Record<A>]>>>).(closure #1) + 568 (StorageClient.swift:782) 8 Sync 0x00000001011de428 _TPA__TTSg5C4Sync11KeysPayload___TTRGRxC4Sync20CleartextPayloadJSONrXFo_oGV9Alamofire8ResponseC6Shared4JSONOS_18JSONSerializeError__dT__XFo_iGS2_S4_S5___dT__ + 120 (StorageClient.swift:0) 9 Sync 0x00000001011b71b8 specialized Sync15StorageClient.(errorWrap<A, B, C where ...> (Deferred<Maybe<A>>, handler : (Response<B, C>) -> ()) -> (Response<B, C>) -> ()).(closure #1) + 1128 (StorageClient.swift:408) 10 Sync 0x00000001011de520 _TPA__TTSg5C4Sync11KeysPayload___TTRGRxC4Sync20CleartextPayloadJSONrXFo_iGV9Alamofire8ResponseC6Shared4JSONOS_18JSONSerializeError__dT__XFo_oGS2_S4_S5___dT__ + 120 (StorageClient.swift:0) 11 Sync 0x0000000101277cb0 thunk + 88 (RequestExtensions.swift:0) 12 Alamofire 0x000000010071c61c Request.(response<A where ...> (queue : OS_dispatch_queue?, responseSerializer : A, completionHandler : (Response<A.SerializedObject, A.ErrorObject>) -> ()) -> Self).(closure #1).(closure #1) + 436 (ResponseSerialization.swift:142) [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1323045 [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1329826
That implies we're getting invalid base64. Exciting, and requires us to revisit the force-unwrap in that method.
Here's the failing code: public class func decodeBase64(b64: String) -> NSData { return NSData(base64EncodedString: b64, options: NSDataBase64DecodingOptions())! }
Severity: normal → critical
Keywords: crash, steps-wanted
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Hardware: Other → All
Attached file Pull req.
Attachment #8828061 - Flags: review?(sleroux)
Attachment #8828061 - Flags: review?(sleroux) → review+
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Next steps: Get a build to someone who is experiencing a start up crash and see if this resolves it and analyze the logs to see what's up. I'm going to NI myself to put together a build for this.
Flags: needinfo?(sleroux)
Flags: needinfo?(sleroux)
Attached file Log
Steph, I don't see this in https://github.com/mozilla-mobile/firefox-ios/commits/v6.x. Did this make it into 6.1? It not, can you uplift it? Here's an identical crash on 6.1. http://pastebin.com/ExJUZCm2
Flags: needinfo?(sleroux)
Unfortunately it looks like this was never uplifted for the 6.1 release. I've uplifted it: https://github.com/mozilla-mobile/firefox-ios/commit/a6696b427adeb846244e4a86311c9592e95126c6 We're about to branch off for v7.x this week. Do you think this warrants a 6.2 release?
Flags: needinfo?(sleroux) → needinfo?(rnewman)
If branching this week means several weeks of stabilization before release, then app store review… yeah, I think so. We still don't know where the malformed base64 is coming from, but this is a reproducible crash for affected users.
Flags: needinfo?(rnewman)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: