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
{{ message }}
Repository navigation
incorrect handling of igraph warnings if the user turns them into an exception #38
MemoryError: Error at src/attributes.c:284: not enough memory to allocate attribute hashes, Out of memory
The problem is that the C core of igraph never anticipates that some warnings are turned into errors, therefore it does not bail out from igraph_degree_sequence_game at the point where the warning was raised.
It seems like this cannot be solved without re-writing nearly every function handler in the C core, which I'd rather not attempt before the 0.8 release.
Basically, what we need to do in the C core is that we need to check PyErr_Occurred() after every igraph function call in case a warning generated by igraph was turned into an error. If this happens, we need to do regular cleanup instead of continuing with the C glue code.
Another option would be to change the C core such that warning handlers could return a value indicating that the warning has been converted into an error by the higher level layer, at which point the C core could treat the warning as if it was an exception.
Activity
ntamas commentedon Jan 30, 2020
It seems like this cannot be solved without re-writing nearly every function handler in the C core, which I'd rather not attempt before the 0.8 release.
Basically, what we need to do in the C core is that we need to check
PyErr_Occurred()after every igraph function call in case a warning generated by igraph was turned into an error. If this happens, we need to do regular cleanup instead of continuing with the C glue code.ntamas commentedon Jan 30, 2020
Another option would be to change the C core such that warning handlers could return a value indicating that the warning has been converted into an error by the higher level layer, at which point the C core could treat the warning as if it was an exception.