Skip to content

cvcgl_ariadne_labels: keep lastDrawn()'s copy alive before pointing into it - #1278

Merged
transfix merged 1 commit into
masterfrom
fix/ariadne-labels-dangling
Nov 16, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/ariadne-labels-dangling

Conversation

@transfix

@transfix transfix commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

cvcgl_ariadne_labels failed 3 of its 37 checks on every try in package-macos (both lanes of ci/full run 43673733499):

[FAIL] focus: the followed node's label is focus.scale (2) larger -- 0
[FAIL] focus: and back once the key moves on
[FAIL] follow: the label moves with its node

Cause: a dangling pointer in the test, not a label bug. LabelLayerNode::lastDrawn() returns its list by value. Five checks did b = drawn(layer->lastDrawn(), "Charlie"), which leaves b pointing into a temporary that is destroyed at the end of the statement. On Linux and Windows the freed block still held the old values, so the checks passed by luck. macOS's allocator reuses it, so b->size read 0. The size the layer computes can never be 0, because it is max(1, ...).

Fix (test only):

  • Each check now holds the lastDrawn() copy in d before searching it.
  • The rvalue overload of drawn() is = delete, so the pattern no longer compiles.
  • The "and back" check now prints the size it saw.

Verified:

…nto it

LabelLayerNode::lastDrawn() returns its list by value, and five checks took
drawn(layer->lastDrawn(), ...): a pointer into a temporary that is destroyed
at the end of the statement. On macOS the freed block is reused, so the
focus checks read size 0 and the follow check read garbage (3 of 37 failed
on every try in package-macos). Hold each copy in d first, and delete the
rvalue overload of drawn() so the pattern no longer compiles.
@transfix
transfix enabled auto-merge (squash) November 15, 2026 20:27
@transfix
transfix merged commit bd50da2 into master Nov 16, 2026
56 of 60 checks passed
@transfix
transfix deleted the fix/ariadne-labels-dangling branch November 16, 2026 03:28
transfix added a commit that referenced this pull request Nov 16, 2026
- script_engine.cpp: #1283 factors the sliced form's process lookup into calling_process,
  which run_as_program_work (a client's WebAssembly guest, run as its client's program) shares.
  The lookup keeps this branch's group: the calling process is on the group whose pump runs the
  call (an isolated document's), else on group 0.
- STATE_EXEC_THREADED.md: notes that run_as_program_work shares the lookup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant