GNU bug report logs -
#32240
Segfault when execlp vim/nano
Previous Next
Reported by: ouzb65ty <ouzb65ty <at> protonmail.ch>
Date: Sat, 21 Jul 2018 18:00:02 UTC
Severity: normal
Tags: notabug
Done: Mark H Weaver <mhw <at> netris.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi,
ouzb65ty <ouzb65ty <at> 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
This bug report was last modified 6 years and 357 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.