Mail Archives: djgpp/1999/06/06/04:15:19
On Thu, 3 Jun 1999, Manni Heumann wrote:
> What's the reason for two kinds of errors you get from windows or under dos
> from djgpp compiled binaries?
The difference is that the Windows DPMI server doesn't catch NULL
pointer dereference and other similar programmatic errors early
enough. Instead, it lets them propagate until they screw up some
critical Windows data structures or device drivers, and what you see
is a GPF inside Windows software. If the GPF popup has the button
DETAILS, you will usually see a name of a Windows module there, and
the address where the GPF happens is more often than not inside
Windows. (You can tell whether the address is a DJGPP EIP by looking
at its selector: DJGPP programs usually have small numbers there, like
107h, 137h etc.; addresses like FF3C:A1E9 are not ours.)
> I managed two write some crappy code that would
> produce exactly this, yesterday. So I rebooted, but not to windows
> but to good old dos. I ran the program again, and it wouldn't give
> me a traceback either. Just an adress.
This usually means that you have corrupted the stack in a way that
totally destroyed the stack frame structure. That is why you don't
get the traceback: the stack is garbled. Another possibility is that
the GPF is inside CWSDPMI, in which case you don't get the traceback
because the EIP belongs to CWSDPMI. The fine details of the crash
message and the registers' dump can be used to find out the exact
reason.
> Is there an explanation for this? Especially for the djgpp part, of course.
Try reading section 12.2 of the FAQ, it has some explanations for
this. If that doesn't help, post the crash message for the above
program and its source here, and somebody will figure it out.
- Raw text -