unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: System calls without error checks in w32
Date: Mon, 31 May 2010 01:03:06 +0200	[thread overview]
Message-ID: <AANLkTinF27b0uziJtuYScRABZQEs25eG5HM6DuQPZ3NL@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimZa6XsUR9ssry-CyA7SQ-30iKvT4pspIloO_Tt@mail.gmail.com>

On Mon, May 31, 2010 at 00:37, Lennart Borgman
<lennart.borgman@gmail.com> wrote:

> Yes, my intention was not to add them everywhere, only on interesting places.

It didn't seem so in your first message.

> On a quick look I got the impression that file calls are better
> handled than GUI system calls.

Likely because file calls are much more likely to fail.

> It happens to me with my patched Emacs because that is the one I am
> using. I only use unpatched Emacs for bug testing etc.

Why don't you add these checks to your patched Emacs and see what comes of it?

> That is surely true, but I am not comfortable with how threads are
> integrated (i.e. it is not visible enough IMO). I wonder if there are
> any troubles there. Those threads of course communicate through system
> calls.

Do you wonder where "there are any troubles there", or do you suspect
that there are troubles?

> I might have fixed some of the problems with related to frames which
> calls crashes, but there might be more.

Well, perhaps you've fixed them, but as I've said, your Emacs seem to
crash more often than most others ;-)

> And I wonder why Emacs sometimes seems to hang temporarily when frame
> related operations are going on. Is something going wrong?

You'd have to be a bit more specific...

> And the inability to stop Emacs sometimes is quite disturbing. What is
> going on there? Why does not the GUI thread get resources? Or is it
> given resources but a block occur in some other way? Is GUI messages
> not checked when looping?

Also here.

> This type of entering the checks is very
> similar to what `assert' does in Emacs. Does that mean you think
> `assert' is very ugly too or is there some difference I am missing?

No, I quite like asserts. The difference is than assert is

  assert (some test)

There's nothing to understand there. It passes, or it fails.
W32DEBPRINT has four arguments; at the very least, if would make more
sense to do

   W32DEBPRINT (this_function, ApiFunction (args) != bad_return_value)

or somesuch, and, at that point, you're just reinventing assert, which
seems pointless.

Anyway, my feeling is that it makes much more sense to check return
codes *to do something* about them in the case of failure, that just
to print a message which will be helpful or not, depending of how
frequent / how informative they are. So if you're really interested in
doing this, I'd suggest looking at specific unchecked syscalls and
trying to determine if something (could / need to) be done in case of
error. And then send patches ;-)

    Juanma



  reply	other threads:[~2010-05-30 23:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-29  2:38 System calls without error checks in w32 Lennart Borgman
2010-05-29 17:43 ` Eli Zaretskii
2010-05-29 18:42   ` Lennart Borgman
2010-05-29 19:35     ` Eli Zaretskii
2010-05-29 20:02       ` Lennart Borgman
2010-05-29 21:25         ` Eli Zaretskii
2010-05-29 21:30           ` Lennart Borgman
2010-05-30  3:02             ` Eli Zaretskii
2010-05-30  3:26               ` Lennart Borgman
2010-05-30 17:36                 ` Eli Zaretskii
2010-05-30 18:02                   ` Lennart Borgman
2010-05-30 19:24                     ` Juanma Barranquero
2010-05-30 22:37                       ` Lennart Borgman
2010-05-30 23:03                         ` Juanma Barranquero [this message]
2010-05-30 23:28                           ` Lennart Borgman
2010-05-31  0:10                             ` Juanma Barranquero
2010-05-31  0:58                               ` Lennart Borgman
2010-05-31  2:02                                 ` Juanma Barranquero
2010-05-31  2:36                                   ` Lennart Borgman
2010-05-31  3:06                                     ` Juanma Barranquero
2010-05-31  3:05                         ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2010-05-31  9:18 grischka
2010-06-05 17:15 ` Jason Rumney
2010-06-07 10:37   ` grischka
2010-06-07 14:54     ` Stephen J. Turnbull
2010-06-07 15:23       ` Lennart Borgman
2010-06-07 17:21         ` grischka
2010-06-07 17:30           ` Lennart Borgman
2010-06-07 18:54             ` grischka
2010-06-08  0:32               ` Lennart Borgman
2010-06-08  0:34                 ` Lennart Borgman
2010-06-07 19:56         ` Stefan Monnier
2010-06-07 23:35           ` Lennart Borgman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=AANLkTinF27b0uziJtuYScRABZQEs25eG5HM6DuQPZ3NL@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).