From 883d68803d17d6f64cdabf2c8ef846345e2d0094 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sun, 19 Feb 2023 10:20:19 +0100 Subject: [PATCH] Dynamically allocate the alternate signal stack. This patch is a backport of https://github.com/ocaml/ocaml/pull/10266. --- ocaml-src/asmrun/signals_asm.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ocaml-src/asmrun/signals_asm.c b/ocaml-src/asmrun/signals_asm.c index 3895d75..d37b481 100644 --- a/ocaml-src/asmrun/signals_asm.c +++ b/ocaml-src/asmrun/signals_asm.c @@ -182,7 +182,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) #ifdef HAS_STACK_OVERFLOW_DETECTION static char * system_stack_top; -static char sig_alt_stack[SIGSTKSZ]; #if defined(SYS_linux) /* PR#4746: recent Linux kernels with support for stack randomization @@ -274,15 +273,19 @@ void caml_init_signals(void) #ifdef HAS_STACK_OVERFLOW_DETECTION { stack_t stk; - struct sigaction act; - stk.ss_sp = sig_alt_stack; + stk.ss_sp = malloc(SIGSTKSZ); stk.ss_size = SIGSTKSZ; stk.ss_flags = 0; - SET_SIGACT(act, segv_handler); - act.sa_flags |= SA_ONSTACK | SA_NODEFER; - sigemptyset(&act.sa_mask); - system_stack_top = (char *) &act; - if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } + if (stk.ss_sp != NULL) { + if (sigaltstack(&stk, NULL) != -1) { + struct sigaction act; + SET_SIGACT(act, segv_handler); + act.sa_flags |= SA_ONSTACK | SA_NODEFER; + sigemptyset(&act.sa_mask); + system_stack_top = (char *) &act; + sigaction(SIGSEGV, &act, NULL); + } + } } #endif } -- 2.38.1 ption>
path: root/gnu/packages/gps.scm
AgeCommit message (Expand)Author
2023-07-09gnu: gpsd: Download using mirror uri....* gnu/packages/gps.scm (gpsd)[source]: Rewrite source uri to use download mirrors. Efraim Flashner
2023-03-02gnu: gama: Update to 2.24....* gnu/packages/gps.scm (gama): Update to 2.24. Efraim Flashner
2022-10-25gnu: gama: Update to 2.23....* gnu/packages/gps.scm (gama): Update to 2.23. Efraim Flashner
2022-08-27gnu: scons: Move to (gnu packages build-tools)....* gnu/packages/python-xyz.scm (scons, scons-python2): Move from here ... * gnu/packages/build-tools.scm (scons, scons-python2): ... to here. * gnu/packages/direct-connect.scm, gnu/packages/disk.scm, gnu/packages/game-development.scm, gnu/packages/gps.scm, gnu/packages/image.scm, gnu/packages/installers.scm, gnu/packages/web.scm, gnu/packages/xdisorg.scm: Adjust module imports accordingly. * guix/build-system/scons.scm (default-scons): Likewise. Marius Bakke
2022-07-31gnu: qttools: Rename to qttools-5....Automated with: git grep -l qttools | xargs sed 's/\bqttools\b/\0-5/g' -i git checkout NEWS Maxim Cournoyer
2022-07-31gnu: qtsvg: Rename variable to qtsvg-5....This is in preparation of the qtsvg update to version 6. This change was automated via the following command: git grep -l '\bqtsvg\b' | xargs sed 's/qtsvg/qtsvg-5/g' -i Maxim Cournoyer
2022-07-17gnu: gama: Update to 2.21....* gnu/packages/gps.scm (gama): Update to 2.21. Efraim Flashner