www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/25/13:07:17

Xref: news2.mv.net comp.os.msdos.djgpp:3108
From: Robert Hoehne <Robert DOT Hoehne AT Mathematik DOT tu-chemnitz DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: 'General Protection Fault' when profiling
Date: Thu, 25 Apr 1996 15:19:02 +0200
Organization: TU Chemnitz-Zwickau
Lines: 64
Message-ID: <317F7BC6.1007@Mathematik.tu-chemnitz.de>
NNTP-Posting-Host: sisyphus.hrz.tu-chemnitz.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Because I wanted to profile RHIDE, I linked it with gcrt0.o (I added
the -pg switch to gcc). But I think there is a problem with the timer
interrupt handler, when memory is swapped out.

When I run the program (linked with -pg) the follwing error was
produced:

General Protection Fault at eip=d95; flags=16
eax=00000030 ebx=00000000 ecx=0000000c edx=00000000 esi=00019904
edi=000a40f8
ebp=00000000 esp=00003954 cs=18 ds=38 es=ef fs=0 gs=0 ss=20 error=0000
Invalid TSS at eip=4068; flags=16
eax=00000030 ebx=00000000 ecx=0000000c edx=00000000 esi=00019904
edi=000a40f8
ebp=00000000 esp=000024d8 cs=2b ds=38 es=ef fs=0 gs=0 ss=33 error=00ec

I checked it also with a little hack. At the beginning of the program a
added the following, to force swapping out of memory:

  char *tmp = (char *)calloc(20*1024,1024);
  if (tmp == NULL) exit(-1); /* only to supress a warning */

And when I run RHIDE now, the following error was produced:

General Protection Fault at eip=d95; flags=16
eax=00000030 ebx=00000000 ecx=0000000c edx=00000000 esi=000198f4
edi=000a40f8
ebp=00000000 esp=00003954 cs=18 ds=38 es=ef fs=0 gs=0 ss=20 error=0000
Invalid TSS in RMCB at eip=4b418; flags=3002
eax=00000001 ebx=00002398 ecx=00000000 edx=000090ac esi=00001a9e
edi=00003464
ebp=00051e20 esp=000033b0 cs=e7 ds=3b es=33 fs=33 gs=bf ss=33 error=00e4
General Protection Fault in RMCB at eip=4095; flags=3002
eax=00000001 ebx=00002398 ecx=00000000 edx=000090ac esi=00001a9e
edi=00003464
ebp=00051e20 esp=000033b0 cs=2b ds=3b es=33 fs=33 gs=bf ss=33 error=00e4


Now my question. Did I something wrong or is there a problem in the
profiling functions? If there is something wrong in my code, how can
I localize the problem?

I'm working on 486 DX2/66 with 20Mb RAM and running DOS 6.0 and a 4 MB
ramdisk and 4MB disk cache. go32-v2 without arguments prints:

go32/v2 version 2.0 built Jan 23 1996 22:03:02
Usage: go32 coff-image [args]
Rename this to go32.exe only if you need a go32 that can run v2 binaries
as
 well as v1 binaries (old makefiles).  Put ahead of the old go32 in your
PATH.
DPMI memory available: 11904 Kb
DPMI swap space available: 31832 Kb


Robert

-- 
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post:    Am Berg 3, D-09573 Dittmannsdorf                     *
* e-Mail:  Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE              *
* WWW:     http://www.tu-chemnitz.de/~rho                       *
*****************************************************************

- Raw text -


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