Re: freeze for sbcl-2.6.3

Andreas Franke via Sbcl-devel <[email protected]> Fri, 27 Mar 2026 12:08:21 +0000
Newsgroups gmane.lisp.steel-bank.devel
Message-ID <trinity-9fa9d526-8b4e-4caa-9da0-62a15d6c1313-1774613301025@trinity-msg-rest-gmx-gmx-live-844685db97-68ktw>
Let me quote Claude after some dialog; maybe that answers it:

- Pre-refactor: REQUIRED_FOREIGN_SYMBOLS = 197, *linkage-info* = 217 at save time. 20 warm-added symbols unresolved on restart. Crash at sqrt (entry 200).
- Post-refactor: same gap, same symbols, same crash. The refactor didn't introduce the bug.
- The bug [only] manifests on platforms taking the dlsym path: PPC64 BE, RISC-V, cross-compiled builds without elfcore.

Entry 200 (sqrt) is interesting -- def-math-rtn "sqrt" in irrat.lisp has #+ppc64 t which means on PPC64 it goes through the alien linkage table rather than inline. It's called during float-cold-init-or-reinit which runs inside the without-gcing block BEFORE foreign-reinit.

Here's the complete mapping:

Index Symbol Defined in
197 close_current_thread_tlab src/code/room.lisp:431 (extern-alien)
198 close_code_region src/code/room.lisp:1341 (extern-alien)
199 memcmp src/code/icf.lisp:145, src/code/string.lisp:113 (extern-alien)
200 sqrt src/code/irrat.lisp:109 (def-math-rtn, #+ppc64 t)
201 sb_get_os_thread_id src/code/alien-callback.lisp:373 (extern-alien)
202 environ (DATA) src/code/unix-foreign-load.lisp:80
203 waitpid src/code/run-program.lisp:105 (define-alien-routine)
204 wifcontinued src/code/run-program.lisp:145 (define-alien-routine)
205 wifstopped src/code/run-program.lisp:149 (define-alien-routine)
206 ptsname src/code/run-program.lisp:437 (define-alien-routine)
207 grantpt src/code/run-program.lisp:438 (define-alien-routine)
208 unlockpt src/code/run-program.lisp:439 (define-alien-routine)
209 spawn src/code/run-program.lisp:599 (define-alien-routine)
210 pspawn src/code/run-program.lisp:614 (define-alien-routine)
211 wait_for_exec src/code/run-program.lisp:628 (define-alien-routine)
212 gc_pathfind src/code/traceroot.lisp:235 (with-alien)
213 gc_and_save src/code/save.lisp:30 (define-alien-routine)
214 lisp_init_function (DATA) src/code/save.lisp:39 (define-alien-variable)
215 tot_gc_nsec (DATA) src/cold/warm.lisp:247 (extern-alien)
216 gc_coalesce_string_literals (DATA) (referenced from save.lisp/coalesce.c, Lisp ref via extern-alien)

Question about the "fix for non-elfinated platforms" -

Prior to "Remove REQUIRED-FOREIGN-SYMBOLS" the only foreign symbols the C runtime would prelink were those determined by Genesis and stored in REQUIRED-FOREIGN-SYMBOLS.That list was written in stone. So why is there a requirement to prelink more static symbols all of a sudden?

_______________________________________________
Sbcl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-devel