all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: 6126@debbugs.gnu.org, cymacs@gmail.com
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	[thread overview]
Message-ID: <83fx24jc3z.fsf@gnu.org> (raw)
In-Reply-To: <z2xe01d8a51005061700h9f09bdcaja2038074acf3065e@mail.gmail.com>

> From: Lennart Borgman <lennart.borgman@gmail.com>
> 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 <Address 0x40008048 out of bounds>,
    a2=0x40008048 <Address 0x40008048 out of bounds>,
    a3=0x40008048 <Address 0x40008048 out of bounds>) 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.






  parent reply	other threads:[~2010-05-07  9:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 16:08 bug#6126: 24.0.50; Segmentation fault when w32-shell-execute try to open an unassociated file Chunyu Wang
2010-05-07  0:00 ` Lennart Borgman
2010-05-07  1:52   ` Chunyu Wang
2010-05-07  9:27   ` Eli Zaretskii [this message]
2010-05-07 10:52     ` Lennart Borgman
2010-05-07  9:03 ` Eli Zaretskii
2010-05-07 12:17   ` Chunyu Wang
2010-05-07 14:21   ` Chunyu Wang
2010-05-07 15:12     ` Eli Zaretskii
2010-05-07 16:29       ` Chunyu Wang
2010-05-07 17:16         ` Eli Zaretskii
2010-05-07 20:52           ` Lennart Borgman
2010-05-08  7:15             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fx24jc3z.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=6126@debbugs.gnu.org \
    --cc=cymacs@gmail.com \
    --cc=lennart.borgman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.