openvenues / gopostal

Go (cgo) interface to libpostal for fast international address parsing/normalization
MIT License
160 stars 32 forks source link

Libpostal throwing segmentation violations & crashing the entire app #18

Closed Scott-Reese closed 1 year ago

Scott-Reese commented 1 year ago

We are currently using the gopostal library in a webserver application. Upon receiving an HTTP request from a client, the app will use gopostal to parse the address included in the client's request and return the parsed components. However, during our heavy load testing (and only during such testing), we are seeing the underlying libpostal library throwing segmentation violations, which in turn is crashing the entire application. Weirdly enough, the app works just fine during normal traffic.

albarrentine commented 1 year ago

Try reinstalling the latest libpostal, merged this today https://github.com/openvenues/libpostal/pull/640 which should prevent the segfault (heavier load testing is probably using long enough sequences that it has to reallocate aligned memory more, which is where it’s more likely to encounter that bug, which is only really introduced in very recent commits when no longer relying on the compiler to implement aligned realloc, which most modern compilers do, it’s just not standards-guaranteed).

Scott-Reese commented 1 year ago

@albarrentine Reran our performance tests today with your latest libpostal commits, and no more segmentation faults! Thank you very much for the quick turnaround on this; much appreciated!