home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
waithang.zip
/
MAT015.HNG
< prev
next >
Wrap
Text File
|
1998-07-17
|
10KB
|
208 lines
The Modular OS/2 compatability test system hang running MAT015
MAT015 - Summary of code flow
The test is a small VDM app that does sin and power series sin approximation
of a couple of basic numbers. The app is hanging the system while calculating
the power series sin approximation of -1. The code reads as follows:
double mysinh(double x)
{
int i, j;
double sn, term, magn;
term = x;
sn = term;
for(i=1;i<500;++i)
{
j=2*i;
term=term/((double) j * (j+1));
term*=x*x;
magn=sn;
sn+=term;
if(fabs(term)<(magn*1.e-17)
break;
}
return(sn);
}
I have identified the line "term*=x*x;" as the problem spot.
after going through the for loop hex 55 times term has become a very
small negative number. The calculation of this line yelds a positive one.
On a working machine it yelds a really small negative number.
THe following is the debug log of the problem machine for the identified
line of C code. Keep in mind that x=-1.
** what is term at this time **
--dd bp-18 l2
10ec:00001500 373a92f4 80009455 ** notice the sign bit indicates negative**
*** don't forgit you have to word flip this to 80009455373a92f4 ***
--p
*** load up npx with -1******
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=000003fc esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:000003fc dd4604 fld qword ptr ìbp+04┘ ss:151c=bff0000000000000
--p
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=000003ff esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:000003ff 90 nop
--p
**** multiply top of npx stack with a -1 ************
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=00000400 esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:00000400 dc4e04 fmul qword ptr ìbp+04┘ ss:151c=bff0000000000000
--p
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=00000403 esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:00000403 90 nop
--p
*** multiply top of stack with term ( a very small negative number ) *****
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=00000404 esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:00000404 dc4ee8 fmul qword ptr ìbp-18┘ ss:1500=80009455373a92f4
--p
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=00000407 esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:00000407 90 nop
--p
*** stash result into term ******
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=00000408 esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
--p
eax=000000ab ebx=000014f2 ecx=000003b3 edx=00000630 esi=00000395 edi=000014fc
eip=00000408 esp=000014ee ebp=00001518 iopl=3 -- vm -- nv up ei pl nz na po nc
cs=0aaf ss=10ec ds=10ec es=10ec fs=0000 gs=0000 cr2=0001428e cr3=001c9000
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
--pn 10
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
0aaf:00000408 dd5ee8 fstp qword ptr ìbp-18┘ ss:1500=80009455373a92f4
*** we just get stuck here in the debuger and cannot go on*******
*** if I run the test and don't step through it I end up with this ****
*** ctrl+c in with debuger *****************
r
eax=80010013 ebx=fff00000 ecx=80010013 edx=00000008 esi=7ba45078 edi=7ba2c850
eip=ffef8b66 esp=00006650 ebp=0000666c iopl=3 rf -- -- nv up ei pl zr na pe nc
cs=0170 ss=0030 ds=0108 es=0168 fs=0000 gs=0000 cr2=1aad8be4 cr3=001d3000
0170:ffef8b66 9b wait
##pn 20
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
0170:ffef8b66 9b wait
*** it gets stuck here ******************
*** there are no simbols for ffef8b66 so lets look back on the stack ****
##dw ss:esp l20
0030:00006650 002c 0000 0008 0000 0000 fff0 0168 0000
0030:00006660 3f3a fff4 0000 0000 5796 fff4 1512 0000
0030:00006670 3a5c fff4 5f5a fff4 ffff ffff 0000 0008
0030:00006680 0000 0100 0000 ffef 0000 fff4 14f6 0000
##ln fff43f3a
0170:fff43f24 os2krnl:DOSHIGH32CODE:WaitNPX + 16
0170:fff43f3c g__ReleaseNPX - 2
##ln fff45796
0170:fff4578f os2krnl:DOSHIGH32CODE:SchedNextRet2 + 7
0170:fff45800 TIMSEMHANDLE - 6a
##ln fff43a5c
0170:fff439b5 os2krnl:DOSHIGH32CODE:KMExitKmodeEvents + a7
0170:fff43aa4 kmodea$kmCheckForceFlags - 48
##ln fff45f5a
0170:fff45e7d os2krnl:DOSHIGH32CODE:cpu_etint + dd
0170:fff45fca int$intKernelExit - 70
os2krnl:DOSHIGH32CODE:KMExitKmodeEvents:
%fff439b5 9af02200000011 call DOSCODE:f_TaskOnly (1100:000022f0)
%fff439bc fa cli
%fff439bd 66b86801 mov ax,0168
%fff439c1 8ed8 mov ds,ax
%fff439c3 8ec0 mov es,ax
%fff439c5 33c0 xor eax,eax
%fff439c7 8ee0 mov fs,ax
%fff439c9 8ee8 mov gs,ax
%fff439cb 8b3dec6cf0ff mov edi,dword ptr ìfff06cec┘
%fff439d1 668b1dc11bf1ff mov bx,word ptr ìfff11bc1┘
%fff439d8 663b5f02 cmp bx,word ptr ìedi+02┘
%fff439dc 7409 jz %fff439e7
##u
%fff439de 0fbc1df3fadfff bsf ebx,dword ptr ìffdffaf3┘
%fff439e5 7533 jnz %fff43a1a
%fff439e7 8b35e86cf0ff mov esi,dword ptr ìfff06ce8┘
%fff439ed 8b3dec6cf0ff mov edi,dword ptr ìfff06cec┘
%fff439f3 8b866c050000 mov eax,dword ptr ìesi+0000056c┘
%fff439f9 0b4704 or eax,dword ptr ìedi+04┘
%fff439fc 7411 jz %fff43a0f
%fff439fe fb sti
%fff439ff e8a0000000 call kmodea$kmCheckForceFlags (%fff43aa4)
%fff43a04 72b6 jc %fff439bc
%fff43a06 fa cli
%fff43a07 66b86801 mov ax,0168
##u
%fff43a0b 8ed8 mov ds,ax
%fff43a0d 8ec0 mov es,ax
%fff43a0f 803df2fadfff00 cmp byte ptr ìffdffaf2┘,00
%fff43a16 753e jnz %fff43a56
%fff43a18 fb sti
%fff43a19 c3 retd
%fff43a1a 2eff249d9c39f4ff jmp dword ptr cs:ìebx*4+fff4399c┘
%fff43a22 e869020000 call kmodea$kmDispatchGlobalContextH (%fff43c90)
%fff43a27 eb93 jmp %fff439bc
%fff43a29 fb sti
%fff43a2a 9a1cbb00005001 call DOSHIGH2CODE:f_CMAttendSwapper (0150:0000bb1c)
%fff43a31 eb89 jmp %fff439bc
##u
%fff43a33 fb sti
%fff43a34 9a002d00000011 call DOSCODE:f_PostPending (1100:00002d00)
%fff43a3b e97cffffff jmp %fff439bc
%fff43a40 fb sti
%fff43a41 e87f650200 call _tkEvapAll (%fff69fc5)
%fff43a46 e971ffffff jmp %fff439bc
%fff43a4b fb sti
%fff43a4c e8f7520300 call _SMShrinkSwapFile (%fff78d48)
%fff43a51 e966ffffff jmp %fff439bc
%fff43a56 fb sti
%fff43a57 e8c0170000 call _tkSchedNext (%fff4521c)
%fff43a5c e95bffffff jmp %fff439bc
##
***** kmexitkmodeevents calls _tkshednext who calls waitnpx and we hang ******
***** the scheduler up and nothing happens again ****************
***** there appears to be a mexican standoff between the CPU and the NPX *****
***** neither one wants to budge ********
***** I think it's ICE time for this problem since stepping through it
yields a different hang point than running and breaking in **********
***** I it also an insteresting fact that the problem occurs
exactly at this same point in the test case.******************