From 704fd58ea0d87f6cbc6d6689698381a6654c6d7c Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 11 Sep 2009 13:19:59 +0000 Subject: [PATCH] 1.0.31.3: fix saving runtime options from executable cores Runtime options used to be clobbered from the executable core even if there were none saved there. Patch by Zach Beane. Fixes https://bugs.launchpad.net/sbcl/+bug/411925 --- NEWS | 5 +++++ src/runtime/coreparse.c | 6 +++++- tests/core.test.sh | 19 +++++++++++++++++++ version.lisp-expr | 2 +- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 543c78d..3197559 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,9 @@ ;;;; -*- coding: utf-8; fill-column: 78 -*- +changes relative to sbcl-1.0.31 + * bug fix: SAVE-LISP-AND-DIE option :SAVE-RUNTIME-OPTIONS did not work + correctly when starting from an executable core without saved runtime + options (reported by Faré Rideau, thanks to Zach Beane) + changes in sbcl-1.0.31 relative to sbcl-1.0.30: * improvement: stack allocation is should now be possible in all nested inlining cases: failure to stack allocate when equivalent code is manually diff --git a/src/runtime/coreparse.c b/src/runtime/coreparse.c index e8a513b..3ccdc23 100644 --- a/src/runtime/coreparse.c +++ b/src/runtime/coreparse.c @@ -83,12 +83,16 @@ read_runtime_options(int fd) void maybe_initialize_runtime_options(int fd) { + struct runtime_options *new_runtime_options; off_t end_offset = sizeof(lispobj) + sizeof(os_vm_offset_t) + (RUNTIME_OPTIONS_WORDS * sizeof(size_t)); lseek(fd, -end_offset, SEEK_END); - runtime_options = read_runtime_options(fd); + + if (new_runtime_options = read_runtime_options(fd)) { + runtime_options = new_runtime_options; + } } /* Search 'filename' for an embedded core. An SBCL core has, at the diff --git a/tests/core.test.sh b/tests/core.test.sh index 7393645..b483b68 100644 --- a/tests/core.test.sh +++ b/tests/core.test.sh @@ -85,4 +85,23 @@ else exit 1 fi +# saving runtime options _from_ executable cores +run_sbcl <