Re: Program Crashing From Running Too Fast?

From: Old Wolf (oldwolf_at_inspire.net.nz)
Date: 08/26/04


Date: 25 Aug 2004 15:58:54 -0700

daragoth@kuririnmail.com (Daragoth) wrote:

> [My program fails when some debugging is added]
>
> However, after doing so the program would crash with code "c0000005"

ISTR this is the Windows code for a segfault.

> So my only idea is that the program is running too fast.

Unlikely, to say the least.

> Anyone know what causes this to happen and how to fix it?

Most likely, you have a bug in your program elsewhere that causes
memory corruption, and it only shows up under some circumstances.

Post your code (or preferably, the smallest subset of your code
that shows the problem).

> Also, because I would like to be able to pause the program as well as
> send various other user-input commands to it without stopping it, is
> it possible for a console window to accept keyboard input without
> halting execution of the program? I would prefer not to have to alter
> the entire program to have it run in a window.

You would have to create a background processing thread, or
use a system-specific function that can poll the keyboard
without waiting.



Relevant Pages

  • Re: Simulate mouse clicks and keyboard input
    ... by sending mouse clicks and keyboard input. ... either ideally when the window is out of focus, ... SendKeys is supposed to replicate user input device data, and you can't input data to something that the cursor isn't on. ... flash bug always got in the way and the page didn't receive the click. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Sending Keystrokes to application with known hwnd
    ... ' A window receives this message when the user chooses a command from the ... Private Type GENERALINPUT ... ' Structure to hold specific information about the keyboard input ... ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long ...
    (microsoft.public.vb.winapi)
  • Re: Programs not accepting input?
    ... one accepting keyboard input and the other I had to ... The same gaim process wouldn't ... accept keyboard input in the conversation window but the buddy window did ... Once a window stopped accepting keyboard events, ...
    (freebsd-hackers)
  • Re: Programs not accepting input?
    ... Is the problem that the clients aren't taking focus or have focus ... but aren't accepting keyboard input? ... I know the window had input focus (my ... My keyboard input problem only affected ...
    (freebsd-hackers)
  • Re: Programs not accepting input?
    ... refusing keyboard input after they've been running for a while ... input in the conversation window but the buddy window did responded ... Is the problem that the clients aren't taking focus or have focus ... but aren't accepting keyboard input? ...
    (freebsd-hackers)