From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp Subject: Re: GPF with system() and clock int. Date: Sat, 22 Jul 2000 12:43:26 Organization: Aspen Technology, Inc. Lines: 61 Message-ID: <397996ee.sandmann@clio.rice.edu> References: NNTP-Posting-Host: dcloan.hou.aspentech.com X-Trace: selma.aspentech.com 964289966 11017 10.32.115.107 (22 Jul 2000 18:19:26 GMT) X-Complaints-To: postmaster AT aspentech DOT com NNTP-Posting-Date: 22 Jul 2000 18:19:26 GMT X-NewsEditor: ED-1.5.8 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Okay, I looked at some of these in more detail. For CWSDPMI r4 the internal stored registers work area is at 0x10b6. FS:EBX points to this - so I'm sure we're in a HW interrupt reflected from real mode or a RMCB. DS is g_core. SS:ESP is still on the CWSDPMI stack. But CS:EIP is in the DJGPP code. So we are either entering a HW interrupt or leaving (since we are 1/2 way between the two states. I suspect some bug in the wrapper routines? Reentrancy problem? On your image you would need to use a debugger to find out where the listed EIP values are (in particular 0xaf3c and 0xaf52). The CS selector values are not consistent, which tells me you either are nesting different levels or have left over trash in memory (zombie nestings). I don't have any current wrapper sources to look at. Something appears to not behave well to being interrupted. I see you said DOS 6.22, but what HIMEM and EMM config are you using? Maybe one of them doesn't protect itself well from interrupts; maybe it's some other loaded drivers (comment them and see if it gets better). You could also try a completely RAW set of switching (empty config.sys). Tracking down PM interrupt bugs is a pain in the behind... > 1) gcc 2.7.2.1, DJGPP 2.01, CWSDPMI r4, binutils 2.7: > Page Fault cr2=195d05ea in RMCB at eip=5719b; flags=3002 > eax=195d05df ebx=000010b6 ecx=00000000 edx=00000006 esi=00001a45 edi=000020bc > ebp=0005e960 esp=000020a0 cs=a7 ds=3b es=33 fs=33 gs=ff ss=33 error=0006 > General Protection Fault in RMCB at eip=405a; flags=3046 > eax=01a94c00 ebx=000100a7 ecx=00000015 edx=00016500 esi=000010b6 edi=10000000 > ebp=00000000 esp=00001120 cs=2b ds=33 es=8f fs=0 gs=0 ss=33 error=0000 > > 2) gcc 2.7.2.1, DJGPP 2.03, CWSDPMI r4, binutils 2.7: > General Protection Fault in RMCB at eip=af3c; flags=3002 > eax=0000007a ebx=00007ab6 ecx=00000000 edx=0000000e esi=00001a45 edi=000020bc > ebp=0005e7ec esp=00001fec cs=e7 ds=0 es=33 fs=33 gs=ff ss=33 error=0000 > General Protection Fault in RMCB at eip=405a; flags=3046 > eax=01a94c00 ebx=000100a7 ecx=00000015 edx=0001ad00 esi=000010b6 edi=10000000 > ebp=00000000 esp=00001120 cs=2b ds=33 es=8f fs=0 gs=0 ss=33 error=0000 > > 3) gcc 2.95.2, DJGPP 2.03, CWSDPMI r4, binutils 2.81: > Page Fault cr2=31373532 in RMCB at eip=9b1cb; flags=3002 > eax=31373532 ebx=000010b6 ecx=00000000 edx=000383cc esi=00001a45 edi=000020bc > ebp=000a9910 esp=000020a0 cs=a7 ds=3b es=33 fs=33 gs=ff ss=33 error=0006 > General Protection Fault in RMCB at eip=405a; flags=3046 > eax=01a54c00 ebx=000100a7 ecx=00000015 edx=0001ad00 esi=000010b6 edi=10000000 > ebp=00000000 esp=00001120 cs=2b ds=33 es=8f fs=0 gs=0 ss=33 error=0000 (other message in thread) > CWSDPMI r4 with 512 paragraphs internal heap: > Page Fault cr2=696ff75a in RMCB at eip=af52; flags=3086 > eax=696ff75a ebx=000010b6 ecx=00000000 edx=0000000e esi=00001a47 edi=000020bd > ebp=00000000 esp=00002080 cs=e7 ds=3b es=33 fs=33 gs=ff ss=33 error=0006 > CWSDPMI beta 5 with 128 parapgraphs internal heap: > Page Fault cr2=696ff75a in RMCB at eip=af52; flags=3082 > eax=696ff75a ebx=000010c6 ecx=00000000 edx=00000001 esi=00001a47 edi=00002355 > ebp=00000000 esp=00002318 cs=e7 ds=3b es=33 fs=33 gs=ff ss=33 error=0006 Okay, in this case CR2 is reproducible between two versions of CWSDPMI, and so is EIP. I'm sure CS selector E7 is someplace in non-CWSDPMI code (but this would indicate fairly deep nesting).