Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of Memory Errors cause core dump #254

Open
rbiro opened this issue May 13, 2020 · 0 comments
Open

Out of Memory Errors cause core dump #254

rbiro opened this issue May 13, 2020 · 0 comments

Comments

@rbiro
Copy link

rbiro commented May 13, 2020

In the event of an Out of Memory Error reportException fails at:

    PyObject   *tracebackModule = PyImport_ImportModule("traceback");
    PyObject   *format_exception = PyObject_GetAttrString(tracebackModule,"format_exception");

with a NULL pointer dereference. The problem is that without memory, python cannot load the traceback module and returns NULL. Then the attempt to get format_exception fails with a null pointer dereference and we get a core dump.

One possible solution is to load the traceback module at init time. We have implemented this, but it's on top of my other patches which I don't believe have been accepted yet.

A second possible solution is to just deal with the NULL pointer and not attempt to format the exception when the traceback module doesn't load.

For a workaround, just don't run out of memory :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant