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

Fix a SystemError if unboxing fails in a ufunc #5426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eric-wieser
Copy link
Contributor

@eric-wieser eric-wieser commented Mar 25, 2020

Previously the conversion function could be called while an error was in flight, which isn't legal.

Discovered by #5422 which made this mistake a lowering error.

Output on master:

In [8]: f(arr, out)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-6-bcca0651d5c8> in __int__(self)
      2     def __int__(self):
----> 3         raise RuntimeError()
      4

RuntimeError:

The above exception was the direct cause of the following exception:

SystemError                               Traceback (most recent call last)
<ipython-input-8-ec85c84fdad7> in <module>
----> 1 f(arr, out)

<ipython-input-6-bcca0651d5c8> in __int__(self)
      1 class BadType:
      2     def __int__(self):
----> 3         raise RuntimeError()
      4
      5

SystemError: <class 'RuntimeError'> returned a result with an error set

With this patch, the SystemError no longer occurs and RuntimeError happens by itself.

Previously the conversion function could be called while an error was in flight, which isn't legal.
Also ensure that when this happens the uninitialized output is not used.
@stuartarchibald
Copy link
Contributor

Thanks for submitting this PR to the Numba issue tracker, it's been added to the queue for review. Please be advised however that we are currently in a PR freeze as we are preparing to ship a release candidate (RC). We will begin reviewing PRs again once the RC is out and we thank you in advance for your patience!

@eric-wieser
Copy link
Contributor Author

Any thoughts on this one?

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

Successfully merging this pull request may close these issues.

None yet

2 participants