Repository navigation
Fix the segfault on Ctrl-C; print slot drops only at shutdown - #20
Merged
Merged
Conversation
libe3 0.2.5 deletes every SM inside agent.stop() (SmRegistry::clear()), but main() still used two of them afterwards: - spectrum_ptr->stop(), to unload the prb_block codelet: a call into a deleted object, so every Ctrl-C ended in a segfault (exit 139), with or without prb_block.enabled; - layer1_ptr->drops_summary(), for the shutdown summary: a read of freed memory. Stop the slot pipeline first, since its worker is the only thread that bumps the L1-KPM counters, take the summary, then stop the agent. The prb_block codelet is unloaded through main's own relay, which outlives the SM; the Spectrum SM has normally done it already, inside agent.stop(). Fixes #19. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
With slot_filter.ue_free_only, every UL slot a UE transmits in is a ue_busy drop, so "[E3SMLayer1] dropped N slot(s) in the last second" was printed every second for as long as a UE was attached. Those drops are by design, and every fault already prints its own message (geometry mismatch, a helper that wrote nothing, a short blob, an encode or a send failure). The counters stay: the shutdown summary prints them by reason, and logging.drops_log_path still writes one CSV row per second. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
aferaudo
added a commit
that referenced
this pull request
Nov 11, 2026
With prb_block.enabled (off by default), a dApp's Spectrum SM PRB blacklist control (RAN function 1, control 1) reaches ocudu's scheduler, which keeps every PDSCH and PUSCH allocation off those PRBs, in every slot, DL and UL, until the next control replaces the list. PUCCH, PDCCH, SSB, PRACH, SRS and CSI-RS keep their PRBs. - The first RAN function 1 subscription loads the new prb_block codelet on ocudu's sched_prb_block hook, instead of the eCPRI IQ pipeline; the last one unloads it, which clears the block. PrbBlockRelay hands the newest block to the gNB from the main loop and ACKs it then; the codelet reports the first scheduler slot that applies it. A PRB outside the carrier, a full queue or no codelet is a NACK. - New shared header codelets/include/jbpf_e3_prb_block_api.h, byte-identical with ocudu's copy. - Spectrum SM: the current e3sm_spectrum.asn grammar, plus the legacy Spectrum-IQDataIndication section, whose bytes do not change; the SM types are generated with libe3's codec set. - Closed-loop stage records, and tools/latrec_closed_loop.py, which joins the controller's and the dApp's rings. - The controller stops without the SMs libe3 already deleted, and prints slot drops only in the shutdown summary (#20). Fixes #19. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent.stop(), andmain()still used two of them afterwards. Now the slot pipeline stops first, the drop summary is taken, and only then does the agent stop. Theprb_blockcodelet is unloaded through main's own relay, which outlives the SM.[E3SMLayer1] dropped N slot(s) in the last second. Withslot_filter.ue_free_only, every UL slot a UE transmits in is aue_busydrop, so this line was printed every second while a UE was attached. The counters stay: the shutdown summary prints them by reason, andlogging.drops_log_pathstill writes the CSV.main.Tested (x86, Ubuntu 22.04, GCC 11.4, Release, on e61d7fd):
prb_block.enabledtrue and false: before, exit 139 (SIGSEGV) both times; after, exit 0 with the drop summary andStopped..test_l1_kpm_smandtest_spectrum_smpass.Type of change
Linked issue
Closes #19
Twin-repo coordination
Paired PR(s): none.
🤖 Generated with Claude Code