HELP bus error(alignment error)

HELP bus error(alignment error)

Post by Yin Lia » Sat, 14 May 1994 01:11:35



A runtime error occures in my programm, during the execation, it gives
"bus error",  when I use dbx to step through, the dbx msg is:
"signal bus(alignment error) in devimal_to_double at 0xf76f7e3c
decimal_to_double +0x28c:  st %l2,[%i0]"

The program looks like this:

double fbuf[2],ang[3];
...
main(){
....
data();
...

Quote:}

void data(void)
{
......
fscanf(infile,"%lf %lf %lf \n",&fbuf[0],&fbuf[1],&ang[1]);
....

Quote:}

before that fscanf, I have used lots of fscanf to input double valued
arrays,

the program dies on this fscanf();

did anybody can explain what happened ?

Thanks,