Commit 10dead0
committed
fix: x86_64 SIGSEGV in Contract() with multi-module ethkit — Export linkage for all wrappers, keys_array GcHeader guard (v0.4.48)
Two fixes for x86_64-specific crash in ethkit Contract() with 20 compiled modules:
1. Wrapper functions for FuncRef callbacks (e.g., .map(resolveType)) now use
Linkage::Export instead of Linkage::Local. The wrapper names are already
scoped with module prefix (__wrapper_{prefix}__{name}) preventing symbol
collisions. Export linkage ensures func_addr produces linker-resolved
absolute addresses, which is more reliable than Cranelift-internal
resolution for Local symbols on x86_64 ELF.
2. Added cross-platform GcHeader type validation for keys_array pointers in
js_object_get_field_by_name. Linux lacked the macOS-only ASCII heuristic
guard, so corrupted keys_array pointers crashed with SIGSEGV instead of
returning undefined.1 parent 04f7998 commit 10dead0
5 files changed
Lines changed: 49 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1983 | 1983 | | |
1984 | 1984 | | |
1985 | 1985 | | |
1986 | | - | |
1987 | | - | |
1988 | | - | |
1989 | | - | |
1990 | | - | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
1991 | 1993 | | |
1992 | 1994 | | |
1993 | 1995 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1060 | 1060 | | |
1061 | 1061 | | |
1062 | 1062 | | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1063 | 1076 | | |
1064 | 1077 | | |
1065 | 1078 | | |
| |||
0 commit comments