JVM crash on large polyfills
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the crash with the large polyfill case in TestH3Core.java, then compare it with the related testPolyfill.c case and the h3Api.polyfill call. Determine whether the failure is in the Java wrapper or core library, and confirm the completed fix with regression coverage for the large polygon.
Written by the indexing model from the issue text.
Description
When the following is added to TestH3Core.java, the jvm crashes out on h3Api.polyfill before completing the tests. The polyfill works at resolution 9.
@Test
public void testPolyfillLarge() {
List<Long> hexagons = h3.polyfill(
ImmutableList.<GeoCoord>of(
new GeoCoord(41.5, -70.4),
new GeoCoord(41.5, -69.8),
new GeoCoord(42.1, -69.8),
new GeoCoord(42.1, -70.4)
), null,
10
);
assertTrue(hexagons.size() > 1000);
}
Is this an issue with the java wrapper, or is this impossible to do with the core library?
I don't know C but adding a similar test to h3 naively copying the existing styles to testPolyfill.c at level 11 still seems to work. If I increase the resolution up past 11 it eventually segfaults there too.
GeoCoord capeCodVerts[] = {
{0.7243116395776468, -1.2287117934040082}, {0.7243116395776468, -1.218239817892042},
{0.7347836150896128, -1.218239817892042}, {0.7347836150896128, -1.2287117934040082}};
Geofence capeCodGeofence;
GeoPolygon capeCodGeoPolygon;
capeCodGeofence.numVerts = 4;
capeCodGeofence.verts = capeCodVerts;
capeCodGeoPolygon.geofence = capeCodGeofence;
capeCodGeoPolygon.numHoles = 0;
TEST(polyfillLarge) {
int numHexagons = H3_EXPORT(maxPolyfillSize)(&capeCodGeoPolygon, 12);
H3Index* hexagons = calloc(numHexagons, sizeof(H3Index));
H3_EXPORT(polyfill)(&capeCodGeoPolygon, 11, hexagons);
int actualNumHexagons = 0;
for (int i = 0; i < numHexagons; i++) {
if (hexagons[i] != 0) {
actualNumHexagons++;
}
}
t_assert(actualNumHexagons > 10000, "got lots of hexagons");
free(hexagons);
}
- Dominant language
- Java
- Stars
- 333
- Forks
- 68
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uber/h3-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
emitter:client:csharp feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100