LuaLanes / lanes

Lanes is a lightweight, native, lazy evaluating multithreading library for Lua 5.1 to 5.4.
Other
465 stars 96 forks source link

segmentation fault #193

Closed TT-SW closed 3 years ago

TT-SW commented 3 years ago

Why I can't execute the test code? It always report follow error:

➜ lanes-master cd tests ➜ tests lua timer.lua [1] 6458 segmentation fault lua timer.lua ➜ tests lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio

require "lanes".configure() [1] 6507 segmentation fault lua ➜ tests require "lanes" require:108: no matches found: gen(function(n) return 2*n end) ➜ tests lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio require "lanes" [1] 6543 segmentation fault lua

What is the problem and how to solve it? thanks~

pocco81 commented 3 years ago

I can't execute a simple program either. I can't even require the library without getting this:

$ lua
Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio
> local lanes = require "lanes".configure()
.../.luaver/luarocks/3.6.0_5.4/share/lua/5.4/lanes.lua:340: internal error: function dump failed.
stack traceback:
    [C]: in function 'lanes.core.lane_new'
    .../.luaver/luarocks/3.6.0_5.4/share/lua/5.4/lanes.lua:340: in function <...../.luaver/luarocks/3.6.0_5.4/share/lua/5.4/lanes.lua:338>
    ...s5758/.luaver/luarocks/3.6.0_5.4/share/lua/5.4/lanes.lua:583: in function 'lanes.configure'
    stdin:1: in main chunk
    [C]: in ?

This is my Lua dev setup:

$ luaver current
==>  Current versions:
==>  lua-5.4.3
==>  luarocks-3.6.0

EDIT:

Lua lanes isn't working with anything <lua-5.2.4. With this it now allows to be installed perfectly and without any issues:

shell$ lua
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> local lanes = require "lanes".configure()
> 

I'll open a new issue for this because in luarocks.org it says that it works with "lua >= 5.1"

TT-SW commented 3 years ago

I have fixed this issue, there is a problem with my download package. and my colleague uses luarocks to install lanes, this problem is not occur. I copied his installed version lane.lua and lanes/ core.so, this problem is solved. thanks