jagannat@caip.rutgers.edu (Subbarao Jagannatha) (12/12/90)
Hi, Here is my problem. Please help. I have a C main program (model.c) which calls the fortran program (qdsb.f). The fortran program was obtained by converting VMS fortran to SUN fortran using f77cvt command. When I compile and link both C and Fortran with f77 command, I am getting the following run-time error message: "signal SEGV (segmentation violation)" In debug mode with "where" option : --------------------------------------------------------------- signal SEGV (segmentation violation) in c_sfe at 0x2257c c_sfe+0x200: st %g0, [%o4 + 548] (dbx) c_sfe() at 0x2257c s_wsFe() at 0x226b0 inside_() at 0x1185c qdsb_() at 0x9db4 show(op = 2, wd = 3, obj = 0), line 641 in "model.c" sub_object(e_obj = 2), line 202 in "model.c" design(), line 177 in "model.c" main(), line 93 in "model.c" ----------------------------------------------------------- The problem seems to be in WRITE statement of fortran. Because it gives segmentation violation at all WRITE statements. Also I cannot trace or step through the fortran code in the debug mode. Sometimes when I give run command,the following message appears: "can't write to process (address 0x0) (perhaps you are already debugging this file?)" Any solutions ? Another problem: If the program is created using the following makefile: (Here I am using 'cc' instead of 'f77' for compiling and linking. I am not sure which one is correct to use for compilation and linking) ----------------------------------------------------------- model: model.o qdsb.o drawaxes.o pltsb.o cc -o model -g model.o qdsb.o drawaxes.o pltsb.o -lF77 -lI77 -lU77 -lc -lm model.o: model.c cc -c -g model.c qdsb.o: qdsb.f cc -c -g qdsb.f drawaxes.o: drawaxes.f cc -c -g drawaxes.f pltsb.o: pltsb.f cc -c -g pltsb.f -------------------------------------------------------------- In the beginning of debug mode, I get the message: Warning:Object file read error, text address not found. Hence I could not use debug. Do I have to use any other options ? I could not get any clues to this from sun fortran manual. Thanks in advance, Jagannatha. email: jagannat@caip.rutgers.edu