lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 10/11/22, Benoit Germain <bnt.germain@gmail.com> wrote:

> I can't say for sure, but usually when I had crashes when mixing Lanes and
> LuaJIT it had to do with the LuaJIT memory allocator not being threadsafe,
> and therefore to select the "protected" allocator mode (see Lanes
> documentation). Lanes tries to detect luajit automatically,

> You could then force the "protected"
> allocator mode yourself.

Yes, I did try manually activating the allocator = "protected" mode.
But it didn't seem to help the problem.

If I constrain my program to run with only 1 Lane, I seem to avoid seg
faulting, so there does seem like there is some kind of contention
problem. But I don't know where it is coming from.
I believe the code being run in lanes that is crashing is written in
all pure Lua and there are no C modules (and thus no userdata) being
used in these sections.

> maybe it is
> failing when run with Pallene?

To clarify, Lua Lanes works with Pallene.

The crash only happens with LuaJIT. When running LuaJIT, Pallene is
completely removed from the test. All the Pallene code was converted
back to regular Lua so it could be run in LuaJIT.