Re: Segfault introduced in b82fc3d on v2.1 branch
- From: Peter Melnichenko <mpeterval@xxxxxxxxx>
- To: luajit@xxxxxxxxxxxxx
- Date: Wed, 10 Jun 2015 15:46:27 +0300
On Wed, Jun 10, 2015 at 12:50 AM, Mike Pall <mike-1506@xxxxxxxxxx> wrote:
Peter Melnichenko wrote:
LuaJIT 2.1.0 built from v2.1 branch head (4da1bb6) segfaults
on the following code (only with jit on):
[...]
I can observe it on all commits starting from b82fc3d. I'm running
32-bit Ubuntu, gcc version is 4.6.3.
Thank you for the bug report and the test case! Fixed in the git
repository.
--Mike
I've pulled the fix and the segfault is gone, but the second test with
a spurious table still fails. Here is a slightly reduced version:
local function recurse(expr)
if type(expr) == "table" then
local t = {0}
for i = 1, #expr do
t[i] = recurse(expr[i])
end
print(t[2])
end
end
recurse {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
{
{
{ 0, 0, 0 },
},
{
{
{ 0, 0, 0 },
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
{ 0, 0, 0, 0, 0, 0 }
}
},
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
{ 0, 0 }
}
},
{ }
}
When using LuaJIT built from the latest commit (08e100e) it prints
several nils and a table, while it should only print nils (and so it does
with jit off).
--
Best regards,
Peter
Other related posts: