emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: System calls without error checks in w32


From: Lennart Borgman
Subject: Re: System calls without error checks in w32
Date: Sat, 29 May 2010 22:02:24 +0200

On Sat, May 29, 2010 at 9:35 PM, Eli Zaretskii <address@hidden> wrote:
>> From: Lennart Borgman <address@hidden>
>> Date: Sat, 29 May 2010 20:42:40 +0200
>> Cc: address@hidden
>>
>> 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.


>> >>     DebPrint (("error w32_creatwindow.AjdustRectangle => %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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]