- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm interested if it would be possible to make ifort dump stack when calling abort()? It is useful information when you gracefully kill your own program due to e.g. unfulfilled logical check in deeply nested function. Similar functionality is already available in gfortran. Currently, I work it around by forcing SIGSEGV in a proper place of the code. Beforementioned functionality is shown in the following snippets:
$ cat ~/foo.f90
program ala
call foo()
contains
subroutine foo
call bar()
end subroutine foo
subroutine bar
call abort()
end subroutine bar
end program ala
$ gfortran-4.7.1 foo.f90 -g ; ./a.out
Backtrace for this error:
#0 0x7F4520FD1767
#1 0x7F4520FD2D96
#2 0x7F452109B818
#3 0x400709 in bar at foo.f90:10
#4 0x40071D in foo at foo.f90:6
#5 0x400712 in ala at foo.f90:2
Aborted
$ cat ~/foo.f90
program ala
call foo()
contains
subroutine foo
call bar()
end subroutine foo
subroutine bar
call abort()
end subroutine bar
end program ala
$ gfortran-4.7.1 foo.f90 -g ; ./a.out
Backtrace for this error:
#0 0x7F4520FD1767
#1 0x7F4520FD2D96
#2 0x7F452109B818
#3 0x400709 in bar at foo.f90:10
#4 0x40071D in foo at foo.f90:6
#5 0x400712 in ala at foo.f90:2
Aborted
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've just RTFM and found TRACEBACKQQ(), sorry for the noise...

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page