www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/19/02:18:15

From: George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DPMI error
Date: 19 Jun 1998 04:36:51 GMT
Organization: Oxford University, England
Lines: 50
Message-ID: <6mcpt3$loc$1@news.ox.ac.uk>
References: <01bd99c1$00b14f80$92c809c0 AT chessa>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 17 Jun 1998 07:22:22 GMT in comp.os.msdos.djgpp Alberto Chessa
<achessa AT fiar DOT finmeccanica DOT it> wrote:

: I had the same problem (and everybody say me: check your pointers!). Symify
: reports an error in Palantir lwp_spawn (lwp.c) and I was very sure about my
: code. Then I simple try to execute my program step by step (it's not so
: easy using allegro) and I discover that the problem was in Allegro
: install_keyboard() routine!
: I simple remove any Allegro keyboard call (replaced with stdlib calls) to
: solve the problem.
: I do not know if the problem was Allegro or the way I used it (note that
: install_keyboard() was just one of the first instruction of my program,
: just after allegro_init()).

I haven't tried this, but all the documentation points out that you
can't run programs that hook the keyboard interrupt from inside a
debugger.  This is due to the way exceptions are handled under these
circumstances.

The best way for you to find out what is wrong is probably to remove
parts of your code until the program works flawlessly.  Did removing
the `install_keyboard' line solve the problem completely?

If your program is crashing inside a call to a Palantir function then
either there's a bug in the function (least likely), or you're passing
it invalid data (e.g. a NULL pointer; most likely) or you have a bug
elsewhere in your program that is causing corruption of memory
(possible).  The latter is a rather awkward case to debug.

If removing the call to `install_keyboard' did seem to solve the
problem, I'd assert that a random memory write is occuring.  When you
remove unrelated code and a bug gets fixed, it tends to imply that the
bug's occurence depended upon the memory layout.

If you're stuck, post the traceback here so that we can see what the
error message actually is.  If you can reduce your program to about
twenty lines of code then you could post that too.  In trying to
reduce it like this, you might solve (or just locate) the real problem.

You might make progress by recompiling Palantir including debugging
information, so that you can find the exact line in the Palantir
function where the problem occurs.

Reference to DJGPP FAQ:
    "Keyboard interrupt cannot be hooked under debugger": Section 12.9

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019