partition create writes the wrong extra family count when a partition has two custom family IDs
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
Direzione di ricerca
Inizia da partition_create_command::execute e segui il punto in cui viene popolato new_p.extra_families e aggiornato new_p.flags. Riproduci il problema con il JSON fornito usando picotool partition create, poi esamina il risultato con picotool info -a. Il lavoro è completato quando il numero di famiglie aggiuntive è 2 e gli ID di entrambe le famiglie sono elencati senza arresti anomali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
When a partition in the JSON passed to picotool partition create lists exactly two family IDs that are not one of the built in families, the generated partition table says the partition has three extra families. Only two family words are written, so anything that parses the table reads the name length word (or the next partition) as a third family ID. picotool info -a on the generated file crashes with a segmentation fault, and the bootrom would see a malformed table.
One or three custom families are encoded correctly; two are not.
What should happen
The ACCEPTS_NUM_EXTRA_FAMILIES field should be 2 and picotool info should list both families.
Repro (develop at ba3df40, also master at 2041936)
cat > pt.json << 'EOF2'
{
"version": [1, 0],
"unpartitioned": {
"families": ["absolute"],
"permissions": {"secure": "rw", "nonsecure": "rw", "bootloader": "rw"}
},
"partitions": [
{
"name": "A",
"size": "64K",
"families": ["rp2350-arm-s", "0x12345678", "0x23456789"],
"permissions": {"secure": "rw", "nonsecure": "rw", "bootloader": "rw"}
}
]
}
EOF2
picotool partition create pt.json pt.bin
picotool info -a pt.bin
partition create exits 0, info -a exits with signal 11. The partition flags word in pt.bin is 0xfc021180; bits 7 and 8 (ACCEPTS_NUM_EXTRA_FAMILIES) are 3.
Root cause
In partition_create_command::execute the count is ORed into new_p.flags inside the loop over families:
new_p.flags |= new_p.extra_families.size() << PICOBIN_PARTITION_FLAGS_ACCEPTS_NUM_EXTRA_FAMILIES_LSB;
With two extra families the field gets 1 and then 2 ORed in, which gives 3. With three it gets 1, 2 and 3, which happens to give 3. The count should be set once, after the loop.
- Lingua principale
- C++
- Stelle
- 1k
- Fork
- 194
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 raspberrypi/picotool
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
raspberrypi/picotool#371 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
raspberrypi/picotool#365 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
raspberrypi/picotool#347 ·
-
`--ser` with several RP2350s on USB sends PICOBOOT requests to the wrong interfaceForse già presa @will-v-pi l’ha presa 10 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
raspberrypi/picotool#370 · 2 commenti ·
-
`picotool config -s <field> 0` fails to write zero value to device.Forse già presa @will-v-pi l’ha presa 19 giorni fa. Aperta
raspberrypi/picotool#364 · 1 commento · 1 assegnatario ·
Tutte le issue di raspberrypi/picotool
Issue simili
-
artifact:simulation-scenario domain:physics good first issue help wanted role:validation testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
wxGetKeyState assert "Unsupported key 391" when typing numpad decimal in amount fields (GTK3)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
moneymanagerex/moneymanagerex#8600 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
NVIDIA/accelerated-computing-hub#294 ·
I maintainer di solito rispondono entro 4 giorni