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

Applying numba.typed.List to a nested Python list doesn't result in a nested typed-list #6091

Open
2 tasks done
rht opened this issue Aug 6, 2020 · 3 comments
Open
2 tasks done
Labels
bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS bug

Comments

@rht
Copy link
Contributor

rht commented Aug 6, 2020

Reporting a bug

Instead, it turns into a reflected list.

I'm copy-pasting the example reported by @esc in #6090 (comment):

In [4]: List([[1, 2, 3], [4, 5, 6]])
Out[4]: ListType[reflected list(int64)<iv=None>]([[4892186944], [<IPython.lib.pretty.Group object at 0x124ad7040>, <IPython.lib.pretty.Group object at 0x124934cd0>]])

Additionally, there is a segmentation fault when the reflected list is assigned to a Python variable.

In [6]: l = List([[1, 2, 3], [4, 5, 6]])
/Users/vhaenel/git/numba/numba/typed/typedlist.py:66: NumbaPendingDeprecationWarning:
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'item' of function 'impl_append.<locals>.impl'.

For more information visit https://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types

File "numba/typed/listobject.py", line 596:

    def impl(l, item):
    ^

  l.append(item)
/Users/vhaenel/git/numba/numba/core/ir_utils.py:2031: NumbaPendingDeprecationWarning:
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'item' of function '_append'.

For more information visit https://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types

File "numba/typed/typedlist.py", line 65:
@njit
def _append(l, item):
^

  warnings.warn(NumbaPendingDeprecationWarning(msg, loc=loc))

In [7]: l
Out[7]: [1]    46853 segmentation fault (core dumped)  ipython
@stuartarchibald
Copy link
Contributor

Thanks for the report. Given the typed list ctor implementation I don't think this is unexpected, but clearly shouldn't happen.

@rht
Copy link
Contributor Author

rht commented Aug 6, 2020

Reminder to update the documentation to be along the line of #6090 once fixed.

@esc
Copy link
Member

esc commented Aug 6, 2020

@rht thanks for reporting, much appreciated.

@sklam sklam added the bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS label Aug 10, 2020
@esc esc added this to To do in numba.typed.List Sep 23, 2020
@esc esc removed their assignment Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS bug
Projects
Development

No branches or pull requests

4 participants