Closed jogoussard closed 1 year ago
Thanks for reporting this. I was not able to reproduce this on the C library using the following test:
TEST(issue753) {
H3Index test[] = {
617683643010646015, 617683648070287359, 617683642951663615,
617683648070287359, 617683648070549503, 617683643014840319,
617683643013791743, 617683642951663615, 617683642951663615,
617683648065044479, 617683648070549503, 617683643010383871,
617683643010646015, 617683643013791743, 617683643008024575,
617683643014840319, 617683643010383871, 617683642941177855,
617683642941177855, 617683642941439999, 617683642951663615,
617683642950615039, 617683642950877183, 617683648065044479,
617683648070549503, 617683648057180159, 617683648065044479,
617683648064520191, 617683643013791743, 617683643014316031,
617683643008548863, 617683643007238143, 617683643008024575,
617683643010383871, 617683642953498623, 617683642941177855,
617683643014316031, 617683642953760767, 617683642941439999,
617683642951139327, 617683642950615039, 617683642951663615,
617683648065044479, 617683642950877183, 617683648064258047,
617683648063471615, 617683648066093055, 617683648057180159,
617683648064520191, 617683648057180159, 617683648070549503,
617683648066093055, 617683643019296767, 617683643008548863,
617683643010383871, 617683643018510335, 617683643017723903,
617683642953760767, 617683642954285055, 617683642953236479,
617683642953498623, 617683642953498623, 617683642940129279,
617683642941177855, 617683642950877183, 617683644212576255,
617683644211003391, 617683644212314111, 617683648064258047,
617683648057180159, 617683648057442303, 617683648068190207,
617683648057180159, 617683648064520191, 617683648064782335,
617683648060850175, 617683648057442303, 617683648070811647,
617683648071335935, 617683648070287359, 617683648070549503,
617683648131366911, 617683648070811647, 617683648066093055,
617683648067141631, 617683642944585727, 617683642947469311,
617683642940915711, 617683642940129279, 617683642953498623,
617683642945372159, 617683642944323583, 617683642944585727,
617683648065568767, 617683648066093055, 617683648065830911,
617683648065830911, 617683648068190207, 617683648067665919,
617683648028344319, 617683648065830911, 617683648067665919,
617683648068976639, 617683648028606463};
LinkedGeoPolygon polygon;
t_assertSuccess(
H3_EXPORT(cellsToLinkedMultiPolygon)(test, 104, &polygon));
H3_EXPORT(destroyLinkedMultiPolygon)(&polygon);
}
As the C library returns an error from the call to cellsToLinkedMultiPolygon
. The reason the C library is returning an error is probably (although I didn't check this) because the input set has duplicates, which is not accepted by the algorithm.
Looking at the Java source, it seems in the JNI C adapter code we read the value from cellsToLinkedMultiPolygon
before checking the error. This is probably the cause of the segfault. I've opened a PR uber/h3-java#129 to fix this.
Hi - not sure you will be able to help on this one, it might be very environment specific, I'm mostly posting in case you can reproduce on your side given the code to generate the fault is quite trivial (see below).
Using H3.cellsToMultiPolygon on Mac OS X, with the Java bindings, on a specific set of 104 cells, creates a SIGSEGV.
Code (kotlin)
Using com.uber:h3:4.1.1 maven dependency
JVM error
hs_err log:
Laptop
macbook pro - 2.6 GHz 6-Core Intel Core i7 - macOS 13.2 (22D49) - 32Gb RAM