GNU bug report logs - #62469
‘throw’ introduces a continuation barrier

Previous Next

Package: guile;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sun, 26 Mar 2023 21:36:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: 62469 <at> debbugs.gnu.org
Subject: bug#62469: ‘throw’ introduces a continuation barrier
Date: Sun, 26 Mar 2023 23:35:42 +0200
‘throw’ introduces a continuation barrier as of Guile 3.0.9:

--8<---------------cut here---------------start------------->8---
$ cat ~/src/guile-debugging/suspendable-continuation.scm
(use-modules (ice-9 control))

(let ((tag (make-prompt-tag)))
  (call-with-prompt tag
    (lambda ()
      (catch #t
        (lambda ()
          (pk 'suspendable-from-catch? tag (suspendable-continuation? tag))
          (throw 'whatever))
        (const #t)
        (lambda args
          (pk 'suspendable-from-exn-handler? tag (suspendable-continuation? tag)))))
    (const #t)))
$ guile ~/src/guile-debugging/suspendable-continuation.scm

;;; (suspendable-from-catch? ("prompt") #t)

;;; (suspendable-from-exn-handler? ("prompt") #f)
--8<---------------cut here---------------end--------------->8---

Apparently this is because that goes through ‘scm_throw’ via
‘intrinsics.c’.

A practical consequence is that a REPL running in Fibers on non-blocking
ports enters an endless “Attempt to suspend fiber within continuation
barrier” loop when it starts a recursive REPL due to an uncaught
exception.

Ludo’.




This bug report was last modified 2 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.