Avoid asking for arrays that are too big.

Aperta
#141 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
api, backend

Direzione di ricerca

Start with the JSON serialization path that writes to a ByteArrayOutputStream, then search the repository for other ByteArrayOutputStream uses and direct array allocations. Trace where oversized arrays can raise "Requested array size exceeds VM limit" and identify where a B2JsonException can be thrown instead. Done means the relevant allocation paths handle this failure without an OutOfMemoryError terminating the JVM.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

If someone tries to serialize a json structure that's too close to Integer.MAX_VALUE bytes, ByteArrayOutputStream will fail while trying to grow its array. The failure is particularly annoying because it's an OutOfMemoryError and it will kill the JVM. The exception's message is "Requested array size exceeds VM limit".

It'd be nice if we threw a B2JsonException instead of killing the JVM. ;)

I know this can happen during serialization. We should also look for other places we use a ByteArrayOutputStream and places we might allocate an array more directly.

Lingua principale
Java
Stelle
103
Fork
23
Merge medio
5g 8h
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Backblaze/b2-sdk-java

Tutte le issue di Backblaze/b2-sdk-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.