Re: Testing how array-creation routines interact with continuations, and crashing when the user does something that "is an error". Bradley Lucier (09 Mar 2023 18:30 UTC)

Re: Testing how array-creation routines interact with continuations, and crashing when the user does something that "is an error". Bradley Lucier 09 Mar 2023 18:30 UTC

On 3/9/23 3:32 AM, Marc Nieper-Wißkirchen wrote:
> I think it is perfectly fine that the library crashes the system when
> one selects an "unsafe" mode of the implementation.
>
> After all, this is what is expected: By selecting an "unsafe" mode, I
> ask for maximal efficiency at the expense of comprehensive tests
> against programming errors.

Perhaps I should have been clearer.

In the given example, the system crashes even when
(specialized-array-default-safe?) is #t if the array library sample
implementation itself is compiled with (declare (not safe)) in Gambit.

As an example, the Gambit runtime library is compiled with (declare (not
safe)), but with enough checks that the system will not crash unless (a)
user code is compiled with (declare (not safe)) or (b) internal,
unexported, unsafe procedures are called by the user.

I'll look into how to rewrite the code so that perhaps an unexpected
answer is returned when continuations are manipulated by the arguments
to the procedures

array-{copy|append|stack|decurry|block}!

but still avoiding segfaults.

Brad