Skip to content

fix(runtime): crashes and hangs from choice/thread scoping bugs #170 - #173

Merged
JBenda merged 10 commits into
masterfrom
fix/170-broken-scopes
Sep 20, 2026
Merged

JBenda merged 10 commits into
masterfrom
fix/170-broken-scopes

Conversation

@JBenda

@JBenda JBenda commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Problems:

  • Local variables leaked between choices. -> each choice opens a new temporary scope
  • An not closed START_TAG marker trapped all content before it -> dangling tags are closed at NEWLINE, END and thread completion !! validate if we want to throw away the tag
  • Choice tags were pointers to runner's tag, which were invalidated at array growth -> Choice tags reference runner's tag by index
  • list_table::redifen() assigned pointer before allocating new memory
  • list_table::get_var() hands out pointer to a resizable array, which leads to invalid pointer if too many handles are requested -> new concept managed_instances: a non continouse container each time it growth it allocates an additionl chunk (for non dyanmic cases it behaves the same)
  • Fixed list_flag values printing through the wrong value::get<>() tag (list instead of list_flag).

Problems:
- Local variables leaked between choices.
  -> each choice opens a new temporary scope
- An not closed `START_TAG` marker  trapped all content before it
  -> `dangling tags` are closed at NEWLINE, END and thread completion
  !! validate if we want to throw away the tag
- Choice tags were pointers to runner's tag, which were invalidated at array growth
  -> Choice tags reference runner's tag by index
- `list_table::redifen()` assigned pointer before allocating new memory
- `list_table::get_var()` hands out pointer to a resizable array,
  which leads to invalid pointer if too many handles are requested
  -> new concept `managed_instances`: a non continouse container
  each time it growth it allocates an additionl chunk (for non dyanmic cases it behaves the same)
- Fixed `list_flag` values printing through the wrong `value::get<>()`
  tag (`list` instead of `list_flag`).
@github-actions

Copy link
Copy Markdown

Ink Proof Results

These results are obtained by running the Ink-Proof Testing Suite on the compiled binaries in this pull request.

System Results
Linux x64 130/130 passed
MacOSX-ARM DISABLED
MacOSX DISABLED
Windows x64 83/130 passed

@JBenda
JBenda merged commit d38608d into master Sep 20, 2026
21 checks passed
t0mg added a commit to t0mg/inkcpp that referenced this pull request Sep 20, 2026
t0mg added a commit to t0mg/inkcpp that referenced this pull request Sep 20, 2026
@JBenda
JBenda deleted the fix/170-broken-scopes branch September 24, 2026 12:56
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