Commit 8dec02c
committed
heap: clear thread-local error trace before unmapping pools
Pre-existing latent test crash on macOS-debug, surfaced once the
build matrix went green: an earlier test that took an error path
populated g_error_trace (lang/eval.c), then ray_heap_destroy
munmap'd the pools backing it, leaving the static pointer dangling.
The next test's ray_eval_str called ray_clear_error_trace, which
dereferenced the now-freed pointer and tripped AddressSanitizer.
test_datalog.c
datalog/agg_parse_count_scalar (line 786)
ray_eval_str("(rule (wcount ?n) (count ?n weight))")
-> ray_clear_error_trace
-> ray_release(g_error_trace)
-> SEGV cow.c:50
macOS asan unmaps freed pages so the deref crashes; Linux asan
leaves them mapped, which is why ubuntu-debug stayed green.
ray_heap_destroy now calls ray_clear_error_trace as the very first
step, while the pools are still mapped. Forward-decl in heap.c
keeps the layering intact (no #include of lang/eval.h from mem/).
Pre-existing bug — not caused by the fused-correctness branch.
The build-failure cascade kept the macOS-debug Test step from
running until now.1 parent b689047 commit 8dec02c
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1183 | 1189 | | |
1184 | 1190 | | |
1185 | 1191 | | |
1186 | 1192 | | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
1187 | 1199 | | |
1188 | 1200 | | |
1189 | 1201 | | |
| |||
0 commit comments