Simulator crashes (SIGSEGV) on first CCC control: JSON_DIAGNOSTICS define in ccc-message.h causes nlohmann::json layout mismatch
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 66/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, json
- Ambito
- build-system, networking
Direzione di ricerca
Apri contrib/oran-interface/model/ccc-message.h e guarda le due righe #define immediatamente sopra #include <nlohmann/json.hpp>; cerca nell’albero con grep altri usi di JSON_DIAGNOSTICS/JSON_NO_IO prima di eliminarli. Ricompila i moduli oran-interface e nr in modo che entrambi i lati del percorso di controllo E2 concordino sul layout di nlohmann::json. Fatto assomiglia ai passaggi di riproduzione nell’issue (nearRT-RIC, scratch/RF_Reconfiguration.cc, xapp_rf_reconfiguration) in esecuzione per 60 s senza SIGSEGV, con i controlli CCC confermati invece del timeout dell’xApp.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, and thank you for RIC-TaaP. It has been very useful for my research on xApp testing.
I ran into a crash with the RF Channel Reconfiguration xApp and found what I think is the cause, with a simple fix.
Environment
- Ubuntu 22.04.5, aarch64 (VM on Apple Silicon), ns-3.42, gcc 11.4
- FlexRIC
f56d4487507c7ace392f1ec3f598e7eeda670acc - oran-interface: MinaYonan123/oran-interface @
95fba5a(branchadd-CCC, MinaYonan123/oran-interface#11) - nr: MinaYonan123/ns3-oran-lena-nr @
35eeab6(branchCCC-on-Lena, MinaYonan123/ns3-oran-lena-nr#7)
Steps to reproduce
./nearRT-RIC./ns3 run "scratch/RF_Reconfiguration.cc --report_to_db=false --simTime=60s --indicationPeriodicity=0.1"./xapp_rf_reconfiguration
What happens
The simulator crashes with SIGSEGV on the first CCC control message (with any antenna mask). No CONTROL ACK is sent, so the xApp aborts with Timeout. No response from the E2 Node and the RIC keeps printing Pending event timeout happened.
The crash is in NrGnbNetDevice::CCCcontrolMessageReceivedCallback, called from e2ap_handle_RICControlRequest, when it first reads the decoded message (first in PrintControlMessage; with the print disabled, in the name == "O-NESPolicy" comparison).
Cause
contrib/oran-interface/model/ccc-message.h has these lines before #include <nlohmann/json.hpp>:
#define JSON_DIAGNOSTICS 1
#define JSON_NO_IO 1
JSON_DIAGNOSTICS adds a hidden field to every nlohmann::json, which changes its size. Code that includes ccc-message.h first gets the larger type, and code that includes nlohmann/json.hpp without the define gets the normal one. So the same type has two layouts in one program.
In the disassembly, the decoder steps through the cell list in 0x320-byte items, but the callback in the nr module uses 0x310-byte items. The callback then reads the wrong memory and crashes.
I only tested on ARM, but the cause does not depend on the architecture.
Fix
Removing the two defines from ccc-message.h and rebuilding fixed it. Both sides then use the same item size (0x310). A full 60 s run completed with no crash, and 116 CCC controls were sent, acknowledged and applied. The antenna ports followed the traffic as expected (4 → 2 → 1 → 2 → 4).
Other notes
I also have two small fixes, one for a thread race in the CCC callback and one for the end-of-run Bad file descriptor error (as in discussion #10). I'm happy to share them separately if useful.
Thanks again for your work on this project.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 78
- Fork
- 38
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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
- 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 Orange-OpenSource/ns-O-RAN-flexric
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Orange-OpenSource/ns-O-RAN-flexric#51 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
Orange-OpenSource/ns-O-RAN-flexric#50 · 1 commento ·
Tutte le issue di Orange-OpenSource/ns-O-RAN-flexric
Issue simili
-
🔨 tool 🧰 library
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Orange-OpenSource/Orange-Boosted-Bootstrap#4038 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
simnJS/AnyPS5#735 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
unoplatform/uno#27024 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage package:ffigen
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno