google / google/s2-geometry-library-java

Infinite loop in coverer builder

Đang mở
#55 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
587
Fork
231
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

```
S2RegionCoverer coverer = S2RegionCoverer.builder()
.setMinLevel(20)
.setMaxLevel(10)
.build();
S2Cap cap = S2Cap.fromAxisAngle(new S2Point(1, 0, 0), S1Angle.degrees(5));
S2CellUnion covering = coverer.getCovering(cap); // OutOfMemoryError
```

The coverer keeps trying to refine cells to reach minLevel(20), but maxLevel(10) prevents going past level 10, so it never satisfies the min level constraint and spirals until the JVM runs out of heap. Could be prevented by checking that min < max

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.