From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: System calls without error checks in w32 Date: Mon, 31 May 2010 01:03:06 +0200 Message-ID: References: <83ocfytxhg.fsf@gnu.org> <83mxvitsay.fsf@gnu.org> <83ljb2tn6i.fsf@gnu.org> <83k4qmt7lb.fsf@gnu.org> <83hblpthpt.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1275260617 26319 80.91.229.12 (30 May 2010 23:03:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 May 2010 23:03:37 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 31 01:03:36 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@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 1OIrXb-00015q-Gg for ged-emacs-devel@m.gmane.org; Mon, 31 May 2010 01:03:35 +0200 Original-Received: from localhost ([127.0.0.1]:40488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIrXb-0001HL-2o for ged-emacs-devel@m.gmane.org; Sun, 30 May 2010 19:03:35 -0400 Original-Received: from [140.186.70.92] (port=39204 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIrXV-0001D3-8g for emacs-devel@gnu.org; Sun, 30 May 2010 19:03:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIrXT-00031Q-Vn for emacs-devel@gnu.org; Sun, 30 May 2010 19:03:29 -0400 Original-Received: from fg-out-1718.google.com ([72.14.220.153]:18574) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIrXT-00031I-PR; Sun, 30 May 2010 19:03:27 -0400 Original-Received: by fg-out-1718.google.com with SMTP id 16so943378fgg.12 for ; Sun, 30 May 2010 16:03:26 -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; bh=AEFVp7ouVNLlnwRNisLRGwjwV0lp+8zzBiFOoYydpeI=; b=V4+E4V2fulRdURtcmvNAm9e6LX5T7Ht9HZ9WAWicwcYUg3zC4ijgJBKvrv/5Bv2OFP DMAFSy6m6/8WCQkr+clGee0kkRpEJlQJgygp2PH5mD2Fg/dqTC9lvAJydz1Dbe1vySK3 hdr+CCIi+d6sIPZmWmEuTWJdIO17us0lc+5qE= 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; b=xv1ylk4zpFNUbNTQ6gOaAkI63Y6UIWR8C8v4W6ve+BpwkEzIrXDwgbLUZEE8E8KS+A Ah/gdZW4bRGkvBK3/cir7VgEujVCTTFIGM/GtxyXqfn61lutyGQei8SfMNpARIgOXy4x dCTCO1ssStC2fsspRaQ8umz8gGPPWysQyA6jg= Original-Received: by 10.103.127.8 with SMTP id e8mr1460135mun.39.1275260606162; Sun, 30 May 2010 16:03:26 -0700 (PDT) Original-Received: by 10.204.32.18 with HTTP; Sun, 30 May 2010 16:03:06 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125376 Archived-At: On Mon, May 31, 2010 at 00:37, Lennart Borgman 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