bug#68350: Segmentation fault using list-head with negative k

Tomas Nordin <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Hello List

If this has been reported before I didn't find it. Here's the recipe:

$ guile -q
GNU Guile 3.0.8
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (list-head '(1 2 3) -1)
Segmentation fault

Argument -1 is an improper argument and an error is expected, but not a
segmentation fault.

With positive integers out of bounds I see an exception, not segfault.

This is an apt-installed guile on Debian

$ dpkg -l | grep guile
ii  guile-3.0                               3.0.8-2                                      amd64        GNU extension language and Scheme interpreter
ii  guile-3.0-doc                           3.0.8-2                                      all          Documentation for Guile 3.0
ii  guile-3.0-libs:amd64                    3.0.8-2                                      amd64        Core Guile libraries

Thanks for all the work

--
Tomas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.