lupa icon indicating copy to clipboard operation
lupa copied to clipboard

LuaJIT 5.1 crashed(Segmentation fault) during out-of-range indexing on a _LuaObject

Open oeway opened this issue 8 years ago • 0 comments

import lupa
lua = lupa.LuaRuntime()
lua.require('torch')
lg = lua.globals()
a = lg.torch.Tensor(2)
print(a[5]) # any out of range indexing will cause the core to crash.

the output is:

Segmentation fault (core dumped)

And then it quit the entire python process immediately, but in torch itself, the error can be captured:

bad argument #2 to '?' (out of range at /tmp/luarocks_torch-scm-1-6180/torch7/generic/Tensor.c:888)                                
stack traceback:                                                                                                                   
        [C]: at 0x7f67699b60b0                                                                                                     
        [C]: in function '__index'                                                                                                 
        [string "_RESULT={a[0]}"]:1: in main chunk                                                                                 
        [C]: in function 'xpcall'                                                                                                  
        /home/xxx/torch/install/share/lua/5.1/trepl/init.lua:651: in function 'repl'                                               
        .../wei/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk                                             
        [C]: at 0x00406670 

Any idea?

oeway avatar Mar 13 '16 01:03 oeway