Skip to content

NAG Fortran Errors on 'module procedure ::' change to 'module procedure' with no double colon #78

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Mar 10, 2015

Conversation

kmanalo
Copy link
Contributor

@kmanalo kmanalo commented Mar 7, 2015

Tested with NAG Fortran Version 6.0.

cmake ../ -DSKIP_DOC_GEN=TRUE -DCMAKE_Fortran_COMPILER=nagfor

Linux Mint 17 64-bit.

@zbeekman
Copy link
Contributor

zbeekman commented Mar 7, 2015

@kmanalo Can you confirm that the library builds AND passes all the tests? I don’t have access to NAG and I don’t think @jacobwilliams does either. Also, are there any warnings issued during the compilation?

If you could post a copy of the output from a clean:

cmake ../ -DSKIP_DOC_GEN=TRUE -DCMAKE_Fortran_COMPILER=nagfor && make VERBOSE=true && make test

that would be very much appreciated.

Also confirmation that the parallel build still works with NAG would be great: make clean && make -j4

Lastly, I suspect this is a bug for NAG Fortran. While I haven’t dug through the standard, searching through MCR, “Modern Fortran Explained” has at least one instance (p. 472) of using the module procedure statement with the double colon. Therefore I think this is a bug that should be reported to NAG.

@jacobwilliams
Copy link
Owner

Terrific! I'm willing to accept it...Lord knows there are enough workarounds for gfortran bugs in there, so I don't mind putting something minor like this for NAG. I think maybe the :: after module procedure is a F03 or F08 feature (I vaguely recall this used to not work on Intel, but then it started working).

I would also like to see the full test results, just to verify that everything does work.

Thanks!

@kmanalo
Copy link
Contributor Author

kmanalo commented Mar 8, 2015

This was the primary warning (showed up on a couple of the tests also):

line 5716: Unused interface for procedure ARRAY_CALLBACK_FUNC

I'll try the other tests and follow up

@kmanalo
Copy link
Contributor Author

kmanalo commented Mar 8, 2015


-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_Fortran_COMPILER= nagfor

-- The Fortran compiler identification is NAG
-- Detecting NAG Fortran directory
-- Detecting NAG Fortran directory - /usr/local/lib/NAG_Fortran
-- Check for working Fortran compiler: /usr/local/bin/nagfor
-- Check for working Fortran compiler: /usr/local/bin/nagfor  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/nagfor supports Fortran 90
-- Checking whether /usr/local/bin/nagfor supports Fortran 90 -- yes
CMake Warning at CMakeLists.txt:145 (message):
  ROBODoc not found! Please set the CMake cache variable ROBODOC to point to
  the installed ROBODoc binary, and reconfigure or disable building the
  documentation.  ROBODoc can be installed from:
  http://www.xs4all.nl/~rfsber/Robo/ If you do not wish to install ROBODoc
  and build the json-fortran documentation, then please set the CMake cache
  variable SKIP_DOC_GEN to TRUE.


-- Configuring done
-- Generating done
-- Build files have been written to: /home/kmanalo3/github/json-fortran-upstream/build
/usr/bin/cmake -H/home/kmanalo3/github/json-fortran-upstream -B/home/kmanalo3/github/json-fortran-upstream/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jsonfortran.dir/build.make CMakeFiles/jsonfortran.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran.dir/depend.internal".
Scanning dependencies of target jsonfortran
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jsonfortran.dir/build.make CMakeFiles/jsonfortran.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jsonfortran.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jsonfortran.dir/build.make CMakeFiles/jsonfortran.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 10
[  9%] Building Fortran object CMakeFiles/jsonfortran.dir/src/json_module.f90.o
/usr/local/bin/nagfor  -Djsonfortran_EXPORTS -mdir . -PIC   -c /home/kmanalo3/github/json-fortran-upstream/src/json_module.f90 -o CMakeFiles/jsonfortran.dir/src/json_module.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
Warning: /home/kmanalo3/github/json-fortran-upstream/src/json_module.f90, line 5716: Unused interface for procedure ARRAY_CALLBACK_FUNC
[NAG Fortran Compiler normal termination, 1 warning]
/usr/bin/cmake -E cmake_copy_f90_mod json_module CMakeFiles/jsonfortran.dir/json_module.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jsonfortran.dir/src/json_module.f90.o.provides.build
Linking Fortran shared library lib/libjsonfortran.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/jsonfortran.dir/link.txt --verbose=true
/usr/local/bin/nagfor  -PIC    -Wl,-shared -Wl,-Xlinker,-soname,-Xlinker,libjsonfortran.so.3.0 -o lib/libjsonfortran.so.3 CMakeFiles/jsonfortran.dir/src/json_module.f90.o 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
/usr/bin/cmake -E cmake_symlink_library lib/libjsonfortran.so.3 lib/libjsonfortran.so.3.0 lib/libjsonfortran.so
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  10
[  9%] Built target jsonfortran
make -f CMakeFiles/jf_test_1.dir/build.make CMakeFiles/jf_test_1.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_1.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_1.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_1.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_1.dir/depend.internal".
Scanning dependencies of target jf_test_1
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_1.dir/build.make CMakeFiles/jf_test_1.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_1.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_1.dir/build.make CMakeFiles/jf_test_1.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 1
[ 18%] Building Fortran object CMakeFiles/jf_test_1.dir/src/tests/jf_test_1.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_1.f90 -o CMakeFiles/jf_test_1.dir/src/tests/jf_test_1.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_1_mod CMakeFiles/jf_test_1.dir/jf_test_1_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_1.dir/src/tests/jf_test_1.f90.o.provides.build
Linking Fortran executable bin/jf_test_1
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_1.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_1.dir/src/tests/jf_test_1.f90.o  -o bin/jf_test_1 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  1
[ 18%] Built target jf_test_1
make -f CMakeFiles/jf_test_2.dir/build.make CMakeFiles/jf_test_2.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_2.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_2.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_2.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_2.dir/depend.internal".
Scanning dependencies of target jf_test_2
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_2.dir/build.make CMakeFiles/jf_test_2.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_2.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_2.dir/build.make CMakeFiles/jf_test_2.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 2
[ 27%] Building Fortran object CMakeFiles/jf_test_2.dir/src/tests/jf_test_2.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_2.f90 -o CMakeFiles/jf_test_2.dir/src/tests/jf_test_2.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_2_mod CMakeFiles/jf_test_2.dir/jf_test_2_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_2.dir/src/tests/jf_test_2.f90.o.provides.build
Linking Fortran executable bin/jf_test_2
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_2.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_2.dir/src/tests/jf_test_2.f90.o  -o bin/jf_test_2 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  2
[ 27%] Built target jf_test_2
make -f CMakeFiles/jf_test_3.dir/build.make CMakeFiles/jf_test_3.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_3.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_3.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_3.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_3.dir/depend.internal".
Scanning dependencies of target jf_test_3
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_3.dir/build.make CMakeFiles/jf_test_3.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_3.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_3.dir/build.make CMakeFiles/jf_test_3.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 3
[ 36%] Building Fortran object CMakeFiles/jf_test_3.dir/src/tests/jf_test_3.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_3.f90 -o CMakeFiles/jf_test_3.dir/src/tests/jf_test_3.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_3_mod CMakeFiles/jf_test_3.dir/jf_test_3_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_3.dir/src/tests/jf_test_3.f90.o.provides.build
Linking Fortran executable bin/jf_test_3
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_3.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_3.dir/src/tests/jf_test_3.f90.o  -o bin/jf_test_3 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  3
[ 36%] Built target jf_test_3
make -f CMakeFiles/jf_test_4.dir/build.make CMakeFiles/jf_test_4.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_4.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_4.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_4.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_4.dir/depend.internal".
Scanning dependencies of target jf_test_4
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_4.dir/build.make CMakeFiles/jf_test_4.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_4.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_4.dir/build.make CMakeFiles/jf_test_4.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 4
[ 45%] Building Fortran object CMakeFiles/jf_test_4.dir/src/tests/jf_test_4.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_4.f90 -o CMakeFiles/jf_test_4.dir/src/tests/jf_test_4.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_4_mod CMakeFiles/jf_test_4.dir/jf_test_4_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_4.dir/src/tests/jf_test_4.f90.o.provides.build
Linking Fortran executable bin/jf_test_4
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_4.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_4.dir/src/tests/jf_test_4.f90.o  -o bin/jf_test_4 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  4
[ 45%] Built target jf_test_4
make -f CMakeFiles/jf_test_5.dir/build.make CMakeFiles/jf_test_5.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_5.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_5.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_5.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_5.dir/depend.internal".
Scanning dependencies of target jf_test_5
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_5.dir/build.make CMakeFiles/jf_test_5.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_5.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_5.dir/build.make CMakeFiles/jf_test_5.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 5
[ 54%] Building Fortran object CMakeFiles/jf_test_5.dir/src/tests/jf_test_5.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_5.f90 -o CMakeFiles/jf_test_5.dir/src/tests/jf_test_5.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_5_mod CMakeFiles/jf_test_5.dir/jf_test_5_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_5.dir/src/tests/jf_test_5.f90.o.provides.build
Linking Fortran executable bin/jf_test_5
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_5.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_5.dir/src/tests/jf_test_5.f90.o  -o bin/jf_test_5 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  5
[ 54%] Built target jf_test_5
make -f CMakeFiles/jf_test_6.dir/build.make CMakeFiles/jf_test_6.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_6.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_6.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_6.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_6.dir/depend.internal".
Scanning dependencies of target jf_test_6
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_6.dir/build.make CMakeFiles/jf_test_6.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_6.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_6.dir/build.make CMakeFiles/jf_test_6.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 6
[ 63%] Building Fortran object CMakeFiles/jf_test_6.dir/src/tests/jf_test_6.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_6.f90 -o CMakeFiles/jf_test_6.dir/src/tests/jf_test_6.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_6_mod CMakeFiles/jf_test_6.dir/jf_test_6_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_6.dir/src/tests/jf_test_6.f90.o.provides.build
Linking Fortran executable bin/jf_test_6
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_6.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_6.dir/src/tests/jf_test_6.f90.o  -o bin/jf_test_6 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  6
[ 63%] Built target jf_test_6
make -f CMakeFiles/jf_test_7.dir/build.make CMakeFiles/jf_test_7.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_7.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_7.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_7.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_7.dir/depend.internal".
Scanning dependencies of target jf_test_7
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_7.dir/build.make CMakeFiles/jf_test_7.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_7.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_7.dir/build.make CMakeFiles/jf_test_7.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 7
[ 72%] Building Fortran object CMakeFiles/jf_test_7.dir/src/tests/jf_test_7.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_7.f90 -o CMakeFiles/jf_test_7.dir/src/tests/jf_test_7.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_7_mod CMakeFiles/jf_test_7.dir/jf_test_7_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_7.dir/src/tests/jf_test_7.f90.o.provides.build
Linking Fortran executable bin/jf_test_7
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_7.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_7.dir/src/tests/jf_test_7.f90.o  -o bin/jf_test_7 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  7
[ 72%] Built target jf_test_7
make -f CMakeFiles/jf_test_8.dir/build.make CMakeFiles/jf_test_8.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_8.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_8.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_8.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_8.dir/depend.internal".
Scanning dependencies of target jf_test_8
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_8.dir/build.make CMakeFiles/jf_test_8.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_8.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_8.dir/build.make CMakeFiles/jf_test_8.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 8
[ 81%] Building Fortran object CMakeFiles/jf_test_8.dir/src/tests/jf_test_8.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_8.f90 -o CMakeFiles/jf_test_8.dir/src/tests/jf_test_8.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_8_mod CMakeFiles/jf_test_8.dir/jf_test_8_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_8.dir/src/tests/jf_test_8.f90.o.provides.build
Linking Fortran executable bin/jf_test_8
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_8.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_8.dir/src/tests/jf_test_8.f90.o  -o bin/jf_test_8 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  8
[ 81%] Built target jf_test_8
make -f CMakeFiles/jf_test_9.dir/build.make CMakeFiles/jf_test_9.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_9.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_9.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_9.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jf_test_9.dir/depend.internal".
Scanning dependencies of target jf_test_9
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_9.dir/build.make CMakeFiles/jf_test_9.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jf_test_9.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jf_test_9.dir/build.make CMakeFiles/jf_test_9.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 9
[ 90%] Building Fortran object CMakeFiles/jf_test_9.dir/src/tests/jf_test_9.f90.o
/usr/local/bin/nagfor    -c /home/kmanalo3/github/json-fortran-upstream/src/tests/jf_test_9.f90 -o CMakeFiles/jf_test_9.dir/src/tests/jf_test_9.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
[NAG Fortran Compiler normal termination]
/usr/bin/cmake -E cmake_copy_f90_mod jf_test_9_mod CMakeFiles/jf_test_9.dir/jf_test_9_mod.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jf_test_9.dir/src/tests/jf_test_9.f90.o.provides.build
Linking Fortran executable bin/jf_test_9
/usr/bin/cmake -E cmake_link_script CMakeFiles/jf_test_9.dir/link.txt --verbose=true
/usr/local/bin/nagfor      CMakeFiles/jf_test_9.dir/src/tests/jf_test_9.f90.o  -o bin/jf_test_9 -Wl,-rdynamic lib/libjsonfortran.so.3 -Wl,-Xlinker,-rpath,-Xlinker,/home/kmanalo3/github/json-fortran-upstream/build/lib 
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  9
[ 90%] Built target jf_test_9
make -f CMakeFiles/jsonfortran-static.dir/build.make CMakeFiles/jsonfortran-static.dir/depend
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
cd /home/kmanalo3/github/json-fortran-upstream/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran-static.dir/DependInfo.cmake --color=
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran-static.dir/DependInfo.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran-static.dir/depend.internal".
Dependee "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles/jsonfortran-static.dir/depend.internal".
Scanning dependencies of target jsonfortran-static
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jsonfortran-static.dir/build.make CMakeFiles/jsonfortran-static.dir/requires
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
make[2]: Nothing to be done for `CMakeFiles/jsonfortran-static.dir/requires'.
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
make -f CMakeFiles/jsonfortran-static.dir/build.make CMakeFiles/jsonfortran-static.dir/build
make[2]: Entering directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 11
[100%] Building Fortran object CMakeFiles/jsonfortran-static.dir/src/json_module.f90.o
/usr/local/bin/nagfor   -mdir lib   -c /home/kmanalo3/github/json-fortran-upstream/src/json_module.f90 -o CMakeFiles/jsonfortran-static.dir/src/json_module.f90.o
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
Warning: /home/kmanalo3/github/json-fortran-upstream/src/json_module.f90, line 5716: Unused interface for procedure ARRAY_CALLBACK_FUNC
[NAG Fortran Compiler normal termination, 1 warning]
/usr/bin/cmake -E cmake_copy_f90_mod lib/json_module CMakeFiles/jsonfortran-static.dir/json_module.mod.stamp NAG
/usr/bin/cmake -E touch CMakeFiles/jsonfortran-static.dir/src/json_module.f90.o.provides.build
Linking Fortran static library lib/libjsonfortran.a
/usr/bin/cmake -P CMakeFiles/jsonfortran-static.dir/cmake_clean_target.cmake
/usr/bin/cmake -E cmake_link_script CMakeFiles/jsonfortran-static.dir/link.txt --verbose=true
/usr/bin/ar cr lib/libjsonfortran.a  CMakeFiles/jsonfortran-static.dir/src/json_module.f90.o
/usr/bin/ranlib lib/libjsonfortran.a
make[2]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_report /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles  11
[100%] Built target jsonfortran-static
make[1]: Leaving directory `/home/kmanalo3/github/json-fortran-upstream/build'
/usr/bin/cmake -E cmake_progress_start /home/kmanalo3/github/json-fortran-upstream/build/CMakeFiles 0
Running tests...
Test project /home/kmanalo3/github/json-fortran-upstream/build
      Start  1: jf_test_4
 1/13 Test  #1: jf_test_4 ........................   Passed    0.01 sec
      Start  2: jf_test_2
 2/13 Test  #2: jf_test_2 ........................   Passed    0.00 sec
      Start  3: jf_test_1
 3/13 Test  #3: jf_test_1 ........................   Passed    0.01 sec
      Start  4: jf_test_5
 4/13 Test  #4: jf_test_5 ........................   Passed    0.01 sec
      Start  5: jf_test_6
 5/13 Test  #5: jf_test_6 ........................***Exception: SegFault  0.01 sec
      Start  6: jf_test_7
 6/13 Test  #6: jf_test_7 ........................   Passed    0.00 sec
      Start  7: jf_test_9
 7/13 Test  #7: jf_test_9 ........................   Passed    5.50 sec
      Start  8: jf_test_3
 8/13 Test  #8: jf_test_3 ........................   Passed    0.02 sec
      Start  9: jf_test_8
 9/13 Test  #9: jf_test_8 ........................   Passed    0.01 sec
      Start 10: regression-test5.json
10/13 Test #10: regression-test5.json ............   Passed    0.00 sec
      Start 11: regression-test1.json
11/13 Test #11: regression-test1.json ............   Passed    0.00 sec
      Start 12: regression-test2.json
12/13 Test #12: regression-test2.json ............   Passed    0.00 sec
      Start 13: regression-test4.json
13/13 Test #13: regression-test4.json ............   Passed    0.00 sec

92% tests passed, 1 tests failed out of 13

Total Test time (real) =   5.58 sec

The following tests FAILED:
      5 - jf_test_6 (SEGFAULT)
Errors while running CTest
make: *** [test] Error 8

@zbeekman
Copy link
Contributor

zbeekman commented Mar 8, 2015

line 5716: Unused interface for procedure ARRAY_CALLBACK_FUNC

this is definitely erroneous, as it is used by at least json_get_array, if not others

What release or commit are you compiling?

Could you recompile with stack tracing enabled? Then, after building the project and tests with CMake/NAG, can you run (at the top level of the build directory (AKA ${CMAKE_BINARY_DIR}):

ctest -V -R jf_test_6

and also, just for good measure

`cd bin/ && ./jf_test_6`

and post the results here?

Lastly could you reconfirm that the current master branch faces the same issues?

I’m not sure how much debugging from afar we’ll be able to do, but at least that may yield a stack trace (to help get to the bottom of the segfault…)

test 6 is relatively small, and untaxing so I’m surprised this is causing NAG to segfault.

@kmanalo
Copy link
Contributor Author

kmanalo commented Mar 9, 2015

==32505== Conditional jump or move depends on uninitialised value(s)
==32505==    at 0x4E79564: write_sequential_buffer_output (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x4E7980E: __NAGf90_end_write_sequential (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x4E4F6C5: json_module_MP_get_current_line_from_file (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x4E50E8C: json_module_MP_json_parse (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x4E5EC38: json_module_MP_json_file_load (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x40A9B9: jf_test_6_mod_MP_test_6 (in /home/kmanalo3/github/shove/json-fortran-upstream/build/bin/jf_test_6)
==32505==    by 0x40ABF0: main (in /home/kmanalo3/github/shove/json-fortran-upstream/build/bin/jf_test_6)
==32505== 
==32505== Syscall param write(buf) points to uninitialised byte(s)
==32505==    at 0x57F2870: __write_nocancel (syscall-template.S:81)
==32505==    by 0x5780002: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1261)
==32505==    by 0x57814DB: _IO_do_write@@GLIBC_2.2.5 (fileops.c:538)
==32505==    by 0x57818B2: _IO_file_overflow@@GLIBC_2.2.5 (fileops.c:876)
==32505==    by 0x4E79594: write_sequential_buffer_output (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x4E7980E: __NAGf90_end_write_sequential (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)

Note: get_current_line_from_file


==32505==    by 0x4E4F6C5: json_module_MP_get_current_line_from_file (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x4E50E8C: json_module_MP_json_parse (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x4E5EC38: json_module_MP_json_file_load (in /home/kmanalo3/github/shove/json-fortran-upstream/build/lib/libjsonfortran.so.3)
==32505==    by 0x40A9B9: jf_test_6_mod_MP_test_6 (in /home/kmanalo3/github/shove/json-fortran-upstream/build/bin/jf_test_6)
==32505==    by 0x40ABF0: main (in /home/kmanalo3/github/shove/json-fortran-upstream/build/bin/jf_test_6)
==32505==  Address 0x4036010 is not stack'd, malloc'd or (recently) free'd

I ran through valgrind, and I think I found the root cause to be in the get_current_line_from_file subroutine, where it appears an upper bound should be the nchunk value.

BTW, this error was only happening about 1/3 of the time when I ran the tests (I suppose there is a hit on an unlucky address).

I haven't seen this issue present itself with gfortran.

@zbeekman
Copy link
Contributor

zbeekman commented Mar 9, 2015

Compiling with stack tracing enabled may still be helpful, because, at least for gfortran and intel, the compiler will give you a line number where the segfault occurs.

My guess is that NAG is botching the reallocation on assignment of line intent-out, deferred-length character variable. Maybe it doesn’t like allocating a zero length string too…

@kmanalo your version of NAG at least claims to support reallocation on assignment and deferred length allocatable character variables, right?

@zbeekman
Copy link
Contributor

zbeekman commented Mar 9, 2015

@kmanalo See my previous post, but also, give this patch a shot and see if it solves the problem: https://gist.github.com/zbeekman/bd69647eabdc9e87162b

It’s an educated guess at best….

@kmanalo
Copy link
Contributor Author

kmanalo commented Mar 10, 2015

@zbeekman I tried your patch, which doesn't affect any outcomes for gfortran, but I don't think it covered the specific NAG issue. Also, I had to add in the compiler flags '-gline -C' for traceback with nagfor. I think both features you mentioned "reallocation on assignment and deferred length allocatable character variables" are supported.

Runtime Error: /home/kmanalo3/github/shove/json-fortran-upstream/src/json_module.f90, line 4292: Out of range: substring ending position 1672001553 is greater than length 256
Program terminated by fatal error

For the above trace, this basically confirms what I was seeing with my hand-debugging, that size remained uninitalized in this specific instance of the line read. Thanks for recommending the flags, I should think to do that more often.

It's probably veering off the path as far as the last fix (may not be the best choice to index against err_message, this is just my current workaround but maybe there are liabilities): I only desired to add that so as make valgrind happy. I could definitely use some advice, and I'll yield to your recommendations @zbeekman @jacobwilliams .

Furthermore, I could gladly contribute to the cmake supplemental flags for NAG;
was this the ideal way in which I call for traceback? Obviously I have started on changes to cmake/pickFortranCompilerFlags.cmake, but this likely seems appropriate to start in another issue.
cmake ../ -DSKIP_DOC_GEN=TRUE -DCMAKE_Fortran_COMPILER=nagfor -DENABLE_BACK_TRACE=TRUE -DCMAKE_Fortran_COMPILER_ID=NAG

@zbeekman
Copy link
Contributor

For the above trace, this basically confirms what I was seeing with my hand-debugging, that size remained uninitalized in this specific instance of the line read. Thanks for recommending the flags, I should think to do that more often.

Yes, the impact on execution size and binary object size is almost always negligible for the former and small for the latter. I compile everything with it turned on because of how helpful it is in trouble shooting errors.

It's probably veering off the path as far as the last fix (may not be the best choice to index against err_message, this is just my current workaround but maybe there are liabilities): I only desired to add that so as make valgrind happy. I could definitely use some advice, and I’ll yield to your recommendations @zbeekman @jacobwilliams .

I’m not sure I understand the fix as you’ve implemented it now, but I think I have a patch that should fix it for you… I did some research on the semantics of non advancing IO and the size=isize argument passed to the read statement. It looks like (from the valgrind output seeing the line that triggers the segfault) that when no data is read in, rather than setting isize to zero as gfortran and intel do, NAG doesn’t touch it. A work around for this is to explicitly set isize to zero before the read statement. I have updated the patch at http://git.io/pCKh.

Furthermore, I could gladly contribute to the cmake supplemental flags for NAG;
was this the ideal way in which I call for traceback? Obviously I have started on changes to cmake/pickFortranCompilerFlags.cmake, but this likely seems appropriate to start in another issue.
cmake ../ -DSKIP_DOC_GEN=TRUE -DCMAKE_Fortran_COMPILER=nagfor -DENABLE_BACK_TRACE=TRUE -DCMAKE_Fortran_COMPILER_ID=NAG

Since I don’t have access to NAG, giving me a list of the flags you use to successfully compile, link and run the tests would be most appreciated. Alternatively, you can contribute them directly in the form of a patch or PR.

@zbeekman
Copy link
Contributor

Also, my reading of the standard indicates that this is a bug in NAG:

31 9.6.2.15 SIZE= specifi er in a data transfer statement
32 1 When a synchronous non advancing input statement terminates, the variable specified in the SIZE= specifi er
33 becomes defi ned with the count of the characters transferred by data edit descriptors during execution of the
34 input statement. Blanks inserted as padding (9.6.4.5.3) are not counted.

My understanding of this is that after returning from a synchronous and non-advancing read statement the size= specifier must be defined even if nothing was actually read.

@zbeekman
Copy link
Contributor

I’m confused why the coverage/coveralls is listed as pending… maybe because it’s a PR? If you look here: https://coveralls.io/r/jacobwilliams/json-fortran at build 94, clearly there is coverage info…

Anyway, @kmanalo, it looks like you patched your fork and pushed it back to github… does it fix the segfault issue with NAG?

@kmanalo
Copy link
Contributor Author

kmanalo commented Mar 10, 2015

No, I just made the change on the fly- will update you this evening when I get to the compiler.

@zbeekman
Copy link
Contributor

ah, I see no access to it atm… just curious do you have the NAG compiler on a personal computer? Do they have affordable academic or personal licenses?

@kmanalo
Copy link
Contributor Author

kmanalo commented Mar 10, 2015

I get it with access to a site license; I have not looked at
commerical/academic #. I routinely use Intel,PGI,Gfortran day-to-day.

Have you looked at Portland also? They have free compiler offers if you
are academically based as staff/student and have an edu address.

On Tue, Mar 10, 2015 at 10:40 AM, Izaak Beekman notifications@github.com
wrote:

ah, I see no access to it atm… just curious do you have the NAG compiler
on a personal computer? Do they have affordable academic or personal
licenses?


Reply to this email directly or view it on GitHub
#78 (comment)
.

@zbeekman
Copy link
Contributor

yes I use portland sometimes… last I checked their F2008 and F2003 support was poor.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 73.11% when pulling ebea5e1 on kmanalo:master into b47871a on jacobwilliams:master.

@zbeekman
Copy link
Contributor

lol @coveralls

@jacobwilliams
Copy link
Owner

.03%! Every little bit helps! Ha ha!

Is this ready to merge? I'm just waiting for one of you guys to give me to go ahead. I also don't have access to NAG.

@kmanalo
Copy link
Contributor Author

kmanalo commented Mar 10, 2015

Thumbs up here, I didn't see any issues with the last commit and no segfaults.

@zbeekman
Copy link
Contributor

Thumbs up here too, so long as @kmanalo tested the latest change with nag and it fixed the segfault issue.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 73.09% when pulling 8afd02e on kmanalo:master into b47871a on jacobwilliams:master.

jacobwilliams added a commit that referenced this pull request Mar 10, 2015
NAG Fortran Errors on 'module procedure ::' change to 'module procedure' with no double colon
@jacobwilliams jacobwilliams merged commit 457b8fd into jacobwilliams:master Mar 10, 2015
@zbeekman
Copy link
Contributor

@kmanalo either send us some build flags or submit a PR to patch CMake and/or build.sh if you like and then we can add them

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants