Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h3_line fails with invalid memory alloc request size error #71

Closed
kalenikaliaksandr opened this issue May 18, 2022 · 2 comments
Closed

Comments

@kalenikaliaksandr
Copy link

kalenikaliaksandr commented May 18, 2022

00:23:10 [gis] > select h3_line('88bad9c195fffff', '887fa67635fffff');
ERROR:  XX000: invalid memory alloc request size 18446744073709551608
LOCATION:  palloc, mcxt.c:1078
Time: 1,489 ms

I tried to investigate this problem myself and found out that h3LineSize (https://github.com/bytesandbrains/h3-pg/blob/bf6198b346946ef399498bd532e17438db4bac77/h3/src/lib/traversal.c#L204) returns -1 for my input. Looks like assert that positive size is returned by h3LineSize need to be added.

I also took a look at h3's that cause this error and seems like one of them crosses 180th meridian.

00:40:50 [gis] > select h3_to_geo('88bad9c195fffff');
┌────────────────────────────────────────┐
│               h3_to_geo                │
├────────────────────────────────────────┤
│ (179.9969603999748,-22.92832332131207) │
└────────────────────────────────────────┘
(1 row)

Time: 2,285 ms
@zachasme
Copy link
Owner

Thanks, good catch! We definitely need an assert there.

@zachasme
Copy link
Owner

This will be covered when v4 is released. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants