From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#32240: Segfault when execlp vim/nano Date: Thu, 02 Aug 2018 11:03:27 -0400 Message-ID: <871sbgx134.fsf@netris.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1533224093 27602 195.159.176.226 (2 Aug 2018 15:34:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Aug 2018 15:34:53 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 32240@debbugs.gnu.org To: ouzb65ty Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Aug 02 17:34:49 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flFcm-00074n-Co for guile-bugs@m.gmane.org; Thu, 02 Aug 2018 17:34:48 +0200 Original-Received: from localhost ([::1]:46425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flFet-0003k6-6f for guile-bugs@m.gmane.org; Thu, 02 Aug 2018 11:36:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flFA4-0000Fz-2y for bug-guile@gnu.org; Thu, 02 Aug 2018 11:05:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flF9y-0001zL-Gl for bug-guile@gnu.org; Thu, 02 Aug 2018 11:05:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34106) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1flF9y-0001z7-Bn for bug-guile@gnu.org; Thu, 02 Aug 2018 11:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1flF9y-0004TY-3N for bug-guile@gnu.org; Thu, 02 Aug 2018 11:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 02 Aug 2018 15:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32240 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 32240-submit@debbugs.gnu.org id=B32240.153322229917192 (code B ref 32240); Thu, 02 Aug 2018 15:05:02 +0000 Original-Received: (at 32240) by debbugs.gnu.org; 2 Aug 2018 15:04:59 +0000 Original-Received: from localhost ([127.0.0.1]:39124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flF9u-0004TE-Jv for submit@debbugs.gnu.org; Thu, 02 Aug 2018 11:04:58 -0400 Original-Received: from world.peace.net ([64.112.178.59]:52228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flF9s-0004T1-Vx for 32240@debbugs.gnu.org; Thu, 02 Aug 2018 11:04:57 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1flF9n-0008Ha-AC; Thu, 02 Aug 2018 11:04:51 -0400 In-Reply-To: (ouzb65ty's message of "Sat, 21 Jul 2018 12:26:30 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9100 Archived-At: Hi, ouzb65ty 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