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 20:42:40 +0200 Message-ID: References: <83ocfytxhg.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 1275158600 23358 80.91.229.12 (29 May 2010 18:43:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 May 2010 18:43:20 +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 20:43:19 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 1OIR09-0005XS-2T for ged-emacs-devel@m.gmane.org; Sat, 29 May 2010 20:43:17 +0200 Original-Received: from localhost ([127.0.0.1]:48994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIR07-0007Sm-Hf for ged-emacs-devel@m.gmane.org; Sat, 29 May 2010 14:43:15 -0400 Original-Received: from [140.186.70.92] (port=52253 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIQzu-0007Ms-Aj for emacs-devel@gnu.org; Sat, 29 May 2010 14:43:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIQzt-0005N9-BD for emacs-devel@gnu.org; Sat, 29 May 2010 14:43:02 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:56601) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIQzt-0005N2-7U; Sat, 29 May 2010 14:43:01 -0400 Original-Received: by gyg4 with SMTP id 4so2335246gyg.0 for ; Sat, 29 May 2010 11:43:00 -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=6zviwOj1p87xntUniOP8CKoqTl9Uwo5BsYPdak1m2kY=; b=x0G+OWuKbLgOLm2Spz3/f+dNRFD3em6gos+goFTJWhSdzNd+YBsaoJ20MoTwUm3JFr ekULkxwYW7CvhOZUVLIJiCpKqrrE/XQ7aHpLgDbo+i6Mk7yTt8BjOkeGOvUN0Cmys0Bv jAX8ipbkr2HDwU4GnJenMJraklmWFwMQkFkN8= 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=OxurhY/xOZ57tp08/JWr5ivLvyID75EMjs9yHgl4EbsxiIZ/mRH5jNE8Q4ttyVj1zT jtaV0UzMcsNcRng58VN/EM3k3de319XyM2dzXI7LfInrubb1ndVEWo9xbg6zcrzdT8As NvfGrpynjF5YcUYklLP1DCWG3HiLWBRrrQUoM= Original-Received: by 10.101.3.29 with SMTP id f29mr2470386ani.1.1275158580369; Sat, 29 May 2010 11:43:00 -0700 (PDT) Original-Received: by 10.100.44.20 with HTTP; Sat, 29 May 2010 11:42:40 -0700 (PDT) In-Reply-To: <83ocfytxhg.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:125342 Archived-At: On Sat, May 29, 2010 at 7:43 PM, Eli Zaretskii wrote: >> From: Lennart Borgman >> Date: Sat, 29 May 2010 04:38:24 +0200 >> >> There is a lot of system calls in the w32 without error checking. > > ??? "A lot"? =C2=A0Please give examples of those. There is a lot of them in w32fns.c. I expect the same for other files with w32 system calls. Here are some I found: 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 probably missed some (and did I add the GetWindowPlacement code?). >> How about adding something like >> >> =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.