GNU bug report logs - #69730
Segfault in (spawn) when passed wrong port

Previous Next

Package: guile;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Mon, 11 Mar 2024 11:12:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tomas Volf <~@wolfsden.cz>
Subject: bug#69730: closed (Re: bug#69730: Segfault in (spawn) when passed
 wrong port)
Date: Mon, 06 May 2024 09:29:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#69730: Segfault in (spawn) when passed wrong port

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 69730 <at> debbugs.gnu.org.

-- 
69730: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69730
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: 69730-done <at> debbugs.gnu.org
Subject: Re: bug#69730: Segfault in (spawn) when passed wrong port
Date: Mon, 06 May 2024 11:27:36 +0200
Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> When I pass #f to spawn as a port, it just segfaults:
>
>     $ guile -c '(spawn "true" (list "") #:error #f)'
>     Segmentation fault

This was fixed a while back in the ‘main’ branch:

--8<---------------cut here---------------start------------->8---
$ guile -c '(spawn "true" (list "") #:error #f)'
Backtrace:
In ice-9/boot-9.scm:
  1755:12  6 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
           5 (apply-smob/0 #<thunk 7f6a52ad4300>)
In ice-9/boot-9.scm:
    724:2  4 (call-with-prompt ("prompt") #<procedure 7f6a52ae10c0 …> …)
In ice-9/eval.scm:
    619:8  3 (_ #(#(#<directory (guile-user) 7f6a52ad7c80>)))
In ice-9/command-line.scm:
   185:19  2 (_ #<input: custom-port 7f6a52ad1850>)
In unknown file:
           1 (eval (spawn "true" (list "") #:error #f) #<directory (…>)
           0 (spawn "true" ("") #:error #f)

ERROR: In procedure spawn:
In procedure spawn: Wrong type argument in position 5 (expecting open file port): #f
$ guix describe
Generation 301  May 05 2024 23:32:10    (current)
  shepherd 08dfcde
    repository URL: https://git.savannah.gnu.org/git/shepherd.git
    branch: devel
    commit: 08dfcde725e3b26f1e542a520c97a16aa9482802
  guile 3b76a30
    repository URL: https://git.savannah.gnu.org/git/guile.git
    branch: main
    commit: 3b76a30e3ca1f0b7ee7944836c2fc5660596b3bd
  guix d6c95d4
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: d6c95d4208a0cbc3ab742732865f9481c637660f
--8<---------------cut here---------------end--------------->8---

We ought to cut a release!

See <https://bugs.gnu.org/61073> and
5b42f8c154906584455a4989038406c88b723cb0.

Thanks,
Ludo’.

[Message part 3 (message/rfc822, inline)]
From: Tomas Volf <~@wolfsden.cz>
To: bug-guile <at> gnu.org
Subject: Segfault in (spawn) when passed wrong port
Date: Mon, 11 Mar 2024 12:10:31 +0100
[Message part 4 (text/plain, inline)]
Greetings,

When I pass #f to spawn as a port, it just segfaults:

    $ guile -c '(spawn "true" (list "") #:error #f)'
    Segmentation fault

Ignoring the fact whether #f should be an accepted value (I think it would be
more elegant and portable then (open-output-file "/dev/null")), I would not
expect invalid value in an interpreted language to cause a segfault.  If the
value is indeed invalid, it should throw an error.

Original report: https://emacs.ch/@kakafarm/112075808549752692

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 19 days ago.

Previous Next


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