From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6126: 24.0.50; Segmentation fault when w32-shell-execute try to open an unassociated file Date: Fri, 7 May 2010 12:52:00 +0200 Message-ID: References: <83fx24jc3z.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273239447 19498 80.91.229.12 (7 May 2010 13:37:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 May 2010 13:37:27 +0000 (UTC) Cc: 6126@debbugs.gnu.org, cymacs@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 07 15:37:21 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 1OANjy-0008J6-18 for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 May 2010 15:37:19 +0200 Original-Received: from localhost ([127.0.0.1]:36114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANju-0002tL-Uj for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 May 2010 09:37:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OANUs-0007jA-AD for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 09:21:42 -0400 Original-Received: from [140.186.70.92] (port=47322 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANUm-00066P-RV for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 09:21:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OALE4-0007ej-Ui for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 06:56:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59259) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OALE4-0007ed-RL for bug-gnu-emacs@gnu.org; Fri, 07 May 2010 06:56:12 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OALB0-000522-G1; Fri, 07 May 2010 06:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman 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 10:53: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.127322954719327 (code B ref 6126); Fri, 07 May 2010 10:53:02 +0000 Original-Received: (at 6126) by debbugs.gnu.org; 7 May 2010 10:52:27 +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 1OALAQ-00051g-GZ for submit@debbugs.gnu.org; Fri, 07 May 2010 06:52:27 -0400 Original-Received: from mail-fx0-f44.google.com ([209.85.161.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OALAN-00051Z-OC for 6126@debbugs.gnu.org; Fri, 07 May 2010 06:52:24 -0400 Original-Received: by fxm4 with SMTP id 4so685310fxm.3 for <6126@debbugs.gnu.org>; Fri, 07 May 2010 03:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=SZ8GnavYfb8p9T/oBA3IEZp4nPSnxOJkaVUfteve/xo=; b=U83f7uwVTh0j0Av8gK0tNHiYXolgQBLh6CjHzxTtYsNeH63ACb2h9qwyj9DmNfxL5e 3yi4DvuXKRODvZsig6uIzIfhFVnl5owuvj8d5cVXPqv7v5ZLxtIISBiy/kGBUL+ulNC7 CMlDo4Iy3pJBTrdJz/BEiNiNE4047gPKZeNus= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=hQjfx71pZ94NwOdXPX8xqqArpPUhyAAf0t3+bu93X8JcLfqkQ7P7xrVUmWxiZd8ILR SA004G1Dtm90Fx/+QWBvCQFnm0oqUJmFlWooeJ8z0r8vywE3G1U05/3SYO0oNXjoELmS HTu7n2PVEMi8DY8QFRhFu9HNQ0rR4MP/TPNxY= Original-Received: by 10.239.137.69 with SMTP id k5mr299153hbk.38.1273229540124; Fri, 07 May 2010 03:52:20 -0700 (PDT) Original-Received: by 10.239.164.81 with HTTP; Fri, 7 May 2010 03:52:00 -0700 (PDT) In-Reply-To: <83fx24jc3z.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 07 May 2010 06:53: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:36765 Archived-At: On Fri, May 7, 2010 at 11:27 AM, Eli Zaretskii wrote: >> 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. =C2=A0DWORD is an unsigned 32-bit integer type on all versions of > Windows, even on 64-bit Windows. =C2=A0(I agree that it would be better t= o > use `unsigned int' rather than just `int', though.) Hi Eli, Wouldn't it be better to just use DWORD which is what is used in the ms docs for GetLastError etc? Maybe that would confuse newcomers quite a bit less? >> - 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'. =C2=A0This = is > stated in the commentary in eval.c. Oh, sorry. Thanks. >> - The parameter lpBuffer to FormatMessage has the type LPTSTR. Is it >> correct to call that with *char (ie buf)? > > Yes. =C2=A0LPTSTR 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). When that has been done I think using LPTSTR would be best. Maybe putting a note there why it is not LPTSTR today would be good? >> It looks in the backtrace >> like even the argument a1 to error is incorrect. > > If you mean these parts of the backtrace: > > =C2=A0 =C2=A0a1=3D0x40008048
, > =C2=A0 =C2=A0a2=3D0x40008048
, > =C2=A0 =C2=A0a3=3D0x40008048
) at eval.= c:2078 > > then it looks like `error' handles that just fine, because the value > of `args[]' computed from them is correct: It just looked strange to me that they all three have the same value. Is that how it normally looks then a2 and a3 are not given? > =C2=A0 =C2=A0 =C2=A0 =C2=A0args =3D { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x137bc48 > "\317\265\315\263\325\322\262\273\265\275\326\270\266\250\265\304\316\304= \274\376\241\243\r\n", > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x465fc78 "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. I guess it is sometning with the encoding, but I really have no more accurate idea of it.