bug#48566: call-with-blocked-asyncs does not like escape continuations

Maxime Devos <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Version: 3.0.5 (as found on Guix System, on a x86-64 system)

Here is a minimal reproducer.

(use-modules (ice-9 control))
(define (test)
  (define (safe-point)
    (call-with-unblocked-asyncs (lambda () 'hi)))
  (let/ec
    ec
    (call-with-blocked-asyncs
      (lambda () (system-async-mark ec) (safe-point))))
  (call-with-blocked-asyncs safe-point))
(test)

Output:

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure call-with-unblocked-asyncs: asyncs already unblocked

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
           2 (call-with-blocked-asyncs #<procedure safe-point ()>)
           1 (call-with-unblocked-asyncs #<procedure 7f83245ad2a0 at /home/sylvii…>)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

This bug was found while trying to test whether the definition of with-mutex
is correct in the present of asynchronicities (system-async-mark). (with-mutex
does not use call-with-blocked-asyncs & call-with-unblocked-asyncs, while I
think it should --- what if the Scheme code was interrupted in the 'in-guard'
or 'out-guard' of a dynamic-wind?).

Greetings,
Maxime.
signature.asc (application/pgp-signature, 260 B)
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYKfDhRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7oS5AP0ZAQKCS6WFu1GUnua1BcCelCTh
V5qRa3NbYX6/fE+AMQD/aOiJfljKBdtOxmoTB2Sbr9ikTzqQmLOHkuPX1S/MYg4=
=d8LU
-----END PGP SIGNATURE-----
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.