Mail Archives: djgpp/1999/10/20/12:55:47
On 19 Oct 1999, Hans-Bernhard Broeker wrote:
> Gisle Vanem (giva AT bryggen DOT bgnett DOT no) wrote:
> > Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> said:
> > > > Exiting due to signal SIGSEGV
> > > > General Protection Fault at eip=00001dcc, error=01d4
>
> > > So in this case, you are trying to use a selector 0x1d4, which is indeed
> > > invalid (it's not ring-3 selector).
> >
> > OTOH, the error code doesn't include the ring-level.
>
> It does. You just don't see it because you don't know where to look
> --- the 2 lowest bits of the descriptor are the ring-level. Your
> descriptor is 0x1d4 ==> lowest bits are 00 ==> Ring-0 was requested.
Btw, as long as we are talking about this, here's an idea for a useful
project: add code to SYMIFY that would analyze the crash message and
print human-readable hints, expressed in small words, as to possible
causes. Examples include possible NULL pointer dereference in case of
Page Fault, invalid selector in case of GPF with an error code, stack
overrun if EBP looks funny, etc. You could even get ambitious enough to
disassemble the code at the EIP shown by the traceback (EDEBUG32 and
FSDB include ready disassembly code), find the register with the garbled
data, and maybe even determine what C variable is loaded into that
register.
The list of possible problems and their symptoms in section 12.2 of
the FAQ should be the starting point. Browsing through the DJGPP
archives should provide enough examples to test the code. If that's not
enough, I can add some really weird cases from my private collection ;-)
As a bonus (besides the infinite gratitude of every newbie around here,
that is), whoever does this will learn A LOT about protected mode and
DPMI. That's a promise.
Well, any takers?
- Raw text -