Comments (14)
from s2geometry.
They're pass without -flto.
from s2geometry.
I also tried to add -ffat-lto-objects and it helps, but there is warning that looks worrying.
from s2geometry.
from s2geometry.
What compiler / version?
from s2geometry.
mkdir build1 && cd build1
cmake -DCMAKE_PREFIX_PATH=/usr/src/abseil17/ -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTS=on -DCMAKE_CXX_FLAGS='-O2 -g -flto=auto -Wall' ..
make VERBOSE=1 -j4
make test -j4
I was using googletest installed on the system, but the problem with not googletest.
Here is a patch that makes this possible or just add -DGOOGLETEST_ROOT=/path/to/googletests/
libs2geometry-use-external-gtest.txt
gcc -v
Using built-in specs.
COLLECT_GCC=x86_64-alt-linux-gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-alt-linux/13/lto-wrapper
Target: x86_64-alt-linux
Configured with: ../configure --host=x86_64-alt-linux --build=x86_64-alt-linux --target=x86_64-alt-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var/lib --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --disable-silent-rules --without-included-gettext --enable-shared --program-suffix=-13 --with-slibdir=/lib64 --libexecdir=/usr/lib64 --with-bugurl=http://bugzilla.altlinux.org --enable-__cxa_atexit --enable-threads=posix --enable-checking=release --with-system-zlib --with-zstd --without-included-gettext --enable-multilib --enable-default-pie --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --with-arch_32=i586 --with-tune_32=generic --with-multilib-list=m64,m32,mx32 --with-gcc-major-version-only --enable-vtable-verify --enable-bootstrap --with-build-config=bootstrap-lto --enable-link-serialization=1 --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --enable-plugin
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20230817 (ALT Sisyphus 13.2.1-alt2) (GCC)
from s2geometry.
I can reproduce the same thing with g++ (Debian 13.2.0-5) 13.2.0
. Debian clang version 16.0.6 (16)
works fine.
This one looks like it is maybe the simplest failure:
[ RUN ] MockIterator.BasicFunctionality
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:49: Failure
Value of: iter.id()
Expected: is equal to 4/1032010230
Actual: 4/103201023 (of type S2CellId)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:50: Failure
Value of: iter.value()
Expected: is equal to 0
Actual: 5 (of type int)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:62: Failure
Value of: iter.id()
Expected: is equal to 4/1032010230301
Actual: Invalid: 89c259d200000000 (of type S2CellId)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:63: Failure
Value of: iter.value()
Expected: is equal to 1
Actual: 4 (of type int)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:68: Failure
Value of: iter.value()
Expected: is equal to 2
Actual: 3 (of type int)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:72: Failure
Value of: iter.id()
Expected: is equal to 4/1032010230301
Actual: Invalid: 89c259d200000000 (of type S2CellId)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:73: Failure
Value of: iter.value()
Expected: is equal to 1
Actual: 4 (of type int)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:77: Failure
Value of: iter.id()
Expected: is equal to 4/10320102303
Actual: 4/103201023 (of type S2CellId)
/tmp/s2/s2-geometry/src/s2/s2cell_iterator_testing_test.cc:82: Failure
Value of: iter.done()
Expected: is true
Actual: false (of type bool)
[ FAILED ] MockIterator.BasicFunctionality (0 ms)
It's just doing basic stuff with absl::btree_map
and iterators.
Maybe run the abseil-cpp tests with -flto
.
from s2geometry.
@jmr compiling abseil-cpp with -flto
is meaningless because it's separate link unit and in addition absl::btree_map
is template therefore no need to be precompiled.
from s2geometry.
absl::btree_map
isn't totally self-contained, but it probably is unlikely abseil-cpp has a test that tickles this bug in the right way.
I think the only parts of S2 that MockIterator.BasicFunctionality
depends on are S2CellId::id()
, operator<()
, and operator==()
. Can you try to cut this down to a minimal test case so we can see whether it's an S2, abseil-cpp or g++ problem? Does it still happen without the absl_btree_prefer_linear_node_search
typedef
?
from s2geometry.
Hi, I just build with latest abseil library and
MockIterator.BasicFunctionality
is passed. What about other do have any
idea?
The following tests FAILED:
31 - s2cell_index_test (Subprocess aborted)
35 - s2cell_union_test (Failed)
75 - s2point_index_test (Subprocess aborted)
88 - s2region_coverer_test (Subprocess aborted)
only_failed_test_log.txt
full_tests_log.txt
from s2geometry.
I would start but looking at s2cell_union_test. That is probably the simplest failure.
from s2geometry.
Here's something to debug:
TEST(S2CellUnion, IntersectsGithubIssue337) {
S2CellUnion xcells = s2textformat::MakeCellUnionOrDie("2/1021322000001121003");
S2CellId yid = s2textformat::MakeCellIdOrDie("2/10213223");
S2CellUnion ucells = xcells.Intersection(yid);
EXPECT_THAT(ucells.cell_ids(), testing::IsEmpty());
}
[ RUN ] S2CellUnion.IntersectsGithubIssue337
s2-geometry/src/s2/s2cell_union_test.cc:377: Failure
Value of: ucells.cell_ids()
Expected: is empty
Actual: { 2/1021322000001121003 }, whose size is 1
[ FAILED ] S2CellUnion.IntersectsGithubIssue337 (0 ms)
See what's going on with the lower_bound
call in S2CellUnion::Intersection
:
s2geometry/src/s2/s2cell_union.cc
Line 351 in 7940c9f
from s2geometry.
This looks like either a gcc LTO bug or LTO taking advantage of some UB.
vector<S2CellId>::const_iterator i = std::lower_bound(
cell_ids_.begin(), cell_ids_.end(), id.range_min());
if (i != cell_ids_.end()) {
ABSL_DCHECK_GE(*i, id.range_min())
<< i->id() << " vs. " << id.range_min().id();
}
F0000 00:00:1709541598.504342 378352 s2cell_union.cc:353] Check failed: *i >= id.range_min() (1/10 vs. 1/112210020000000000000000000000) 2954361355555045376 vs. 3118813110698246145
All tests pass with -D_GLIBCXX_DEBUG
and no LTO. s2cell_union
passes with -D_GLIBCXX_DEBUG -flto=auto
, but some other tests still fail.
The next step is probably to make a minimal test case.
from s2geometry.
Related Issues (20)
- Test errors on PowerPC: 85% tests passed, 16 tests failed out of 110 HOT 8
- Fails to build with abseil-20230125.3: /usr/local/include/absl/base/policy_checks.h:79:2: error: "C++ versions less than C++14 are not supported." HOT 2
- set_target_properties called with incorrect number of arguments HOT 1
- trouble generating cell ids for MultiPollygons
- Is there any method to calculate the ecef coord of the left-up corner of a specified cell id?
- ce8e338 breaks MSVC on Windows HOT 3
- Calculate S2 of polygon with OOM Error in golang HOT 2
- installion s2geometry on windows' issues HOT 18
- After installing s2geometry, CMakeLists.txt failed on "find_package(s2geometry REQUIRED)" HOT 3
- How to boost::serialize S2PointIndex HOT 5
- s2geometry.io has expired?? HOT 2
- problem with S2loop::init HOT 2
- Citation for academic work HOT 1
- Can there be a new release cut? HOT 4
- Does s2 work on i586? HOT 2
- S2RegionCoverer very high RAM consumption on a specific polygon HOT 6
- S2Builder adding extra points to overlapping polygons HOT 4
- ssl certificate error on https://s2geometry.io/
- Array out of bound warning. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s2geometry.