[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Throw an exception when mutating read-only data
From: |
Andy Wingo |
Subject: |
Re: [PATCH] Throw an exception when mutating read-only data |
Date: |
Fri, 14 Apr 2017 10:44:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hi :)
On Sun 02 Apr 2017 17:34, Derek Upham <address@hidden> writes:
> Andy Wingo <address@hidden> writes:
>
>> * libguile/init.c (scm_i_init_guile): Install the SIGSEGV handler unless
>> GUILE_INSTALL_SIGSEGV_HANDLER is 0.
>> * libguile/loader.c
>> (scm_maybe_throw_exception_for_mutation_of_read_only_data): New public
>> function.
>> (sigsegv_handler): New helper.
>> (scm_install_sigsegv_handler): New public function.
>> * libguile/loader.h: Declare new API.
>
> That doesn’t support systems without HAVE_SIGACTION. Do we assume
> HAVE_SIGACTION for all systems these days?
I think we use Gnulib to ensure that sigaction is available, at least as
a wrapper. On the other hand apparently that doesn't ensure that
SA_SIGINFO is available on mingw :/ Too bad.
If we find a way to make this work reliably on POSIX I guess we could
have it work there but not yet on mingw.
> The handler setup code is outside of scmsig.c, so there will be
> conflicts with the save/restore mechanisms. For example,
> scm_restore_signals won’t re-establish that handler.
Good point! It seems this patch is but half-baked :)
Andy