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

Segfault in NRT from use of generator #3081

Open
2 tasks done
stuartarchibald opened this issue Jul 5, 2018 · 0 comments
Open
2 tasks done

Segfault in NRT from use of generator #3081

stuartarchibald opened this issue Jul 5, 2018 · 0 comments
Labels
bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS

Comments

@stuartarchibald
Copy link
Contributor

Reporting a bug

Reported on gitter by @igorghi:

import numba
import numpy as np
 
@numba.njit
def comb_2_gen_numba_test(arr, n_batch):
    n = arr.shape[0]
    batch = np.zeros((n_batch,2),dtype=np.int32)
    c=0
    for i in range(n-1):
        for k in range(i+1,n):
            batch[c,0] = arr[i]
            batch[c,1] = arr[k]
            c+=1  
            if c%n_batch == 0:
                c=0
                yield batch
               
               
a = comb_2_gen_numba_test(np.arange(4),2)
 
for elem in a:
    print(elem)

this segfaults. Doing gdb -ex r -ex bt --args python gi6.py gives:

Program received signal SIGABRT, Aborted.
0x00007ffff7828277 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
#0  0x00007ffff7828277 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff7829968 in __GI_abort () at abort.c:90
#2  0x00007ffff786ad37 in __libc_message (do_abort=do_abort@entry=2, 
    fmt=fmt@entry=0x7ffff797cd58 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:196
#3  0x00007ffff7873499 in malloc_printerr (ar_ptr=0x7ffff7bb8760 <main_arena>, ptr=<optimized out>, 
    str=0x7ffff797ce18 "double free or corruption (fasttop)", action=3) at malloc.c:5025
#4  _int_free (av=0x7ffff7bb8760 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3847
#5  0x00007fffdecc6fbe in NRT_MemInfo_call_dtor ()
   from <numba_path>/numba/runtime/_nrt_python.cpython-36m-x86_64-linux-gnu.so
#6  0x00007fffdecc58bd in MemInfo_dealloc ()
   from <numba_path>/numba/runtime/_nrt_python.cpython-36m-x86_64-linux-gnu.so
#7  0x00007fffeabfb919 in array_dealloc ()
   from <env_path>/lib/python3.6/site-packages/numpy/core/multiarray.cpython-36m-x86_64-linux-gnu.so
#8  0x00005555556f26f8 in call_function ()
#9  0x0000555555714cba in _PyEval_EvalFrameDefault ()
#10 0x00005555556ed459 in PyEval_EvalCodeEx ()
#11 0x00005555556ee1ec in PyEval_EvalCode ()
#12 0x00005555557689a4 in run_mod ()
#13 0x0000555555768da1 in PyRun_FileExFlags ()
#14 0x0000555555768fa4 in PyRun_SimpleFileExFlags ()
#15 0x000055555576ca9e in Py_Main ()
#16 0x00005555556344be in main ()

@stuartarchibald stuartarchibald added bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS and removed bug labels Dec 15, 2021
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
Projects
None yet
Development

No branches or pull requests

1 participant