JVM crash on large polyfills
还没有人认领这个 Issue。
评估
调研方向
首先在 TestH3Core.java 中使用大型 polyfill 用例重现崩溃,然后将其与相关的 testPolyfill.c 用例和 h3Api.polyfill 调用进行比较。确定故障是在 Java wrapper 中还是在 core library 中,并通过针对大型多边形的回归测试确认修复已完成。
由索引模型根据 Issue 内容生成。
描述
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);
}
- 主要语言
- Java
- 星标
- 333
- 派生
- 68
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uber/h3-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 42/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
apache/rocketmq-dashboard#5064 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
wso2/dpdp-accelerator#287 ·