Closed
Description
[REQUIRED] Step 2: Describe your environment
- Xcode version: 11.0 Beta 6
- Firebase SDK version: 6.7.0
- Firebase Component: Storage
- Component version: 6.7.0
[REQUIRED] Step 3: Describe the problem
Upon completion of uploadTasks, in about 1/3 of cases the app crashes with EXC_BAD_ACCESS (SIGSEGV)
Steps to reproduce:
- Initialize a simple app with 1 table view controller
- Sign in with Firebase Auth
- kick off an upload task (either from a file or Data, 1MB) on a cell press
- see it crashing once upload is complete.
NOTE: it doesn't crash on every single upload, crashes about 1/3 of the time.
Relevant Code:
func tableView(_ tableView:UITableView, didSelectRowAt indexPath:IndexPath){ // TODO: Expand cell, add sharing / uploading guardlet user =Auth.auth().currentUser,let email = user.email else{ // handle sign in experience return}letitem=items[indexPath.row]letstorageRef=Storage.storage().reference()letitemsRef= storageRef.child("items")letuserBucketRef= itemsRef.child(email)letfileName= item.fileURL.lastPathComponent letfileRef= userBucketRef.child(fileName)letuploadTask= fileRef.putFile(from: item.fileURL, metadata:nil){[weak self] metadata, error inguard error ==nilelse{letalert=UIAlertController(title:"Error", message: error?.localizedDescription, preferredStyle:.alert) alert.addAction(UIAlertAction(title:"OK", style:.default))self?.show(alert, sender:nil)return} // Happy path log(.debug,"Upload done!")} uploadTask.enqueue()}
Gist with full crash log: https://gist.github.com/supermarin/b9fe575cd95efeb905e3b771f0fd883c