Skip to content

[jit] Properly catch errors in PythonOps#12243

Closed
driazati wants to merge 1 commit intopytorch:masterfrom
driazati:python_err
Closed

[jit] Properly catch errors in PythonOps#12243
driazati wants to merge 1 commit intopytorch:masterfrom
driazati:python_err

Conversation

@driazati
Copy link
Contributor

@driazati driazati commented Oct 2, 2018

If a PythonOp throws an error it raises an exception to the interpreter and also releases the GIL which causes pybind to segfault

This fix catches pybind errors while the GIL is still held and throws a python_error to re-capture the GIL

Fixes #12118

@apaszke

If a PythonOp throws an error it raises an exception to the interpreter
and also releases the GIL which causes [pybind to
segfault](potassco/clingo#42)

This fix catches pybind errors while the GIL is still held and throws a
`python_error` to capture the GIL
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

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

Successfully merging this pull request may close these issues.

JIT segfaults when a Python call throws.

4 participants