[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Strange intermittent LuaJIT errors (likely my fault)
- From: Alexander Gladysh <agladysh@...>
- Date: Thu, 5 Apr 2012 01:54:16 +0400
Hi, Mike, all,
LuaJIT v2.0.0-beta9-39-gc3e1d72
Linux localhost-ag 2.6.38-13-virtual #53-Ubuntu SMP Mon Nov 28
19:59:56 UTC 2011 i686 i686 i386 GNU/Linux
Ubuntu 11.04
While trying to optimize my Lua serialization library, luatexts[1],
I've stumbled upon this strange crash in LJ2:
./luajit: /usr/local/share/lua/5.1/lua-nucleo/tdeepequals.lua:0:
attempt to index a boolean value
stack traceback:
/usr/local/share/lua/5.1/lua-nucleo/tdeepequals.lua: in function 'tdeepequals'
/usr/local/share/lua/5.1/lua-nucleo/ensure.lua:318: in function
'ensure_returns'
test/test.lua:2238: in main chunk
[C]: ?
Note strangely missing line info. This happens during generative test
suite when I'm trying to load mutated data — so all kinds of bad
things may happen.
The bug appears one time of about five runs of luatexts test suite.
Plain Lua does not crash. Also, we use tdeepequals for a long time and
it is unlikely (but possible) that the bug is there.
Strangely it seems that, the longer I wait between runs, the higher is
the probability that I'll see the bug.
Most likely I screwed up somewhere in my C code badly and corrupting
memory all over the place, so I'm not blaming the LuaJIT. Probably
something stupid that I'll see in the morning. But I'm reporting this
problem anyway just in case you'll say right away what may lead to
such errors (also it looks weird to me). Or maybe you'll suggest what
additional diagnostics I may acquire and how. (Note that code is
rather ugly at this moment... But it not *that* ugly, and it was
stable until recently...)
I was not able to wait until valgrind run finishes, leaving it overnight...
Thanks,
Alexander.
[1] https://github.com/agladysh/luatexts/
P.S. Just in case you'll want to try to reproduce my problem:
sudo luarocks install lua-nucleo
git clone git://github.com/agladysh/luatexts.git
cd luatexts
git checkout ag/faster-load-value
sudo luarocks make rockspec/luatexts-scm-1.rockspec
luajit test/test.lua
Or I can give you a shell to the machine in question.