RedHatLinux9 で Segmentation Fault
RedHat Linux9 で、以下の簡単なファイルの
分割プログラムを走らせていたところ、
頻繁にSegmentation Faultが出て、
システムがハングアップしてしまいます。
シングルユーザモードにしてエラーを
ダンプさせたら、EIPは、
>EIP:0060 [<c010c6a3>] Not tained
>EFLAGS: 000c0882
>EIP is at IRQ 0x00_interrupt [kernel] 0x03
となっています。
ハードウエアとLINUXの相性が悪いんでしょうか?
プログラムは悪くないと思います。
どなたか、わかる方、対処方法を教えてください。
お願いします。
Program:
#include <stdio.h>
main()
{
FILE *outf;
FILE *inf;
char av[1000];
int c;
int i;
int cnt=0;
inf = fopen("hdb1.000","rb");
outf = fopen("test.000","wb");
for(i=0;;i++) {
c = fgetc(inf);
if (c==EOF)
break;
fputc(c,outf);
if ((i%100000000)==99999999) {
cnt++;
fclose(outf);
sprintf(av,"test.%03d",cnt);
printf("unlink and open : %s\n",av);
unlink(av);
outf = fopen(av,"wb");
}
}
fclose(inf);
fclose(outf);
}
Fnews-brouse 1.9(20180406) -- by Mizuno, MWE <mwe@ccsf.jp>
GnuPG Key ID = ECC8A735
GnuPG Key fingerprint = 9BE6 B9E9 55A5 A499 CD51 946E 9BDC 7870 ECC8 A735