Commit 58e1f43
committed
fix(macos): drop overly-broad *NamedStruct heap-promotion; cross-platform stacktrace filter helper
- codegen/funcs.go: revert auto-promote of every *NamedStruct return as
heap-owned. The check (added in e174b34) was too broad: user code that
allocates via raw mem::calloc and returns *Tin-struct (e.g. an explicit
list_node[T]::cons constructor) was treated as RC-owned, then ARC's
scope-exit release_ptr ran on memory the user had already manually
freed via mem::free -- double-free, intermittent hangs in test
sequences (manifested on macOS recursive_generic_structs.tin). The
await-call-site path (stmts.go from the same commit) still covers the
channel-of-pointer leak that motivated the original change. Verified
arc_stress + fiber + channel-pointer-stress valgrind output unchanged.
- stdlib/source/source.tin: add is_program_entry to recognise main /
start / _start / __libc_start_main as the OS-tail frames. On Linux
these surface as libc.so.6:__libc_start_main and is_in_lib catches
them; on macOS dladdr returns the program binary itself (no .dylib
suffix) so the same frames slipped through.
- examples/stacktrace_filter_pipe.tin: thread is_program_entry through
in_user_code so the strict-subset assertion holds on macOS too.1 parent 955f65d commit 58e1f43
3 files changed
Lines changed: 24 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2165 | 2165 | | |
2166 | 2166 | | |
2167 | 2167 | | |
2168 | | - | |
2169 | | - | |
2170 | | - | |
2171 | | - | |
2172 | | - | |
2173 | | - | |
2174 | | - | |
2175 | | - | |
2176 | | - | |
2177 | | - | |
2178 | | - | |
2179 | | - | |
2180 | | - | |
2181 | | - | |
2182 | | - | |
2183 | | - | |
2184 | | - | |
2185 | | - | |
2186 | | - | |
2187 | 2168 | | |
2188 | 2169 | | |
2189 | 2170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
244 | 258 | | |
245 | 259 | | |
246 | 260 | | |
247 | 261 | | |
248 | 262 | | |
249 | | - | |
| 263 | + | |
250 | 264 | | |
0 commit comments