master: Base-stringize alien linkage table names

snuglas via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  d17fc05a83a78e1998d2a6f7ba569695a4af6ae6 (commit)
      from  186fa8ba9f2245fd507f97208104c71d03ce7afe (commit)

- Log -----------------------------------------------------------------
commit d17fc05a83a78e1998d2a6f7ba569695a4af6ae6
Author: Seokjun Lee <[email protected]>
Date:   Thu Apr 9 11:01:05 2026 -0400

    Base-stringize alien linkage table names
    
    ensure-alien-linkage-index did not coerce names to simple-base-string,
    so define-alien-routine could insert simple-character-string names into
    the linkage table. This caused os_link_runtime() to crash with "GC
    invariant lost" and generate_elfcore_obj() to produce truncated ELF
    symbol names when saving :executable :elf-object cores.
---
 src/code/foreign.lisp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/code/foreign.lisp b/src/code/foreign.lisp
index 9d2280217..1a90bdde4 100644
--- a/src/code/foreign.lisp
+++ b/src/code/foreign.lisp
@@ -45,7 +45,8 @@
 
 ;;; Return the index of NAME+DATAP in the table, adding it if it doesn't exist.
 (defun ensure-alien-linkage-index (name datap)
-  (let* ((key (if datap (list name) name))
+  (let* ((name (possibly-base-stringize name))
+         (key (if datap (list name) name))
          (info *linkage-info*)
          (ht (car info)))
     (or (with-system-mutex ((hash-table-lock ht))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.