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
A nif I have been running produces a "bus error" when it takes a couple seconds to complete. In some conditions it shows up as a SegFault which I believe to the same as a "bus error" but I'm not sure. The algorithm is a curve decimation algorithm that of course takes longer to complete the more points you give it and around 21600 data points it takes a couple seconds to complete and produces the "bus error". Curiously the Rust doesn't crash if compiled into just a Rust application and run directly.
Here's some example output:
$ mix test
--Path.expand--
--File.stream--
--CSV.decode--
--to_rust--
**simplify** num_records: 21600
**collected**
**LineString**
[1] 13915 bus error mix test
I'm not sure if this is directly a memory related issue or if it has to do with how long it takes to complete. Is there some rustler configuration I'm missing that would allow this nif to complete successfully?
We simplified this example down to a single function. The new version is available in the same repository.
This problem appears to be caused by a stack overflow. As Issue 294 pointed out, there's not much Rustler could do to prevent this issue, so we're going to close the ticket.
A nif I have been running produces a "bus error" when it takes a couple seconds to complete. In some conditions it shows up as a SegFault which I believe to the same as a "bus error" but I'm not sure. The algorithm is a curve decimation algorithm that of course takes longer to complete the more points you give it and around 21600 data points it takes a couple seconds to complete and produces the "bus error". Curiously the Rust doesn't crash if compiled into just a Rust application and run directly.
Here's some example output:
I'm not sure if this is directly a memory related issue or if it has to do with how long it takes to complete. Is there some rustler configuration I'm missing that would allow this nif to complete successfully?
I've created a self contained repo to demonstrate the issue: https://github.com/anthonyfalzetti/geo_simplify
All of the Rust code is in this one file: https://github.com/anthonyfalzetti/geo_simplify/blob/main/native/geonif/src/lib.rs
The text was updated successfully, but these errors were encountered: