[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 22/58: Fix error reporting in 'load-thunk-from-memory'.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 22/58: Fix error reporting in 'load-thunk-from-memory'. |
Date: |
Tue, 7 Aug 2018 06:58:33 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit a44c2a679f2af8d44812a97ddaeb910561f1a568
Author: Mark H Weaver <address@hidden>
Date: Mon Jun 11 01:06:34 2018 -0400
Fix error reporting in 'load-thunk-from-memory'.
Previously 'load-thunk-from-memory' would often throw to 'system-error'
based on a stale value in 'errno', leading to incorrect error messages.
* libguile/loader.c (load_thunk_from_memory): Set 'errno' to 0 before
jumping to cleanup in the ABORT preprocessor macro, and also in the case
when 'process_dynamic_segment' reports an error.
---
libguile/loader.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libguile/loader.c b/libguile/loader.c
index b562693..f4ddfed 100644
--- a/libguile/loader.c
+++ b/libguile/loader.c
@@ -348,7 +348,7 @@ process_dynamic_segment (char *base, Elf_Phdr *dyn_phdr,
return NULL;
}
-#define ABORT(msg) do { err_msg = msg; goto cleanup; } while (0)
+#define ABORT(msg) do { err_msg = msg; errno = 0; goto cleanup; } while (0)
static SCM
load_thunk_from_memory (char *data, size_t len, int is_read_only)
@@ -469,7 +469,10 @@ load_thunk_from_memory (char *data, size_t len, int
is_read_only)
if ((err_msg = process_dynamic_segment (data, &ph[dynamic_segment],
&init, &entry, &frame_maps)))
- goto cleanup;
+ {
+ errno = 0; /* not an OS error */
+ goto cleanup;
+ }
if (scm_is_true (init))
scm_call_0 (init);
- [Guile-commits] 11/58: doc: Fix typo about SRFI-4 syntax., (continued)
- [Guile-commits] 11/58: doc: Fix typo about SRFI-4 syntax., Andy Wingo, 2018/08/07
- [Guile-commits] 09/58: 'select' returns empty sets upon EINTR and EAGAIN., Andy Wingo, 2018/08/07
- [Guile-commits] 14/58: Recognize RISC-V compilation targets., Andy Wingo, 2018/08/07
- [Guile-commits] 21/58: goops: Fix 'instance?' to work on objects that aren't structs., Andy Wingo, 2018/08/07
- [Guile-commits] 10/58: build: Use 'sed' invocation compatible with BSD sed., Andy Wingo, 2018/08/07
- [Guile-commits] 24/58: Add copyright header for (language elisp falias), and fix typo., Andy Wingo, 2018/08/07
- [Guile-commits] 29/58: get-bytevector-n and get-bytevector-n! can now read more than 4 GB, Andy Wingo, 2018/08/07
- [Guile-commits] 26/58: tests: Add SRFI-71 test., Andy Wingo, 2018/08/07
- [Guile-commits] 34/58: Add 'scm_to_stringn' shortcut when converting to UTF-8., Andy Wingo, 2018/08/07
- [Guile-commits] 12/58: srfi-18: When timeout is a number, it's a relative number of seconds., Andy Wingo, 2018/08/07
- [Guile-commits] 22/58: Fix error reporting in 'load-thunk-from-memory'.,
Andy Wingo <=
- [Guile-commits] 19/58: Fix type inference for bitwise logical operators., Andy Wingo, 2018/08/07
- [Guile-commits] 23/58: elisp: Fix cross-compilation support., Andy Wingo, 2018/08/07
- [Guile-commits] 33/58: Module import obarrays are accessed in a critical section., Andy Wingo, 2018/08/07
- [Guile-commits] 38/58: GDB support: Fix 'display-vm-frames'., Andy Wingo, 2018/08/07
- [Guile-commits] 41/58: linker: Don't rely on out-of-range bv-ref exceptions., Andy Wingo, 2018/08/07
- [Guile-commits] 40/58: GDB support: Add 'guile-backtrace' command., Andy Wingo, 2018/08/07
- [Guile-commits] 27/58: Make module autoloading thread-safe., Andy Wingo, 2018/08/07
- [Guile-commits] 51/58: compile: Improve error message., Andy Wingo, 2018/08/07
- [Guile-commits] 28/58: vm: Fix typo when checking for 'madvise' error code., Andy Wingo, 2018/08/07
- [Guile-commits] 30/58: doc: Fix typo., Andy Wingo, 2018/08/07