From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: System calls without error checks in w32 Date: Sat, 29 May 2010 22:02:24 +0200 Message-ID: References: <83ocfytxhg.fsf@gnu.org> <83mxvitsay.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 1275163382 4878 80.91.229.12 (29 May 2010 20:03:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 May 2010 20:03:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 29 22:02:59 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 1OISFC-0000NE-NF for ged-emacs-devel@m.gmane.org; Sat, 29 May 2010 22:02:59 +0200 Original-Received: from localhost ([127.0.0.1]:59834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OISFA-0007p8-Bn for ged-emacs-devel@m.gmane.org; Sat, 29 May 2010 16:02:52 -0400 Original-Received: from [140.186.70.92] (port=35934 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OISF4-0007p3-M1 for emacs-devel@gnu.org; Sat, 29 May 2010 16:02:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OISF3-0000TG-0Z for emacs-devel@gnu.org; Sat, 29 May 2010 16:02:46 -0400 Original-Received: from mail-gw0-f41.google.com ([74.125.83.41]:35563) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OISF2-0000TA-Qd; Sat, 29 May 2010 16:02:44 -0400 Original-Received: by gwb19 with SMTP id 19so2340099gwb.0 for ; Sat, 29 May 2010 13:02:44 -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=8u7goiyKW3EgMYUbcMLjtwI00CNRPFBPCrzrhn+22Do=; b=xTqOHuX8ZvHvYIt07m3jz9VTImEyUUvunyNDZpxwHEu07vz31/FBwVBF44u5B4yzXN fQRloccLCI2Z3yA+lmAHpFUkopRkK3/xSEdrtF2P4SaNfum57+eD+18PXbU4gmRMBiIt AI2lPvpHRJqSDZrEtaMI7z6nQ1BF5yZPPLjII= 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=DB3M/QHCKG/cmttawiIOreicjVJMLRnB6/juSpKYGtRzHO7JeSd58vBaY3CUhxvCJd msSPXgGdr9+QTy8VguEBnh88H2SScN22ERye8xqMFU2AWJdhGRDfNRHKBRVtXYs0LkBu ADFFRvrT979TlRfLH4NWBPeQdM4Bxq9itfdfI= Original-Received: by 10.100.245.40 with SMTP id s40mr2718997anh.137.1275163364139; Sat, 29 May 2010 13:02:44 -0700 (PDT) Original-Received: by 10.100.44.20 with HTTP; Sat, 29 May 2010 13:02:24 -0700 (PDT) In-Reply-To: <83mxvitsay.fsf@gnu.org> 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:125344 Archived-At: On Sat, May 29, 2010 at 9:35 PM, Eli Zaretskii wrote: >> From: Lennart Borgman >> Date: Sat, 29 May 2010 20:42:40 +0200 >> Cc: emacs-devel@gnu.org >> >> CreateFontIndirect >> DestroyCaret >> ExtTextOut >> GetForeGroundWindow >> GetKeyboardState >> GetKeyboardState >> GetModuleHandle >> GetProcAddress >> GetTextExtentPoint32 >> GetWindowPlacement >> GetWindowRect >> KillTimer >> LocalFree >> PostMessage >> PostThreadMessage >> RegisterHotKey >> ReleaseCapture >> SelectObject >> SetWindowLong >> >> A few of them does not return errors, but return value may have to be >> checked anyway. I looked a bit more. There are many more that could be checked, but are not checked now. > If you can suggest what to do when any of these fails, please do. I have already made the suggestion below. I do not mean adding it everywhere where checks are missing, that would be a lot of job in the current state of the code. However adding this kind of output when hunting for a problem could be very helpful. >> >> =C2=A0 =C2=A0 DebPrint (("error w32_creatwindow.AjdustRectangle =3D> = %d\n", >> >> GetLastError ())); >> >> >> >> to all of them? Is there anyone who has anything against this? >> > >> > What for? >> >> >> I have for several years complained about frequent crashes. They are >> quite irritating actually. >> >> I have to reboot quite often too, maybe because of errors in the >> system calls (some resource is leaking). >> >> Menus often stops working. Difficult to track down, and even more so >> without knowing if some bad system calls where involved. >> >> Emacs can totally hang. Or it can loop without yeilding. At least the >> first one can be a bad system call. > > I don't see how any of these problems could be solved by using > DebPrint. Why not? The latest crash fixes I sent in was about missing checks.