delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/12/13:17:17

From: George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DPMI error?
Date: 12 Jun 1998 16:46:28 GMT
Organization: Oxford University, England
Lines: 46
Message-ID: <6lrm14$hns$5@news.ox.ac.uk>
References: <35815527 DOT 20861136 AT net4you DOT co DOT at>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Fri, 12 Jun 1998 18:19:51 +0200 in comp.os.msdos.djgpp Seawolf
<seawolf AT net4you DOT co DOT at> wrote:

: Why are some of my Allegro programs not running under plain DOS ?
: If I execute them under Win95 they work properly -
: but in DOS (w/ CWSDPMI) they crash my system!

Crash?  Explain exactly what happens.

If you see a traceback ("Call frame traceback EIPs:") then run symify,
as the documentation tells you to:

    symify myprog.exe -o output.txt

Then `output.txt' will contain the traceback information with the
names of the functions next to the numbers.  The function list shows
the functions that were executing when the problem occured; the one at
the bottom called the next one up, which called the next one up, etc.
If you compiled with extra debugging information (`-g') and didn't
strip this off later, then you'll also get filename and line number
references, which can pinpoint very closely the source of the problem.

To know exactly what went wrong, you need to get used to which signals
occur when you make various errors.  In this case I expect you
received a SIGSEGV, with "Page fault".  This occured because you tried
to read from or write to a NULL pointer.  Windows's DPMI server
doesn't catch this error for you; it lets it pass.  CWSDPMI does catch
it and tells you that there is a problem.  Look at the code around the
place the crash occurs and watch out for possibly NULL pointers.  Be
especially careful that you check return values from functions like
`malloc', which return NULL on error.

Also compile with `-Wall' and at least `-O'.  `-Wall' makes the
compiler warn you about things in your code which are not strictly
errors, but are unreliable and probably mistakes.  `-O' turns on
optimisation, which indirectly allows `-Wall' to spot more mistakes.
If you turn these on, you may find that you're using an uninitialised
pointer.

Further information on this topic can be found in the DJGPP FAQ,
section 9.2 in particular.

-- 
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