Subject: segfault with bugnum

From: Ricardo Wurmus <[email-masked]>
Date: Thu, 11 Feb 2021 21:54:38 +0100

This program sometimes causes Guile 3.0.5 to segfault:

  (define a (expt 2 (expt 3 (expt 4 2))))
  (display (remainder a 1000000000))
  (display "\n")

And sometimes this program doesn’t terminate.  Here’s an example
session with the program saved to foo.scm:

--8<---------------cut here---------------start------------->8---
$ guile -s foo.scm
;;; note: source file /home/rekado/dev/gx/branches/master/foo.scm
;;;       newer than compiled /home/rekado/.cache/guile/ccache/3.0-LE-8-4.4/home/rekado/dev/gx/branches/master/foo.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/rekado/dev/gx/branches/master/foo.scm
;;; compiled /home/rekado/.cache/guile/ccache/3.0-LE-8-4.4/home/rekado/dev/gx/branches/master/foo.scm.go
176561152
$ [env] guile -s foo.scm
176561152
$ [env] guile -s foo.scm
Segmentation fault
$ [env] guile -s foo.scm
  C-c C-c # after more than 6 seconds
$ [env]   C-c C-c
$ [env] guile -s foo.scm
Segmentation fault
$ [env] guile -s foo.scm
176561152
$ [env] guile -s foo.scm
  C-c C-c
$ [env] guile -s foo.scm
176561152
--8<---------------cut here---------------end--------------->8---

-- 
Ricardo