-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Calling LUT2d.eval on a numpy array input with out of bounds elements crashes python. I think this is from the pybind11 bindings not catching the journal except when run within the openMP loop.
Reproducer:
import isce3, numpy as np, journal
x = np.linspace(0,5,10)
y = np.linspace(10,20,2)
z = np.vstack((np.linspace(100,200,10), np.linspace(100,200,10)))
lut2d = isce3.core.LUT2d(x, y, z)
print(lut2d.bounds_error)
# True
# Scalar inputs: exception is caught and it's okay
try:
lut2d.eval(1.0, 11.0)
except RuntimeError as e:
print(e)
# journal:
# -- Out of bounds LUT2d evaluation at 1 11
# -- - bounds are 10 20 0 5
# RuntimeError: isce.core.LUT2d: application error
# Mixed scalar/array: crashes Python
try:
lut2d.eval(10.0, np.array([1.0,111.0]))
except RuntimeError as e:
print(e)
# journal:
# -- Out of bounds LUT2d evaluation at 10 111
# -- - bounds are 10 20 0 5
# libc++abi: terminating due to uncaught exception of type pyre::journal::application_error
# <aborted>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels