-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/shallow_sphere gives segmentation fault #642
Comments
I got it to work with 5.7, what seg fault were you seeing? |
Not very informative:
Googling |
Ug, wish we had better error codes with this stuff. I will try and see if I can reproduce this again then and report back. |
If you remove the |
Just some new gfortran warnings similar to what I get these days with the fortran code...
|
Have you tried using gdb to find the error? You wouldn’t need to know much gdb - just run it in gdb and when it crashes, look at the backtrace - “(gdb) bt”.
This said, I have found that most development tools (including gdb) on OSX are becoming more and more unusable. So I often have resorted using a Linux VM for debugging.
-----------------------------------
Donna Calhoun
Associate Professor
Department of Mathematics, Mathematics Bldg 241A
Boise State University
1910 University Drive
Boise, ID 83725-1555
(208) 426-3386
http://math.boisestate.edu/~calhoun
-----------------------------------
… On Apr 22, 2020, at 6:33 PM, Randall J. LeVeque ***@***.***> wrote:
Just some new gfortran warnings similar to what I get these days with the fortran code...
(geo5) [shallow_sphere] como $ python Rossby_wave.py
/Users/rjl/clawpack_src/clawpack_master/clawpack/pyclaw/util.py:78: UserWarning: missing extension modules
warnings.warn("missing extension modules")
/Users/rjl/clawpack_src/clawpack_master/clawpack/pyclaw/util.py:79: UserWarning: running python setup.py build_ext -i in /Users/rjl/clawpack_src/clawpack_master/clawpack/pyclaw/examples/shallow_sphere
warnings.warn("running python setup.py build_ext -i in %s" % working_dir)
running build_ext
running build_src
build_src
building extension "shallow_sphere.classic2" sources
f2py options: []
adding 'build/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere/fortranobject.c' to sources.
adding 'build/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere' to include_dirs.
adding 'build/src.macosx-10.7-x86_64-3.6/shallow_sphere/classic2-f2pywrappers.f' to sources.
building extension "shallow_sphere.problem" sources
f2py options: []
adding 'build/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere/fortranobject.c' to sources.
adding 'build/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere' to include_dirs.
build_src: building npy-pkg config files
customize UnixCCompiler
customize UnixCCompiler using build_ext
get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
customize Gnu95FCompiler
Found executable /usr/local/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'shallow_sphere.classic2' extension
compiling C sources
C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/rjl/miniconda/envs/geo5/include -arch x86_64 -I/Users/rjl/miniconda/envs/geo5/include -arch x86_64
compile options: '-Ibuild/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere -I/Users/rjl/miniconda/envs/geo5/lib/python3.6/site-packages/numpy/core/include -I/Users/rjl/miniconda/envs/geo5/include/python3.6m -c'
compiling Fortran sources
Fortran f77 compiler: /usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -arch x86_64 -fPIC -O2 -fopenmp -O3 -funroll-loops
Fortran f90 compiler: /usr/local/bin/gfortran -Wall -g -fno-second-underscore -arch x86_64 -fPIC -O2 -fopenmp -O3 -funroll-loops
Fortran fix compiler: /usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -arch x86_64 -fPIC -O2 -fopenmp -O3 -funroll-loops
compile options: '-Ibuild/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere -I/Users/rjl/miniconda/envs/geo5/lib/python3.6/site-packages/numpy/core/include -I/Users/rjl/miniconda/envs/geo5/include/python3.6m -c'
gfortran:f90: ./step2qcor.f90
gfortran:f90: ./qcor.f90
./qcor.f90:2:27:
2 | subroutine qcor(ixy,i,m,aux,q,maxm,num_eqn,num_ghost,qc)
| 1
Warning: Unused dummy argument 'm' at (1) [-Wunused-dummy-argument]
gfortran:f90: /Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/limiter.f90
gfortran:f90: /Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/philim.f90
gfortran:f90: /Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/flux2.f90
gfortran:f90: /Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.f90
/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.f90:111:55:
111 | do 23 i = 1-num_ghost, mx+num_ghost
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 23 at (1)
/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.f90:117:59:
117 | do 24 i = 1-num_ghost, mx+num_ghost
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 24 at (1)
/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.f90:124:59:
124 | do 25 i = 1-num_ghost, mx+num_ghost
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 25 at (1)
/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.f90:193:55:
193 | do 73 j = 1-num_ghost, my+num_ghost
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 73 at (1)
/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.f90:199:59:
199 | do 74 j = 1-num_ghost, my+num_ghost
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 74 at (1)
/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.f90:206:59:
206 | do 75 j = 1-num_ghost, my+num_ghost
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 75 at (1)
gfortran:f77: build/src.macosx-10.7-x86_64-3.6/shallow_sphere/classic2-f2pywrappers.f
/usr/local/bin/gfortran -Wall -g -arch x86_64 -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere/classic2module.o build/temp.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere/fortranobject.o build/temp.macosx-10.7-x86_64-3.6/step2qcor.o build/temp.macosx-10.7-x86_64-3.6/qcor.o build/temp.macosx-10.7-x86_64-3.6/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/limiter.o build/temp.macosx-10.7-x86_64-3.6/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/philim.o build/temp.macosx-10.7-x86_64-3.6/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/flux2.o build/temp.macosx-10.7-x86_64-3.6/Users/rjl/clawpack_src/clawpack_master/pyclaw/src/pyclaw/classic/step2ds.o build/temp.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere/classic2-f2pywrappers.o -L/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0 -L/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/../../.. -L/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/../../.. -lgfortran -o ./classic2.cpython-36m-darwin.so
building 'shallow_sphere.problem' extension
compiling C sources
C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/rjl/miniconda/envs/geo5/include -arch x86_64 -I/Users/rjl/miniconda/envs/geo5/include -arch x86_64
compile options: '-Ibuild/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere -I/Users/rjl/miniconda/envs/geo5/lib/python3.6/site-packages/numpy/core/include -I/Users/rjl/miniconda/envs/geo5/include/python3.6m -c'
compiling Fortran sources
Fortran f77 compiler: /usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -arch x86_64 -fPIC -O2 -fopenmp -O3 -funroll-loops
Fortran f90 compiler: /usr/local/bin/gfortran -Wall -g -fno-second-underscore -arch x86_64 -fPIC -O2 -fopenmp -O3 -funroll-loops
Fortran fix compiler: /usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -arch x86_64 -fPIC -O2 -fopenmp -O3 -funroll-loops
compile options: '-Ibuild/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere -I/Users/rjl/miniconda/envs/geo5/lib/python3.6/site-packages/numpy/core/include -I/Users/rjl/miniconda/envs/geo5/include/python3.6m -c'
gfortran:f90: ./mapc2p.f90
gfortran:f90: ./setaux.f90
./setaux.f90:76:42:
76 | do 15 i=1-num_ghost,mx+num_ghost+1
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 15 at (1)
./setaux.f90:104:40:
104 | do 20 i=1-num_ghost,mx+num_ghost
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 20 at (1)
gfortran:f90: ./qinit.f90
./qinit.f90:43:20:
43 | do 20 j=1,my
| 1
Warning: Fortran 2018 deleted feature: Shared DO termination label 20 at (1)
./qinit.f90:3:23:
3 | dx,dy,q,num_aux,aux,Rsphere)
| 1
Warning: Unused dummy argument 'aux' at (1) [-Wunused-dummy-argument]
./qinit.f90:50:0:
50 | theta = dasin(yp/rad)
|
Warning: 'theta' may be used uninitialized in this function [-Wmaybe-uninitialized]
gfortran:f90: ./src2.f90
./src2.f90:2:25:
2 | subroutine src2(maxmx,maxmy,num_eqn,num_ghost,mx,my,xlower,ylower, &
| 1
Warning: Unused dummy argument 'maxmx' at (1) [-Wunused-dummy-argument]
./src2.f90:2:31:
2 | subroutine src2(maxmx,maxmy,num_eqn,num_ghost,mx,my,xlower,ylower, &
| 1
Warning: Unused dummy argument 'maxmy' at (1) [-Wunused-dummy-argument]
./src2.f90:2:49:
2 | subroutine src2(maxmx,maxmy,num_eqn,num_ghost,mx,my,xlower,ylower, &
| 1
Warning: Unused dummy argument 'num_ghost' at (1) [-Wunused-dummy-argument]
./src2.f90:3:25:
3 | dx,dy,q,num_aux,aux,t,dt,Rsphere)
| 1
Warning: Unused dummy argument 't' at (1) [-Wunused-dummy-argument]
/usr/local/bin/gfortran -Wall -g -arch x86_64 -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere/problemmodule.o build/temp.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/build/src.macosx-10.7-x86_64-3.6/shallow_sphere/fortranobject.o build/temp.macosx-10.7-x86_64-3.6/mapc2p.o build/temp.macosx-10.7-x86_64-3.6/setaux.o build/temp.macosx-10.7-x86_64-3.6/qinit.o build/temp.macosx-10.7-x86_64-3.6/src2.o -L/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0 -L/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/../../.. -L/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/../../.. -lgfortran -o ./problem.cpython-36m-darwin.so
/Users/rjl/clawpack_src/clawpack_master/clawpack/pyclaw/util.py:84: UserWarning: successfully executed python setup.py build_ext -i in /Users/rjl/clawpack_src/clawpack_master/clawpack/pyclaw/examples/shallow_sphere
warnings.warn("successfully executed python setup.py build_ext -i in %s" % working_dir)
Segmentation fault: 11
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#642 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAKXMQPNHXSNY6N3T7MZ26TRN6EE7ANCNFSM4MM4E22Q>.
|
I wonder if those "shared DO termination label"s are actually a problem? We should get rid of them anyway. I'll do that later today. |
I haven't run into problems with GeoClaw with the termination label warnings, but I agree we need to eventually clean it all up. Also @mjberger recently noticed you can add the gfortran flag |
|
I cleaned up all the loop labels in #643. |
Currently this test is failing in a similar way on the CI test, but for me and at least one other person it passes locally on a Macbook. |
This works for me too on Apple M1, macOS 14.7. Does someone have access to ifort that could see if that might produce the problem? I would hazard a guess that it is a problem in the Fortran allocation that gfortran either cleans up or does not care about when linked in Python. |
@rjleveque could you check if this test still fails for you locally? i.e. do
If it fails, then try doing this in a Python session and let me know the output:
I'm suspicious that f2py might be generating a slightly different signature for the |
When I run pytests locally, I do not get the segmentation fault (running on an Intel i7 in a macbook) for shallow spheres; it passes fine. But I do get a test failure for one of the advection tests.
Are the tests numerically brittle? Can we set them up to accept some value +/- some error range? For example, see the Does the code or do the tests need division by zero checks or sqrt(negative) checks to preempt numerical problems? Or do we expect the segfault has a less banal cause? |
What flags are you using for compilation with |
What is |
The fortran intel compiler. If you are using |
I'm not seeing a segfault on this architecture. I'm seeing an ordinary test failure. I'm just wondering whether some kind of checking can forestall both these things. Can the root cause ultimately be reduced to how the tests or code was written? Because that we can control. Which compiler is used in the wild or on CI is difficult to control, though obviously we'd like to work on all of them. |
Ah, sorry, getting confused as to where is what and which is failing... We really do not want to do the checks as (a) they are relatively expensive and (b) they should fail if a |
Sorry for the slow response to the request from @ketch in #642 (comment) I just tried and it seems to work fine using v5.11.0, on my MacBook M1 with gfortran 13.2.0. Running
gives no error and also
now runs and produces plots. Also, when I checked out the master branch in pyclaw, which includes PRs #729 - #732, and then re-install and run pytest again it still works. |
The tests are already set up to accept a range of values intended to handle rounding errors on different architectures. You're welcome to open a new issue to discuss this failure, which I believe is not related to the shallow_sphere segfault. |
I'm trying to build the pyclaw galleries and everything works fine with v5.7.0rc except in
examples/shallow_sphere
where runningRossby_wave.py
ortest_shallow_sphere.py
gives a segmentation fault.The text was updated successfully, but these errors were encountered: