-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Hi Yue,
I hope you're doing well. This is not an urgent bug, but I thought I'd report it anyways in case it's helpful to be aware of.
The following code, instead of returning an exception, causes the entire program to crash.
from pyoptinterface.ipopt import Model
import pyoptinterface as poi
m = Model()
x = m.add_variable()
m.get_variable_attribute(x, poi.VariableAttribute.Value)It seems that pyoptinterface triggers a segmentation fault when trying to read the Value attribute prior to optimization when using ipopt:
Windows fatal exception: access violation
Current thread 0x000027e4 (most recent call first):
File "C:\Users\staadeck\Software\pyoframe\.venv\Lib\site-packages\pyoptinterface\_src\ipopt.py", line 84 in <lambda>
File "C:\Users\staadeck\Software\pyoframe\.venv\Lib\site-packages\pyoptinterface\_src\solver_common.py", line 74 in _direct_get_entity_attribute
As a workaround, I'm explicitly checking that the model was solved before letting users access the Value attribute.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels