unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Michal Herko <michal.herko@disroot.org>
To: 42797@debbugs.gnu.org
Subject: bug#42797: starting thread from an used module dead lock
Date: Mon, 10 Aug 2020 11:57:51 +0200	[thread overview]
Message-ID: <ba10406841d6589b9543543e373a30f69fbdfc70.camel@disroot.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

Hello,
Attempint to start a new thread from a file loaded using *use-modules*
dead locks guile.

Create a file *start.scm*

```
(define-module (start))

(use-modules
  (ice-9 threads))

(call-with-new-thread
  (lambda ()
    (format #t "hello from thread\n")))
```

Create a file *use.scm*

```
(define-module (use))

(use-modules (start))
```

Execute start.scm:

    $ guile -L . start.scm

The program should print the message end exit.
Instead it would hang forever without using cpu.
The bug displays both on guile version 2.2.7 and 3.0.4.
I was testing on debian bullseye, x86_64.
The workaround is to use *load-from-path* instead of *use-modules*.
The bug does not manifest from REPL.






[-- Attachment #2: use.scm --]
[-- Type: text/x-scheme, Size: 77 bytes --]

(define-module (use))

(use-modules (start))

; (load-from-path "start.scm")

[-- Attachment #3: start.scm --]
[-- Type: text/x-scheme, Size: 135 bytes --]

(define-module (start))

(use-modules
  (ice-9 threads))

(call-with-new-thread
  (lambda ()
    (format #t "hello from thread\n")))



                 reply	other threads:[~2020-08-10  9:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba10406841d6589b9543543e373a30f69fbdfc70.camel@disroot.org \
    --to=michal.herko@disroot.org \
    --cc=42797@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).