From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#6126: 24.0.50; Segmentation fault when w32-shell-execute try to open an unassociated file Date: Fri, 07 May 2010 12:27:12 +0300 Message-ID: <83fx24jc3z.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1273241012 25923 80.91.229.12 (7 May 2010 14:03:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 May 2010 14:03:32 +0000 (UTC) Cc: 6126@debbugs.gnu.org, cymacs@gmail.com To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 07 16:03:30 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OAO9H-0005fJ-4D for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 May 2010 16:03:27 +0200 Original-Received: from localhost ([127.0.0.1]:52811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAO9G-0007Hq-8R for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 May 2010 10:03:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OANZF-0002Tq-CJ for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 09:26:13 -0400 Original-Received: from [140.186.70.92] (port=49880 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANZ2-0008PH-Sc for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 09:26:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAKI0-000105-Lc for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 05:56:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42514) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAKI0-0000zu-Jm for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 05:56:12 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OAJte-0004QT-FE; Fri, 07 May 2010 05:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 May 2010 09:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6126-submit@debbugs.gnu.org id=B6126.127322461517003 (code B ref 6126); Fri, 07 May 2010 09:31:02 +0000 Original-Received: (at 6126) by debbugs.gnu.org; 7 May 2010 09:30:15 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAJss-0004QC-P7 for submit@debbugs.gnu.org; Fri, 07 May 2010 05:30:14 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAJsq-0004Q7-MZ for 6126@debbugs.gnu.org; Fri, 07 May 2010 05:30:13 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L2100G00MC2G000@a-mtaout20.012.net.il> for 6126@debbugs.gnu.org; Fri, 07 May 2010 12:29:14 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.0.144]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L2100CBXMCPM9I0@a-mtaout20.012.net.il>; Fri, 07 May 2010 12:29:14 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 07 May 2010 05:31:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36768 Archived-At: > From: Lennart Borgman > Date: Fri, 7 May 2010 02:00:49 +0200 > Cc: 6126@debbugs.gnu.org > > - In w32_error the argument error_no has type int. It should be more > easy to understand if it had the type DWORD which is what GetLastError > returns. Will using int be correct on all w32 platforms? Yes. DWORD is an unsigned 32-bit integer type on all versions of Windows, even on 64-bit Windows. (I agree that it would be better to use `unsigned int' rather than just `int', though.) > - The call to error in w32-shell-execute has only two arguments. Is > that correct? Yes, the other arguments are optional, see the doc string. > error in eval.c takes four arguments. `error' accepts a variable-size argument list, like `printf'. This is stated in the commentary in eval.c. > - The parameter lpBuffer to FormatMessage has the type LPTSTR. Is it > correct to call that with *char (ie buf)? Yes. LPTSTR is defined as a `char *' in non-Unicode builds, and as a `wchar_t *' in Unicode builds (which we don't yet support in Emacs, but we should, some day). > It looks in the backtrace > like even the argument a1 to error is incorrect. If you mean these parts of the backtrace: a1=0x40008048
, a2=0x40008048
, a3=0x40008048
) at eval.c:2078 then it looks like `error' handles that just fine, because the value of `args[]' computed from them is correct: args = { 0x137bc48 "\317\265\315\263\325\322\262\273\265\275\326\270\266\250\265\304\316\304\274\376\241\243\r\n", 0x465fc78 "C:\\abc.ttt", 0x0} Maybe the problem happens because the error string (args[0]) is encoded in a locale-specific encoding, so perhaps calling build_string on it is not TRT.