This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
cygwin_except_handler exception C0000005,cygnus-2.7.2-970404
- To: gnu-win32 at cygnus dot com
- Subject: cygwin_except_handler exception C0000005,cygnus-2.7.2-970404
- From: Arhippa Kovanen <aku at teeri>
- Date: Mon, 10 Nov 97 10:32:15 +0200
- Reply-To: aku at fincitec dot fi
Hi.
I get the following exception report occassionally, but not every time
I execute the program. The opetating system is Windows NT 4.0 and gcc
version cygnus-2.7.2-970404.
----------------------------------------------------------
(d:\sdd\bin2\mod4nah2.exe 1000) In cygwin_except_handler
(d:\sdd\bin2\mod4nah2.exe 1000) Exception trapped!
(d:\sdd\bin2\mod4nah2.exe 1000) exception C0000005 at 10011E58
(d:\sdd\bin2\mod4nah2.exe 1000) exception: ax 1D bx 1 cx 100478AC dx 0
(d:\sdd\bin2\mod4nah2.exe 1000) exception: si 0 di 3D2 bp 240F3D4 sp 240F3CC
(d:\sdd\bin2\mod4nah2.exe 1000) exception is: STATUS_ACCESS_VIOLATION
(d:\sdd\bin2\mod4nah2.exe 1000) Stack trace:
(d:\sdd\bin2\mod4nah2.exe 1000) frame 0: sp = 0x240F200, pc = 0x1000CEC2
(d:\sdd\bin2\mod4nah2.exe 1000) frame 1: sp = 0x240F21C, pc = 0x77F94072
(d:\sdd\bin2\mod4nah2.exe 1000) frame 2: sp = 0x240F240, pc = 0x77F88A53
(d:\sdd\bin2\mod4nah2.exe 1000) frame 3: sp = 0x240F2CC, pc = 0x77F75E82
(d:\sdd\bin2\mod4nah2.exe 1000) frame 4: sp = 0x240F3D4, pc = 0x10020949
(d:\sdd\bin2\mod4nah2.exe 1000) frame 5: sp = 0x240F3F0, pc = 0x100318CF
(d:\sdd\bin2\mod4nah2.exe 1000) frame 6: sp = 0x240F404, pc = 0x100304AE
(d:\sdd\bin2\mod4nah2.exe 1000) frame 7: sp = 0x240F420, pc = 0x10026E36
(d:\sdd\bin2\mod4nah2.exe 1000) frame 8: sp = 0x240F440, pc = 0x10030533
(d:\sdd\bin2\mod4nah2.exe 1000) frame 9: sp = 0x240F45C, pc = 0x1002E534
(d:\sdd\bin2\mod4nah2.exe 1000) frame 10: sp = 0x240F46C, pc = 0x1002DFE8
(d:\sdd\bin2\mod4nah2.exe 1000) frame 11: sp = 0x240F480, pc = 0x1000C108
(d:\sdd\bin2\mod4nah2.exe 1000) frame 12: sp = 0x240FF94, pc = 0x1000C113
(d:\sdd\bin2\mod4nah2.exe 1000) frame 13: sp = 0x240FFA0, pc = 0x4015DD
(d:\sdd\bin2\mod4nah2.exe 1000) frame 14: sp = 0x240FFB0, pc = 0x40103B
(d:\sdd\bin2\mod4nah2.exe 1000) frame 15: sp = 0x240FFC0, pc = 0x77F1AFC1
(d:\sdd\bin2\mod4nah2.exe 1000) End of stack trace (more stack frames may be present)
----------------------------------------------------------
Is this some kind of heap or stack problem?
I am calling the program like this.
type in.dat | mod4nah2 520 872 6976 55808 111616 1 1 1 | mod4nah2 260697 260697 2085576 16684608 33369216 1 1 1 > tmp
The file in.dat contains integer ascii numbers and one by one I do the prosessing at the mod4nah2 program. Which code is
----------------------------------------------------------
#include <stdio.h>
FILE *fp1,*fp2;
int main(argc,argv)
int argc;
char *argv[];
{
int sum1=0,sum2=0,sum3=0,sum4=0,out=1,a1=1,b=1,c=4,d=32,e=64;
int in1=0,in2=0,in3=0,in4=0,cp=1,dp=1,ep=1;
int j1=1,j2=1,j3=1,er=0;
int i1max=0,i1min=0,i2max=0,i2min=0,i3max=0,i3min=0,i4max=0,i4min=0;
a1=atoi(argv[1]);
b=atoi(argv[2]);
c=atoi(argv[3]);
d=atoi(argv[4]);
e=atoi(argv[5]);
j1=atoi(argv[6]);
j2=atoi(argv[7]);
j3=atoi(argv[8]);
if (argc>9)
fp1=fopen(argv[9],"w");
if (argc>10)
fp2=fopen(argv[10],"w");
/*pyoristetaan takaisinkytkennan arvot*/
cp=(2*c+j1)/(2*j1);
dp=(2*d+j1*j2)/(2*j1*j2);
ep=(2*e+j1*j2*j3)/(2*j1*j2*j3);
while (scanf("%d\n",&in1) != EOF){
sum4=-1*ep*out+sum3/j3+sum4;
sum3=-1*dp*out+sum2/j2+sum3;
sum2=-1*cp*out+(sum1+er)/j1+sum2;
er=(sum1+er)%j1;
sum1=-1*b*out+a1*in1+sum1;
if (argc>10)
fprintf(fp2,"%d\t%d\t%d\t%d\n",sum1,sum2,sum3,sum4);
if (sum1>i1max)
i1max=sum1;
if (sum1<i1min)
i1min=sum1;
if (sum2>i2max)
i2max=sum2;
if (sum2<i2min)
i2min=sum2;
if (sum3>i3max)
i3max=sum3;
if (sum3<i3min)
i3min=sum3;
if (sum4>i4max)
i4max=sum4;
if (sum4<i4min)
i4min=sum4;
if(sum4<0)
out=-1;
else
out=1;
printf("%d\n",out);
}
if(argc>9){
fprintf(fp1," 1. integraattorin maksimi = %d\n",i1max);
fprintf(fp1," 1. integraattorin minimi = %d\n",i1min);
fprintf(fp1," 2. integraattorin maksimi = %d\n",i2max);
fprintf(fp1," 2. integraattorin minimi = %d\n",i2min);
fprintf(fp1," 3. integraattorin maksimi = %d\n",i3max);
fprintf(fp1," 3. integraattorin minimi = %d\n",i3min);
fprintf(fp1," 4. integraattorin maksimi = %d\n",i4max);
fprintf(fp1," 4. integraattorin minimi = %d\n",i4min);
}
return 0;
}
----------------------------------------------------------
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".