Repository navigation
Conversation
dg_puml_operand set *label up front but *id only on its success paths, so an opener without its closer (`Alice ->: x`, `[-> Alice: x`, `class [Unclosed`) returned with *id unwritten. dg_puml_relation and dg_puml_decl then read an uninitialized dg_str_t and passed it to dg_element, which crashed the index worker on some stacks. The operand now starts with an empty id, so those lines take the existing `!lid.n` / `!rid.n` exits and declarations make no element. Fixes DeusData#2818 Signed-off-by: Rodion Kazennov <nefayran@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Written with Codex on behalf of @pcristin. I’m closing our duplicate #2829 in favor of this earlier PR. The independent results below are for our signed-off commit f61fcf69, whose production initializer matches this PR; the regression tests differ. Additional coverage is available in On Linux x86_64:
Full local command: CBM_TEST_PAR_JOBS=2 CBM_TAIL_JOBS=1 scripts/test.sh \
BUILD_DIR=build/issue-2818-full CC=clang-20 CXX=clang++-20 \
'CXX_STDLIB=-lstdc++ -fsanitize-link-c++-runtime'Limits: broader logs contain UBSan warnings in unchanged Perl, signature and RST paths also reported in #2814; the whole suite is not claimed sanitizer-clean. A whole-tree manual tidy sweep was stopped at 40/242 files after confirming existing findings. An initial entry hit an unchanged selector-fixture SIGPIPE; the unchanged rerun passed. Our Linux CI full leg, TSan, CodeQL, lint and static security also passed. Overall CI was not green: the UI job failed during |
Fixes #2818
What does this PR do?
dg_puml_operandset*labelat the start but*idonly on its success paths. When an opener has no closer, as in a message to or from the diagram edge (Alice ->: x,Alice <-: x,[-> Alice: x) or a declaration such asclass [Unclosed, it returned with*idunwritten.dg_puml_relationanddg_puml_declthen passed an uninitializeddg_str_ttodg_element, which crashed the index worker on some stacks.The fix sets
*idto an empty string at the start ofdg_puml_operand, next to*label. The relation callers then take their existing!lid.n/!rid.nexits, so an edge message is skipped, anddg_elementreturns NULL for a declaration with no id. Other PlantUML lines are not affected.diagrams_plantuml_edge_messagesintests/test_diagrams.cextracts a file with the three edge forms, the unclosed declaration and one normal message, and checks that it gives the two participants and the oneAlice -> Bobarrow.How I checked it, on macOS with Apple clang:
internal/cbm/diagram.cinto a small driver that runs the PlantUML extractor on one source, built three ways. With-ftrivial-auto-var-init=pattern,Alice ->: x,Alice <-: x,[-> Alice: xandclass [Unclosedeach segfault. A plain-O1build segfaults on[-> Alice: x. Under ASan the same line reports a global-buffer-overflow read indg_element, called fromdg_puml_relation, andAlice ->: xproduces an arrow to a garbage element.diagram.candtests/test_diagrams.ccompile with the project's-Wall -Wextra -Werrorflags.I have not run
scripts/test.shlocally yet, so CI is the first full run of the suite.Written with Claude Code (Claude Opus 5.5).
Checklist
git commit -s)make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)