S
subirs
Hi,
I am encountering SIGSEGV if I am opeing and closing a file in a
do-while loop. i am including the part of the code where I have used
fscanf.
-----------------------------------------------------------------
FILE *save;
do
{
save=fopen("Settings/iwrite.dat","r");
fscanf(save,"%d",&stop);
fclose(save);
}
while( some condition here)
-----------------------------------------------------------------
The strange part is if I write a sample code just to read a file using
fscanf function it does not give me SIGSEGV no matter for how many
iterations i run the code. I am facing the problem while running the
sequential as well as parallel version of the same code on
Module V 40 Z - Dual Processor (40 CPUs), AMD Opteron 2.4 GHz, 8 GB RAM
using Redhat Linux enterprise.
I have even used file lock to overcome this error but of no use.
What could be the problem ? Any suggestions will be greatly
appreciated.
Thanks
Subir
I am encountering SIGSEGV if I am opeing and closing a file in a
do-while loop. i am including the part of the code where I have used
fscanf.
-----------------------------------------------------------------
FILE *save;
do
{
save=fopen("Settings/iwrite.dat","r");
fscanf(save,"%d",&stop);
fclose(save);
}
while( some condition here)
-----------------------------------------------------------------
The strange part is if I write a sample code just to read a file using
fscanf function it does not give me SIGSEGV no matter for how many
iterations i run the code. I am facing the problem while running the
sequential as well as parallel version of the same code on
Module V 40 Z - Dual Processor (40 CPUs), AMD Opteron 2.4 GHz, 8 GB RAM
using Redhat Linux enterprise.
I have even used file lock to overcome this error but of no use.
What could be the problem ? Any suggestions will be greatly
appreciated.
Thanks
Subir