unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: ouzb65ty <ouzb65ty@protonmail.ch>
Cc: 32240@debbugs.gnu.org
Subject: bug#32240: Segfault when execlp vim/nano
Date: Thu, 02 Aug 2018 11:03:27 -0400	[thread overview]
Message-ID: <871sbgx134.fsf@netris.org> (raw)
In-Reply-To: <UrzCbf8ybgZ260RuIHtJ6G_aK-xXHDHcmyszD_LZzsHYWp9vrVWeLs8IXw9TJbozu4ILWJ7ZvCnLOQ5VHsWY8fhznMWucqzNPYHu-UwOGg8=@protonmail.ch> (ouzb65ty's message of "Sat, 21 Jul 2018 12:26:30 -0400")

Hi,

ouzb65ty <ouzb65ty@protonmail.ch> writes:

> When I call (execlp "vim") or (execlp "nano") in Guile :
> Fatal error 11: Segmentation fault[1]    31380 segmentation fault  guile test.scm

When calling the 'exec*' procedures, in both Scheme and C, you should
pass at least two arguments.  The first argument is the program to run,
and the second argument will become argv[0] in the executed program.
Normally this should be the program name again, although in some cases
it is useful to pass a different value as argv[0].

Note that in the Guile manual, the entry for 'execlp' begins by saying
that it's "Similar to 'execl', however ...", and the description of
'execl' states: "If ARG is missing, FILENAME is executed with a null
argument list, which may have system-dependent side-effects."

On my GNU/Linux system, I see this:

  scheme@(guile-user)> (execlp "ls")
  A NULL argv[0] was passed through an exec system call.
  Aborted

Based on your report, I guess that on Darwin it leads to a segfault.

In any case, you are using 'execlp' incorrectly.  It might be that we
should raise an error at the Scheme level if these procedures are called
with only one argument.

Anyway, does it work if you run (execlp "vim" "vim") instead?

      Mark





      reply	other threads:[~2018-08-02 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-21 16:26 bug#32240: Segfault when execlp vim/nano ouzb65ty
2018-08-02 15:03 ` Mark H Weaver [this message]

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=871sbgx134.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=32240@debbugs.gnu.org \
    --cc=ouzb65ty@protonmail.ch \
    /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).