You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sort() SIGSEGV: array_keys() result holds cell keys under a string[] return claim (whole-program only) #609
sort() on the result of AnalyzeIndex::implementersOf() segfaults in manticore_sort$mono$p0_vec_str: the element word is NaN-boxed (0xfff4…) and is dereferenced as a string pointer.
implementersOf() (/** @return string[] */) builds its result with array_keys($seen), and the IR fills it through __mir_array_key_cell_at, so the elements are CELLS. The caller trusts the string[] claim and calls the vec<str> specialisation of sort. Either the return must convert the elements to the claimed representation, or sort must not take the vec_str path for a buffer whose hint is cell.
Repro
Whole-program only: the same class and call sequence compiled alone pass. On the LSP stack (br lsp-server, rebased on main a04798c, with #608):
bash tests/semantic/run.sh -k index_incremental
A minimal repro will be attached when there is one.
Regression: this test passed on the stack before the rebase (main 3b44bde).
Root cause: the stdlib bootstrap twin __mc_sort_native was compiled into the program, and Monomorphize repointed the call to __mc_sort_native$mono$p0_vec_str, so the emitter never asked the builtin. The twin returns false, and sort()'s PHP fallback read the cell words as strings. Single-file repro and fix: #611.
Activity
blacktrs commentedon Nov 9, 2026
Root cause: the stdlib bootstrap twin
__mc_sort_nativewas compiled into the program, and Monomorphize repointed the call to__mc_sort_native$mono$p0_vec_str, so the emitter never asked the builtin. The twin returns false, and sort()'s PHP fallback read the cell words as strings. Single-file repro and fix: #611.