Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
6b8df49b by Raymond Toy at 2024-08-22T14:18:22+00:00
Fix #262: arch_skip_inst invalid code
- - - - -
02430975 by Raymond Toy at 2024-08-22T14:18:49+00:00
Merge branch 'issue-262-fix-arch-skip-inst-invalid' into 'master'
Fix #262: arch_skip_inst invalid code
Closes #262
See merge request cmucl/cmucl!248
- - - - -
1 changed file:
- src/lisp/x86-arch.c
Changes:
=====================================
src/lisp/x86-arch.c
=====================================
@@ -29,7 +29,13 @@
* included here.
*/
static const unsigned char ud1[] = {0x0f, 0xb9};
-
+
+/*
+ * Extract the error trap code from the UD1 instruction. BYTE must be
+ * the 3rd byte of the UD1 instruction that represents the mod r/m
+ * byte.
+ */
+#define UD1_CODE(modrm) ((modrm) & 0x3f)
/*
* Set to positive value to enabled debug prints related to the sigill
@@ -161,7 +167,8 @@ arch_skip_instruction(os_context_t * context)
*/
pc += sizeof(ud1);
- code = *pc++;
+ code = UD1_CODE(*pc++);
+
SC_PC(context) = (unsigned long) pc;
switch (code) {
@@ -187,7 +194,7 @@ arch_skip_instruction(os_context_t * context)
break;
default:
- fprintf(stderr, "[arch_skip_inst invalid code %d\n]\n", code);
+ fprintf(stderr, "[arch_skip_inst invalid code 0x%x\n]\n", code);
break;
}
@@ -387,7 +394,7 @@ sigill_handler(HANDLER_ARGS)
* number is placed in the low 6-bits of the 3rd byte of the
* instruction.
*/
- trap = *(((char *)SC_PC(context)) + 2) & 0x3f;
+ trap = UD1_CODE(*(((char *)SC_PC(context)) + sizeof(ud1)));
DPRINTF(debug_handlers, (stderr, "code = %x\n", trap));
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/b614f974decf204770b377…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/b614f974decf204770b377…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-262-fix-arch-skip-inst-invalid at cmucl / cmucl
Commits:
570d67ec by Raymond Toy at 2024-08-22T13:17:50+00:00
Apply 2 suggestion(s) to 1 file(s)
Co-authored-by: Carl Shapiro <cshapiro(a)panix.com>
- - - - -
1 changed file:
- src/lisp/x86-arch.c
Changes:
=====================================
src/lisp/x86-arch.c
=====================================
@@ -35,7 +35,7 @@ static const unsigned char ud1[] = {0x0f, 0xb9};
* the 3rd byte of the UD1 instruction that represents the mod r/m
* byte.
*/
-#define UD1_CODE(byte) ((byte) & 0x3f)
+#define UD1_CODE(modrm) ((modrm) & 0x3f)
/*
* Set to positive value to enabled debug prints related to the sigill
@@ -394,7 +394,7 @@ sigill_handler(HANDLER_ARGS)
* number is placed in the low 6-bits of the 3rd byte of the
* instruction.
*/
- trap = UD1_CODE(*(((char *)SC_PC(context)) + 2));
+ trap = UD1_CODE(*(((char *)SC_PC(context)) + sizeof(ud1)));
DPRINTF(debug_handlers, (stderr, "code = %x\n", trap));
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/570d67ecc5141c3c01ee096…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/570d67ecc5141c3c01ee096…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-262-fix-arch-skip-inst-invalid at cmucl / cmucl
Commits:
47e545bb by Raymond Toy at 2024-08-21T19:15:22-07:00
Print the invalid code as hex, not a signed integer.
We used to print -55. It now prints as 0xc9, which is more helpful in
determining. (Of course this won't actually be printed anymore since
the code is now the low 6 bits of the byte.)
- - - - -
1 changed file:
- src/lisp/x86-arch.c
Changes:
=====================================
src/lisp/x86-arch.c
=====================================
@@ -194,7 +194,7 @@ arch_skip_instruction(os_context_t * context)
break;
default:
- fprintf(stderr, "[arch_skip_inst invalid code %d\n]\n", code);
+ fprintf(stderr, "[arch_skip_inst invalid code 0x%x\n]\n", code);
break;
}
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/47e545bbc1b6c7f542ff351…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/47e545bbc1b6c7f542ff351…
You're receiving this email because of your account on gitlab.common-lisp.net.
Carl Shapiro pushed to branch master at cmucl / cmucl
Commits:
5a310229 by Carl Shapiro at 2024-08-21T03:16:56+00:00
Remove underscore prefix from include guard macros
- - - - -
dcb1f7a3 by Carl Shapiro at 2024-08-21T03:16:57+00:00
Merge branch 'fix-include-guard' into 'master'
Remove underscore prefix from include guard macros
See merge request cmucl/cmucl!242
- - - - -
30 changed files:
- src/lisp/Darwin-os.h
- src/lisp/FreeBSD-os.h
- src/lisp/Linux-os.h
- src/lisp/NetBSD-os.h
- src/lisp/OpenBSD-os.h
- src/lisp/alloc.h
- src/lisp/alpha-lispregs.h
- src/lisp/alpha-validate.h
- src/lisp/amd64-lispregs.h
- src/lisp/arch.h
- src/lisp/breakpoint.h
- src/lisp/cgc.h
- src/lisp/core.h
- src/lisp/dynbind.h
- src/lisp/elf.h
- src/lisp/fdlibm.h
- src/lisp/gc.h
- src/lisp/gencgc.h
- src/lisp/globals.h
- src/lisp/hppa-lispregs.h
- src/lisp/hppa-validate.h
- src/lisp/hpux-os.h
- src/lisp/interr.h
- src/lisp/interrupt.h
- src/lisp/irix-os.h
- src/lisp/lisp.h
- src/lisp/lispregs.h
- src/lisp/mach-os.h
- src/lisp/mips-lispregs.h
- src/lisp/mips-validate.h
The diff was not included because it is too large.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/4683b2415e1e513840fe79…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/4683b2415e1e513840fe79…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-348-u_int64_t-to-uint64_t at cmucl / cmucl
Commits:
84b956b5 by Raymond Toy at 2024-08-21T02:34:59+00:00
Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Carl Shapiro <cshapiro(a)panix.com>
- - - - -
1 changed file:
- src/lisp/os-common.c
Changes:
=====================================
src/lisp/os-common.c
=====================================
@@ -12,6 +12,7 @@
#include <math.h>
#include <netdb.h>
#include <pwd.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/84b956b5727292d09312306…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/84b956b5727292d09312306…
You're receiving this email because of your account on gitlab.common-lisp.net.