- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
subroutine WrtHdr(lu,message)
implicit none
integer lu
character*(*) message
return
end
The call is:
character*100 temp_string
integer i_out
i_out = 6
temp_string = 'NEW SECTION'
call WrtHdr(i_out,temp_string)
What could be the problem with this code? Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's more at play here. The small snippet compiles/runs fine.
Can you tell us what compiler version (-V) and compiler options were used and showthe actual abort error message?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try changing " end" to "end subroutine" (note left adjust of text)
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try changing " end" to "end subroutine" (note left adjust of text)
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's more at play here. The small snippet compiles/runs fine.
Can you tell us what compiler version (-V) and compiler options were used and showthe actual abort error message?
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys030
Loading program into debugger
sharedlibrary apply-load-rules all
Program loaded.
run
[Switching to process 11466]
Running
Starting test
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Attempt to take address of value not located in memory.)
Current language: auto; currently fortran
The Debugger has exited due to signal 11 (SIGSEGV).The Debugger has exited due to signal 11 (SIGSEGV).
(gdb)
------- In this case the execution stopped at WriteMessageX in WriteSectionHdr - the code is below:
program test
implicit none
integer i_out
character*100 temp_string
write(6,*) "Starting test"
i_out = 6
temp_string = 'NEW SECTION'
c call WrtNewHdr(i_out,temp_string) ! I cloned the code and ran the cloned code here
call WrtSectionHdr(i_out,temp_string)
write(6,*) "Ending test"
end
subroutine WrtSectionHdr(lu,message)
implicit none
integer lu
character*(*) message
call WrtMessageX(lu,message) ! exits here with code 11
return
end subroutine
subroutine WrtMessageX(lu,message) ! I clonedWrtMessage for testing
C Write a message to the logical unit lu
implicit none
integer lu
character*512 message
integer iend
write(lu,*) message
return
c iend = index(message,char(26))
c if (lu.ne.0) then
c if (iend.eq.0) then
c write(lu,*) message
c else
c write(lu,*) message(1:iend)
c end if
c end if
c
c return
end subroutine
However, the execution ends normally when I step across the function at the break point:
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys032
Loading program into debugger
sharedlibrary apply-load-rules all
Program loaded.
run
[Switching to process 11488]
Running
Starting test
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Attempt to take address of value not located in memory.)
NEW SECTION
Current language: auto; currently fortran
Ending test
-----
I did not set up a rule for compiling the include files, assuming this is not important because they are called from the fortran. the linker complains, for example
[WARN]warning: no rule to process file '$(PROJECT_DIR)/NUMBERS.INC' of type sourcecode.pascal for architecture i386
....... I could not find the text output that lists the compiler settings used in the build results window, but any ideas about what might be happening would be appreciated - Thanks. PW

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