unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#32240: Segfault when execlp vim/nano
@ 2018-07-21 16:26 ouzb65ty
  2018-08-02 15:03 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: ouzb65ty @ 2018-07-21 16:26 UTC (permalink / raw)
  To: 32240

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

Hello,

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

Guile --version :
guile (GNU Guile) 2.2.3

Vim --version :
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr  4 2017 18:14:54)

Nano --version :
GNU nano version 2.0.6 (compiled 14:26:45, Oct 14 2016)

uname -a :
Darwin e1r5p17.42.fr 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

My .guile is empty, I think it's probably a bug with termcaps..

[-- Attachment #2: Type: text/html, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#32240: Segfault when execlp vim/nano
  2018-07-21 16:26 bug#32240: Segfault when execlp vim/nano ouzb65ty
@ 2018-08-02 15:03 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2018-08-02 15:03 UTC (permalink / raw)
  To: ouzb65ty; +Cc: 32240

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-02 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-21 16:26 bug#32240: Segfault when execlp vim/nano ouzb65ty
2018-08-02 15:03 ` Mark H Weaver

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).