gojuno / gojuno/go.morton

panic: morton64 with 32 bits per dimension received signed -9223372036854775808 to pack

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

When we try to use a hex_id with a negative value (for example, -4611686018427391893 - int64) we can find its center without errors (POINT (2.893676000981707085+09, -90), then we use these coordinates for searching hex_id by point. In this case, we get hex
INFO [0001] {-9223372036854775808 -9223372036854775808}
And then we try to SPack these values with Morton64 lib, we catch the panic of the service.
https://github.com/gojuno/go.morton/blob/94709bd871ce24bf7892c006badb19b85777dae1/morton64.go#L77

Is it possible in some way to forward an error or get rid of panic?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at morton64.go line 77 and reproduce the panic with the negative hex_id and the resulting -9223372036854775808 coordinate values. Determine the library's intended behavior for out-of-range signed inputs; done means the case no longer panics and its outcome is covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.