I am new to fortran programming. Please, I need to resolve the following problem.
I am working on an open source code
https://github.com/valeriabarra/ThinViscoelasticFilms
and it has the line below in one of the .f90 files.
!!$ output folder
CHARACTER(len=*), PARAMETER :: folder='/home/user/Output/000/' ! needs to be changed with your global path
I am running gfortran on Ubuntu. So, I changed the directory to:
β/home/viscoexpert/Desktop/ThinViscoelasticFilms-master/output/000/β
but it returns the following error mesage:
At line 40 of file ../par.f90 (unit = 3)
Fortran runtime error: Cannot open file β/home/viscoexpert/Desktop/ThinViscoelasticFilms-master/output/000/range.datβ: No such file or directory
Error termination. Backtrace:
#0 0x7f8d8d0a62ed in ???
#1 0x7f8d8d0a6ed5 in ???
#2 0x7f8d8d0a769d in ???
#3 0x7f8d8d219ecd in ???
#4 0x7f8d8d21a214 in ???
#5 0x55a32fec4a0a in par_
at ../par.f90:40
#6 0x55a32fec14b8 in MAIN__
at ../main.f90:90
#7 0x55a32fec1bd4 in main
at ../main.f90:29
Please, how do I specify the correct directory for the output folder?
Related
I'm debugging a SIGSEGV error on a huge application running on Yocto/ARM64 (iMX8QM).
If I run the application in GDB, I can get the backtrace:
Thread 1 "HmiAppCentral" received signal SIGSEGV, Segmentation fault.
0x0000000000b0a0d0 in kanzi::Node3D::~Node3D() ()
(gdb) bt
#0 0x0000000000b0a0d0 in kanzi::Node3D::~Node3D() ()
#1 0x0000000000cd4e44 in kanzi::Model3D::~Model3D() ()
#2 0x0000000000b09c38 in kanzi::Node3D::removeChild(unsigned long) ()
[...]
Then I export the core dump, quit GDB and restart it:
(gdb) generate-core-file
warning: target file /proc/2279/cmdline contained unexpected null characters
[...]
gdb -c core.2279
Then GDB is not able to print the backtrace anymore:
(gdb) bt full
#0 0x0000000000b0a0d0 in ?? ()
No symbol table info available.
#1 0x0000000000000001 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
The address of the first frame is correct (0x0000000000b0a0d0), however GDB is not able to find the function name when reloading the core dump. Any hint?
Just like when the OS creates a core file, the original program executable is not included in the core file itself, and it is this executable that contains the debug information (or allows GDB to find the debug information).
What this means is, if you want to debug with the debug information then you need to provide both the executable and the core file, so something like:
gdb my_program.exe -c core.pid
I have no experience in Fortran having written code in C# and Aurelia.
I was interested in a program that designs turbine blades and would have liked to use it to explore a design process however its supplied as a program ready to compile and run.
Here is the Dropbox with the program. (there are 3 such programs this being the first in a series)
https://www.dropbox.com/sh/8i0jyxzjb57q4j4/AADwCp9bufU-_uug9yHmvQYma/MEANGEN/meangen%20program?dl=0&preview=meangen-17.4.f&subfolder_nav_tracking=1
Instructions on the use of this are a couple of folders up..
https://www.dropbox.com/sh/8i0jyxzjb57q4j4/AAAh1Jq_WkJfDSRet69Rxfo-a/MEANGEN/meangen-instructions.pdf?dl=0
I have installed minGW-W64 added to the path and then attempted to run the program. Where I think I should get a bunch of questions etc It runs and stops with an error. So I was able to compile it but it fails trying to open a file.
At line 61 of file mengen.f (unit = 5)
Fortran runtime error: Cannot open file '/dev/tty': No such file or directory
Error termination. Backtrace:
Could not print backtrace: libbacktrace could not find executable to open
#0 0xffffffff
#1 0xffffffff
#2 0xffffffff
#3 0xffffffff
#4 0xffffffff
#5 0xffffffff
#6 0xffffffff
#7 0xffffffff
#8 0xffffffff
#9 0xffffffff
#10 0xffffffff
#11 0xffffffff
I looked at the code and its trying to open a file called /dev/tty here is the line 60.
C
OPEN(UNIT=10, FILE= 'meangen.out')
OPEN(UNIT=5, FILE= '/dev/tty')
C
Anybody out there who might know how to fix this and get it to work?
My program is written by f90 and I use the compiler fortran, the operating system is MacOS.
When I run the program, I had the following error:
At line 44 of file calc_configuration.f90 (unit = 10)
Fortran runtime error: Cannot open file 'control.ini': No such file or
directory
Error termination. Backtrace:
#0 0x10d092579
#1 0x10d093235
#2 0x10d093999
#3 0x10d1577da
#4 0x10d157a1d
#5 0x10d040868
#6 0x10d035c17
#7 0x10d078913
logout
Saving session...
...copying shared history...
...saving history...truncating history files.
And the 44th line of calc_configuration.f90 is:
open(ifnTMP, file='control.ini', status='old')
The file control.ini is a parameter setting file like this:
# control.ini
# calc_start : initial date for the first one-week calculation
2004 7 21 0 0 0
..
I put the file control.ini under the same directory of my program, but it told me no such file. I am confused, can anyone help me?
GDB 7.7 shows more number of backtraces (90) for my core file. It is problem with GDB or core file or stack corruption issue?
(gdb) bt
Python Exception exceptions.ImportError No module named traceback:
#0 0x00007f422fd04c37 in ?? () from /users/jegan/lib/x86_64-linux-gnu/libc.so.6
#1 0x0000000000002929 in ?? ()
#2 0x7328203c20746e63 in ?? ()
.......................
......................
#88 0x544143494649544e in ?? ()
#89 0x29295d305b4e4f49 in ?? ()
#90 0x0000000000000000 in ?? ()
(gdb)
GDB 7.7 shows more number of backtraces (90) for my core file.
There are a few likely causes for this:
You didn't invoke GDB correctly, or
You are analysing a core dump on a different host from the one it was produced on (or the same host has had its system libraries updated).
Answer for #1.
Answer for #2.
I'm trying to stop right after the module is loaded in gdb. Let's assume that the binary is completely stripped out of all symbol informations, so there's no main.
Ideally I'd set the breakpoint on the entry point, but that idea breaks down due to relocations:
(gdb) info target
Symbols from "./application".
Local exec file:
`./application', file type elf64-x86-64.
Entry point: 0xc154
...
(gdb) break *0xc154
Breakpoint 1 at 0xc154
(gdb) r
Starting program: ./application
Warning:
Cannot insert breakpoint 1.
Error accessing memory address 0xc154: Input/output error.
(gdb) info target
Symbols from "./application".
Unix child process:
Using the running image of child process 22835.
While running this, GDB does not access memory from...
Local exec file:
`./application', file type elf64-x86-64.
Entry point: 0x555555560154
Even though that kind-of works (I could set a new breakpoint on the new address and disable the original), it cannot be easily executed via gdb script / batch mode, because it has a failing instruction in the middle.
Is there a way to do that? Ideally something like "run single instruction", rather than "run" would be useful.
Update:
GDB-8.1 implemented starti command, which makes this very easy.
Entry point: 0xc154
This is a dynamically-linked, position-independent (PIE) binary.
You want to stop in the dynamic linker after that binary is loaded and relocated, but before it executed anything.
(gdb) set stop-on-solib-events 1
(gdb) run
Starting program: /tmp/a.out
Stopped due to shared library event (no libraries added or removed)
(gdb) info target
Symbols from "/tmp/a.out".
Unix child process:
Using the running image of child process 13746.
While running this, GDB does not access memory from...
Local exec file:
`/tmp/a.out', file type elf64-x86-64.
Entry point: 0x5555555545f0
...
(gdb) bt
#0 __GI__dl_debug_state () at dl-debug.c:77
#1 0x00007ffff7ddd488 in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=0x7ffff7ffe870) at rtld.c:1678
#2 0x00007ffff7defb24 in _dl_sysdep_start (start_argptr=<optimized out>, dl_main=0x7ffff7ddc6e0 <dl_main>) at ../elf/dl-sysdep.c:244
#3 0x00007ffff7ddf365 in _dl_start_final (arg=0x7fffffffe440) at rtld.c:338
#4 _dl_start (arg=0x7fffffffe440) at rtld.c:564
#5 0x00007ffff7ddb6b8 in _start () from /lib64/ld-linux-x86-64.so.2