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 "Internal error ... local variable 'errstr' referenced before assignment during BoundFunction(...)" #5952

Merged
merged 2 commits into from Jul 10, 2020

Conversation

jalsti
Copy link
Contributor

@jalsti jalsti commented Jul 2, 2020

In cc673c1 a change had been introduced in numba/core/types/functions.py:399 which includes two problems that can occur (only) when config.DEVELOPER_MODE is active:

  • it uses the errstr variable before assignment
  • it does not use the real function call to _bt_as_lines(bt)

This pull request fixes both problems.

@esc esc added this to the Numba 0.51 RC milestone Jul 3, 2020
@esc
Copy link
Member

esc commented Jul 3, 2020

@jalsti thanks for submitting this, I have queued it for review.

@esc
Copy link
Member

esc commented Jul 6, 2020

@jalsti could you potentially add the code and configuration you used to trigger it? Maybe that can form the basis of a test?

@jalsti
Copy link
Contributor Author

jalsti commented Jul 6, 2020

Minimal example would be to set developer mode, start ipython:

$ export NUMBA_DEVELOPER_MODE=1
$ ipython3

and use following snippet, which triggers the problem here (with Numba 0.50.0 and 0.50.1)

import numba 
@numba.jit("int64[:,:,::1](int64[:,:,::1])") 
def trigger_5952(rgb): 
    foo = rgb.max(-1)

(Normally the parameter going into the function was here an RGB image as Numpy array, but the above seems enough to trigger the problem.)

stuartarchibald added a commit to stuartarchibald/numba that referenced this pull request Jul 7, 2020
@stuartarchibald
Copy link
Contributor

Thanks for the example. I've made this into a test here: stuartarchibald@3523ea5, I think with this applied, the above patch can be accepted as it demonstrably fixes the issue. Many thanks for reporting this and for supplying a fix!

@stuartarchibald stuartarchibald added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Jul 7, 2020
@jalsti
Copy link
Contributor Author

jalsti commented Jul 7, 2020

Thank you very much.

@stuartarchibald stuartarchibald self-assigned this Jul 8, 2020
@stuartarchibald
Copy link
Contributor

@jalsti no problem, thank you for helping with this! I've applied 3523ea5 to this branch. @esc please could you verify and approve as you see fit, thanks.

Copy link
Member

@esc esc left a comment

Choose a reason for hiding this comment

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

I tried this locally, and can confirm the tests to check that the patch fixes the bug, it LGTM.

@esc esc added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on author Waiting for author to respond to review labels Jul 10, 2020
@stuartarchibald
Copy link
Contributor

Thanks @esc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants