You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fuzzerPolygonToCellsExperimentalNoHoles intermittently times out in the LibFuzzer clang CI job, including on pushes to master with no pull request involved. The libFuzzer artifact from one of those runs is a 33 byte input that is genuinely slow rather than hung, and it reproduces deterministically.
ALARM: working on the last Unit for 432 seconds
and the timeout value is 300 (use -timeout=N to change)
==3271== ERROR: libFuzzer: timeout after 432 seconds
SUMMARY: libFuzzer: timeout
About 13s uninstrumented for one input, which is consistent with the 432s the instrumented fuzzer binary reported. Every call returns E_SUCCESS; nothing is stuck in an infinite loop, the work is simply very large.
Why it is expensive
verts[1].lat is -1.6e179. latLngToCell only rejects non-finite coordinates:
if (!isfinite(g->lat) || !isfinite(g->lng)) {
returnE_LATLNG_DOMAIN;
}
so a finite but wildly out-of-range latitude is accepted. The bounding box derived from that vertex spans an enormous latitude range, bboxHexEstimate returns 396,096 for res 11, and the polyfill iterator walks all of it. Since the fuzzer is free to generate any 8 bytes for a latitude, inputs of this shape are reachable whenever the corpus drifts that way, which matches the intermittent CI failures.
Possible directions
I did not want to guess at intent, so rather than send a patch:
Clamp the polygon bounding box latitude to [-M_PI_2, M_PI_2]. Latitudes outside that range are not representable on the sphere, so this bounds the work without changing results for in-range input. It does change what comes back for out-of-range input.
Reject out-of-range latitude/longitude with E_LATLNG_DOMAIN in the polygonToCells entry points, rather than only rejecting non-finite values. Stricter, but a behavior change for callers who pass unnormalized coordinates today.
Summary
fuzzerPolygonToCellsExperimentalNoHolesintermittently times out in theLibFuzzer clangCI job, including on pushes tomasterwith no pull request involved. The libFuzzer artifact from one of those runs is a 33 byte input that is genuinely slow rather than hung, and it reproduces deterministically.Evidence it hits
masterRun 31322611252 (
pushtomaster, 2026-08-09):Stack at the alarm:
Reproducer
The artifact libFuzzer wrote,
timeout-aa91216172a284fa214931d496dfee23b9ca0e0c:33 bytes, which the harness decodes as:
res= 11numVerts= 2verts[0]=lat 0,lng 6.0276e-322verts[1]=lat -1.61264e+179,lng 0Feeding exactly that through the same calls the fuzzer makes, in a plain
Releasebuild with no sanitizers or coverage instrumentation:About 13s uninstrumented for one input, which is consistent with the 432s the instrumented fuzzer binary reported. Every call returns
E_SUCCESS; nothing is stuck in an infinite loop, the work is simply very large.Why it is expensive
verts[1].latis-1.6e179.latLngToCellonly rejects non-finite coordinates:so a finite but wildly out-of-range latitude is accepted. The bounding box derived from that vertex spans an enormous latitude range,
bboxHexEstimatereturns 396,096 for res 11, and the polyfill iterator walks all of it. Since the fuzzer is free to generate any 8 bytes for a latitude, inputs of this shape are reachable whenever the corpus drifts that way, which matches the intermittent CI failures.Possible directions
I did not want to guess at intent, so rather than send a patch:
[-M_PI_2, M_PI_2]. Latitudes outside that range are not representable on the sphere, so this bounds the work without changing results for in-range input. It does change what comes back for out-of-range input.E_LATLNG_DOMAINin thepolygonToCellsentry points, rather than only rejecting non-finite values. Stricter, but a behavior change for callers who pass unnormalized coordinates today.Happy to open a PR for whichever of these you prefer, or to add the artifact as a regression input if that is more useful.
Environment
masterat e9e84bdCMAKE_BUILD_TYPE=Release