Open groutr opened 11 months ago
I was able to build my own version of richdem and produce a coredump with a generated test case. The backtrace is pointing to this particular line. https://github.com/r-barnes/richdem/blob/c5a183ada30fbd1b8587121e0d313b4cda9390c0/include/richdem/flowmet/OCallaghan1984.hpp#L26C3-L26C29
#0 richdem::Array3D<float>::setAll (val=-1, this=0x558b2871c5c0) at xxxxxxx/richdem-dev/x86_64-conda-linux-gnu/include/c++/12.3.0/bits/unique_ptr.h:191
#1 richdem::FM_OCallaghan<(richdem::Topology)0, float> (elevations=..., props=...) at xxxxxxx/richdem-dev/include/richdem/flowmet/OCallaghan1984.hpp:26
Test case:
import numpy as np
import richdem
k = np.random.rand(11999, 20000).astype('float32')
rd = richdem.rdarray(k, no_data=-999)
rd.geotransform = (1.0, 0, 0, 0, 1.0, 0)
richdem.FlowProportions(rd, method='D8')
After playing with this some more, I'm wondering if maybe the culprit is in the python bindings. I'm able to process my DEM with the standalone executables that richdem builds.
I am working on large DEM sized (11999, 20000) with a dtype of float32 and experiencing a segfault on windows and linux.
This was the backtrace I was able to obtain from the coredump.
Interestingly, richdem doesn't segfault when using a slightly smaller DEM. I tried 11500x20000 and it ran successfully. I think the system has plenty of memory available because watching memory usage under windows, at the time of the crash, there is still a healthy amount of free memory.
EDIT: This is running Python 3.11 and richdem 2.3.0.