I have encountered a strange problem.I compiled a Fortran source file to executable,it have only reported two warnings and generated the executable well,but after I ran it,it quited soon and gave me no response.Then I added a ‘print’ statement at the beginning of the soucefile and recompile it,but it did the same.
Who could give me a hand?
I was working on RedHat Linux 9,with PGI workstation 5.2 - PGF77,it is a
trial version
the following is information outputed in the process of debugging the program using pgdbg:
It poped up a dialog with the message “Signalled SIGSEGV at 0x40000be0,function _start,file”,and messages like “pgserv 4301: read: unable to read address 0x40000fc4” appeared in the terminal titled “PGDBG Program I/O”
My case may not be the same as your.
I forgot to give other details.After I have run my program ,**it quited soon and act as it have done nothing.**Even it can’t access the first executable
statements in the source file(i.e the ‘print’ statement I added).
Very odd. It appears to be seg faulting in the program start-up routine. “_start” is coming from the file “/usr/lib/crt1.o” which is a system provided object.
Questions:
Have you modifed your system from the default installation, i.e upgraded the kernel or gcc version?
What are the warning messages your seeing?
What optimization are you using to compile?
Can you successfully run a hello world program?
hello.f:
write (*.*) 'Hello World'
end
I hello.f doesn’t work, compile it again with “-v” and post the line that starts with “/usr/bin/ld”.
Thanks,
Mat
P.S. I’m not sure why Thomas encountered an issue where he had to press to run is program but this is not a requirment of the Demo version of the compiler. The Demo compilers are the exact same as the licensed versions, except they stop working after the demo period. That is until you get a license.
answers:
1.No
2.PGFTN-W-0169-Multiple data initializations of common block const (waveglobe10_sj
q.f)
PGFTN-W-0169-Multiple data initializations of common block consour (waveglobe10_sjq.f)
3.I have used the “-g” option,so I think the optimization level is 0
4.Yes.A program as follow
program test
write(,) “Successful”
stop
end
Another possiblity is that the program is getting a stack overflow error. Try setting your stack size to unlimited (‘ulimit’) and run the program again. Also, try running the same executable on a different system.
No,I didn’t use my own start.S file.Even I could find the start.S file in my system.How can I get it?
I have seen a string “…/sysdeps/i386/elf/start.S” in the /usr/lib/crt1.o,but I don’t understand it’s meanings.
I was more curious why ddd would be looking in your home directory for a system dependent start.s file. Is this a ddd thing or does your program have a particular start.s that it expects? Maybe your linking in the crt1.o start function instead of your “~/sysdeps/i386/elf/start.S” which causes the error. However, I just guessing at this point.
Is it possible to obtain the source code? I can send you an email with a location to send the code or if it’s publicly available can you post the location here?