Crash on iOS when re-using background URLSession identifier
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- swift
- Ambito
- mobile, networking
Direzione di ricerca
The affected entry point is TUSClient.deinit; inspect how the URLSession configuration identifier distinguishes background from foreground sessions. Reproduce the reuse case with a background identifier and verify that deinitialization no longer invalidates that session while foreground sessions still finish and invalidate their tasks.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
TUSClient.deinit finishes and invalidates the session even when it's a background session. In my app I was re-using the same session ID after changing service environments (prod/staging/dev) and that causes this crash:
BackgroundSession <5B232D47-B8F1-4848-9A69-8196786E5921> attempted to create a NSURLSessionDataTask in a session that has been invalidated
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Task created in a session that has been invalidated'
*** First throw call stack:
(0x18ce25044 0x18a2bdabc 0x18e51c780 0x18e31997c 0x18e31607c 0x103cb2064 0x103ca919c 0x18e3170c4 0x18e31932c 0x1106bd630 0x1106dd500 0x1106b4944 0x103c98584 0x103cb2064 0x103ca091c 0x103ca15a4 0x103cad894 0x103caceb0 0x21720ca0c 0x21720caac)
libc++abi: terminating due to uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Task created in a session that has been invalidated'
*** First throw call stack:
(0x18ce25044 0x18a2bdabc 0x18e51c780 0x18e31997c 0x18e31607c 0x103cb2064 0x103ca919c 0x18e3170c4 0x18e31932c 0x1106bd630 0x1106dd500 0x1106b4944 0x103c98584 0x103cb2064 0x103ca091c 0x103ca15a4 0x103cad894 0x103caceb0 0x21720ca0c 0x21720caac)
terminating due to uncaught exception of type NSException
Should TUSClient.deinit only finish and invalidate tasks when it's a foreground session and its configuration identifier is nil? That fixes the issue here and I think it's correct, but wanted to talk it over before opening up a PR.
- Lingua principale
- Swift
- Stelle
- 245
- Fork
- 129
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tus/TUSKit
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
visionOS support !Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Issue simili
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
manaflow-ai/cmux#59692 ·
I maintainer di solito rispondono entro 1 giorno
-
-32042 without elicitations drops JSON-RPC error dataForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
modelcontextprotocol/swift-sdk#381 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
App 仍在下载和解析用不上的会话列表Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
vibe-cafe/vibe-usage-app#125 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
touyou/CheckItOut#39 ·
I maintainer di solito rispondono entro 1 giorno