google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.29k stars 302 forks source link

Python test suite failure #376

Open tpikonen opened 1 month ago

tpikonen commented 1 month ago

I built the v0.11.1 git tag (master failed to build) on Debian trixie with this config:

cmake .. -DBUILD_EXAMPLES=OFF -DWITH_PYTHON=ON -DGOOGLETEST_ROOT=/usr/src/googletest

The python binding test suite fails with a segfault:

$ cd python ; make test
Running tests...
Test project /home/tmx/debian/s2geometry/git-deb-s2geometry/build/python
    Start 1: s2geometry_test
1/1 Test #1: s2geometry_test ..................Subprocess aborted***Exception:   3.72 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   3.73 sec

The following tests FAILED:
      1 - s2geometry_test (Subprocess aborted)
Errors while running CTest

The failing test class is S2BuilderTest:

$ PYTHONPATH=$(pwd) python3 ../../src/python/s2geometry_test.py S2BuilderTest
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
F0000 00:00:1721660167.483759  916916 s2edge_distances.cc:405] Check failed: tolerance.radians() > 0 (0 vs. 0) 
*** Check failure stack trace: ***
Aborted (core dumped)

Anything with a call to S2Builder.AddEdge() (i.e. all tests in this class) results in a segfault.

smcallis commented 1 month ago

I'm on a rolling Debian distribution I grabbed a fresh copy of ABSL LTS and did this:

cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_PREFIX_PATH=/opt/absl/lts20240116.1 -DCMAKE_INSTALL_PREFIX=/opt/absl/lts20240116.1 -DABSL_ENABLE_INSTALL=ON -DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON

And followed up with compiling S2 (clean checkout of the v0.11.1 tag): cmake .. -DCMAKE_CXX_STANDARD=17 -DBUILD_EXAMPLES=OFF -DWITH_PYTHON=ON -DGOOGLETEST_ROOT=/usr/src/googletest -DCMAKE_PREFIX_PATH=/opt/absl/lts20240116.1/

And make test in build/python runs fine for me:

Running tests...
Test project /home/smcallis/tmp/s2geometry/build/python
    Start 1: s2geometry_test
1/1 Test #1: s2geometry_test ..................   Passed    2.21 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   2.21 sec          
tpikonen commented 1 month ago

Thanks, but using the exact same checkouts and configuration as above still segfaults here. For reference, I originally used the libabsl-dev version 20240116.2-2 package from Debian experimental which has this configuration:

-DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DABSL_BUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=OFF

As I don't need the Python binding I'm going to leave this be, but it would be nice to have this fixed this eventually.