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: Sun, 30 May 2010 21:24:33 +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 1275247504 20950 80.91.229.12 (30 May 2010 19:25:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 May 2010 19:25:04 +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 Sun May 30 21:25:03 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 1OIo86-0005lk-Tm for ged-emacs-devel@m.gmane.org; Sun, 30 May 2010 21:25:03 +0200 Original-Received: from localhost ([127.0.0.1]:41479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIo85-00012P-S0 for ged-emacs-devel@m.gmane.org; Sun, 30 May 2010 15:25:01 -0400 Original-Received: from [140.186.70.92] (port=56519 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIo7z-00010d-Mi for emacs-devel@gnu.org; Sun, 30 May 2010 15:24:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIo7y-0006Ga-Gp for emacs-devel@gnu.org; Sun, 30 May 2010 15:24:55 -0400 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:44188) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIo7y-0006GK-Bu; Sun, 30 May 2010 15:24:54 -0400 Original-Received: by fxm11 with SMTP id 11so2444575fxm.0 for ; Sun, 30 May 2010 12:24:53 -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=pbpJyQ+akLNSKHpJWUxSAE0VJwdTyA8RzNjmejDsj/I=; b=rf6ijzY9y1PHfXebViHxzAKTnODU3sWIQ3ivf8CkHzHj1G3WExbDaRjJyIuz+28Fxb ClLiGfWzaMKvKyBEFFZNgdoC21cGP8Jwixitq9KkelIqjffszCPzO929v+KHAtnsIBJY zjG4+ZuSWWNimo8NXscfp9SlL9Yt/WxPS3bOo= 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=eH8fkx/F0ik8lvloKVhXjAaKqdl9LRI3zOAXQ1uqNZm9+3SryZPTeEm6L5OiilHj6A 1kQ/lLXuFNZAE51icKDJ+nTboUsF0HnXuqRtxaj+SUmVIncLQJwZ5vXJykL63BBsvU4F /C0giyRDbJKwZORi0Zjm1r7FAa/NdBb2SUXKI= Original-Received: by 10.103.64.25 with SMTP id r25mr1256612muk.68.1275247493149; Sun, 30 May 2010 12:24:53 -0700 (PDT) Original-Received: by 10.204.32.18 with HTTP; Sun, 30 May 2010 12:24:33 -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:125369 Archived-At: On Sun, May 30, 2010 at 20:02, Lennart Borgman wrote: > My intention is to get a chance to know why a system call failed. That > is a way to find those errors that are a bit harder to find than those > you may see directly by inspecting the code. If you have DebPrint for every system call, and some of them return trivial errors, debugging will sometimes be harder just because of the noise. > System calls, however is like a black box. You have to follow the > rules for calling the black box, but do not know exactly what is > inside, you can only watch the outcome to learn more. I think you'll see that many system calls won't ever return an error (because the error conditions are pretty infrequent). Some of them will, for example system calls related to file manipulation (because of nonexistent or nonaccesible files, etc.); it would be interesting to know how many of those don't have already checking in place. > One example of this is when I see Emacs going totally weird. That > happens quite often and I am not sure what is happening. It might in > my cases be problems with edebug or it might be problems with the > system calls that makes the depends on resource exhaustion in the > black system box. Does that happen to you with your patched Emacs, or unpatched? Because I see occasional crashes, but not nearly as frequently as it seems to happen to you (not by a loooong shot), and I have not seem "weird" behavior (unresponsive Emacs, looping, etc.) perhaps for years. > To be able to fix it I need some kind of logging of > the system calls. Because you somehow assume that the trouble is likely related to bad system calls; most Emacs bugs aren't. >> This is even worse, because it's impossible to understand what this >> does without looking up the magical W32DEBPRINT macro. > > > I think it has some advantages, actually. It is easy to see and > distinguish from the normal code. It can be a null op in non-debugging > compilations. IMHO is horribly ugly. If you're going to have error checks, better to have them on the clear. Juanma