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
Segmentation fault on tests #132
Comments
@JamesRamm, could you rerun the tests with the -v flag, ie python runtests.py -v That should at least give us an idea of where the error is. Which version of Ubuntu are you using? Then I will try to replicate the error. |
Hi verbose output: Building, see build.log...
Build OK
Running unit tests for anuga
NumPy version 1.13.1
NumPy relaxed strides checking option: True
NumPy is installed in /home/james/miniconda3/envs/anuga/lib/python2.7/site-packages/numpy
Python version 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
nose version 1.3.7
test_basic_single_line_grid (anuga.abstract_2d_finite_volumes.tests.test_ermapper.Test_ERMapper) ... ok
test_basic_single_line_grid_default_format (anuga.abstract_2d_finite_volumes.tests.test_ermapper.Test_ERMapper) ... ok
test_header_creation (anuga.abstract_2d_finite_volumes.tests.test_ermapper.Test_ERMapper) ... ok
test_write_default_header (anuga.abstract_2d_finite_volumes.tests.test_ermapper.Test_ERMapper) ... ok
test_write_grid (anuga.abstract_2d_finite_volumes.tests.test_ermapper.Test_ERMapper) ... ok
test_write_non_default_header (anuga.abstract_2d_finite_volumes.tests.test_ermapper.Test_ERMapper) ... ok
Most of this test was copied from test_interpolate ... ok
Check sww2csv timeseries at centroid. ... ok
test_sww2csv_gauge_point_off_mesh (anuga.abstract_2d_finite_volumes.tests.test_gauge.Test_Gauge) ... ok
test_sww2csv_gauges1 (anuga.abstract_2d_finite_volumes.tests.test_gauge.Test_Gauge) ... ok
Most of this test was copied from test_interpolate ... ok
This is testing the sww2csv_gauges function, by creating multiple ... ok
Check sww2csv timeseries at centroid, then output the centroid coordinates. ... ok
test_areas (anuga.abstract_2d_finite_volumes.tests.test_general_mesh.Test_General_Mesh) ... ok
test_assert_index_in_nodes - ... ok
test_get_edge_midpoint_coordinates (anuga.abstract_2d_finite_volumes.tests.test_general_mesh.Test_General_Mesh) ... ok
test_get_vertex_coordinates_triangle_id ... ok
test_get_edge_midpoint_coordinates_with_geo_ref (anuga.abstract_2d_finite_volumes.tests.test_general_mesh.Test_General_Mesh) ... ok
test_get_triangles_and_vertices_per_node - ... ok
test_get_triangles_and_vertices_per_node - ... ok
get unique_vertex based on triangle lists. ... ok
test_get_vertex_coordinates (anuga.abstract_2d_finite_volumes.tests.test_general_mesh.Test_General_Mesh) ... ok
test_get_vertex_coordinates_triangle_id ... ok
test_get_vertex_coordinates_with_geo_ref (anuga.abstract_2d_finite_volumes.tests.test_general_mesh.Test_General_Mesh) ... ok
Get connectivity based on triangle lists. ... ok
test_one_degenerate_triangles (anuga.abstract_2d_finite_volumes.tests.test_general_mesh.Test_General_Mesh) ... ok
test_two_degenerate_triangles (anuga.abstract_2d_finite_volumes.tests.test_general_mesh.Test_General_Mesh) ... ok
Check that structures are correct. ... ok
test_dirichlet (anuga.abstract_2d_finite_volumes.tests.test_generic_boundary_conditions.Test_Generic_Boundary_Conditions) ... ok
test_dirichlet_empty (anuga.abstract_2d_finite_volumes.tests.test_generic_boundary_conditions.Test_Generic_Boundary_Conditions) ... ok
Test that boundary object complains if number of ... ok
test_generic (anuga.abstract_2d_finite_volumes.tests.test_generic_boundary_conditions.Test_Generic_Boundary_Conditions) ... ok
test_time (anuga.abstract_2d_finite_volumes.tests.test_generic_boundary_conditions.Test_Generic_Boundary_Conditions) ... ok
test_time_space_boundary (anuga.abstract_2d_finite_volumes.tests.test_generic_boundary_conditions.Test_Generic_Boundary_Conditions) ... ok
test_transmissive (anuga.abstract_2d_finite_volumes.tests.test_generic_boundary_conditions.Test_Generic_Boundary_Conditions) ... ok
test_CFL (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
Test that quantities already set can be added to using ... ok
test_boundary_conditions (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
test_boundary_indices (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
test_conserved_evolved_boundary_conditions (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
test_conserved_quantities (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
Quantity created from other quantities using arbitrary expression ... ok
Domain implements a default first order gradient limiter ... ok
test_rectangular_periodic_and_ghosts (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
test_set_quanitities_to_be_monitored ... ok
Quantity set using arbitrary expression ... ok
Set quantities for sub region ... ok
test_setting_timestepping_method ... ok
test_simple (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
test_update_conserved_quantities (anuga.abstract_2d_finite_volumes.tests.test_generic_domain.Test_Domain) ... ok
test_simple (anuga.abstract_2d_finite_volumes.tests.test_ghost.Test_Domain) ... ok
test_basic_triangle (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_boundary_inputs (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_boundary_inputs_using_all_defaults (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_boundary_inputs_using_one_default (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_boundary_polygon (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_boundary_polygon_II (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
Same as II but vertices ordered differently ... ok
test_boundary_polygon_IIIa - Check pathological situation where ... ok
Reproduce test test_spatio_temporal_file_function_time ... ok
Create a discontinuous mesh (duplicate vertices) ... ok
test_boundary_polygon_VI(self) ... ok
test_boundary_tags (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_build_neighbour_structure_duplicates (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_general_triangle (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_get_intersecting_segments(self): ... ok
test_get_intersecting_segments(self): ... ok
test_get_intersecting_segments(self): ... ok
test_get_intersecting_segments(self): ... ok
test_get_intersecting_segments(self): ... ok
test_get_intersecting_segments(self): ... ok
test_get_intersecting_segments(self): ... ok
test_get_intersecting_segments_coinciding(self): ... ok
test_get_intersecting_segments_partially_coinciding(self): ... ok
test_get_triangle_containing_point (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_get_triangle_neighbours (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_inputs (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test that the radius is calculated correctly by mesh in the case of an equilateral triangle ... ok
test that the radius is calculated correctly by mesh in the case of a right-angled triangle ... ok
get values based on triangle lists. ... ok
test_lone_vertices (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_mesh_and_neighbours (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_mesh_get_boundary_polygon_with_georeferencing ... ok
test_more_triangles (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_rectangular_mesh (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_rectangular_mesh2 (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_rectangular_mesh_basic (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_surrogate_neighbours (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_triangle_inputs (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_two_triangles (anuga.abstract_2d_finite_volumes.tests.test_neighbour_mesh.Test_Mesh) ... ok
test_pmesh2Domain (anuga.abstract_2d_finite_volumes.tests.test_pmesh2domain.Test_pmesh2domain) ... ok
test_pmesh2Domain_instance (anuga.abstract_2d_finite_volumes.tests.test_pmesh2domain.Test_pmesh2domain) ... ok
test_backup_saxpy_centroid_values (anuga.abstract_2d_finite_volumes.tests.test_quantity.Test_Quantity) ... ok
test_both_updates (anuga.abstract_2d_finite_volumes.tests.test_quantity.Test_Quantity) ... ok
test_boundary_allocation (anuga.abstract_2d_finite_volumes.tests.test_quantity.Test_Quantity) ... ok
test_cache_test_set_values_from_file (anuga.abstract_2d_finite_volumes.tests.test_quantity.Test_Quantity) ... Segmentation fault (core dumped) |
I've managed to track the seg fault to the following code:
line 1095 of |
Ok, so I got the debugger out and followed the call stack of that failing test way down to a function called This is a c extension ( EDIT, a little more info. Running the tests with (gdb) run runtests.py
Starting program: /home/james/miniconda3/envs/anuga/bin/python runtests.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Building, see build.log...
Build OK
Running unit tests for anuga
NumPy version 1.13.1
NumPy relaxed strides checking option: True
NumPy is installed in /home/james/miniconda3/envs/anuga/lib/python2.7/site-packages/numpy
Python version 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
nose version 1.3.7
...............................................................................................[New Thread 0x7fffd8d62780 (LWP 26691)]
[New Thread 0x7fffd8961800 (LWP 26692)]
[New Thread 0x7fffd8560880 (LWP 26693)]
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff39060b2 in dcopy_ ()
from /home/james/miniconda3/envs/anuga/lib/python2.7/site-packages/numpy/core/../../../../libmkl_intel_lp64.so
|
And the first 10 lines of the stack trace from that seg fault:
|
@JamesRamm great work. The problem seems to be that in cg_ext.c there is a function dcopy, but there is a function of the same name in /home/james/miniconda3/envs/anuga/lib/python2.7/site-packages/numpy/core/../../../../libmkl_intel_lp64.so. Probably the easiest way out of this will be to change the names of the functions in cg_ext.c with lapack type names to something a bit unique. Still a bit strange that the local functions are not being linked. |
That is strange. There was a bunch of output from running Will Changing the name to something more unique seems the easiest way out. |
I guess the problem is that conda numpy is linked against libmkl_intel_lp64.so which obviously contains the lapack procedures like dcopy (which has a few extra calling argument, which no doubt caused the segmentation fault) |
To rebuild use |
Ok Then reinstalling numpy, scipy, matplotlib, netcdf4 and gdal is required. I imagine this means that the conda instructions (and maybe However, perhaps it is desirable to support the MKL extensions; they may bring about some performance improvements? Anaconda docs on the optimisations and how to uninstall are here: |
Fixed in PR #140 |
Hi
I'm getting a segmentation fault when running the tests.
I am running on ubuntu, using a conda environment.
My exact installation process was as follows:
Then running
python runtests.py
gives the following output:The text was updated successfully, but these errors were encountered: