Luac 5.4.0 beta (oct 2019) crashes when using vararg unpacking in luac -p -l -l

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Luac 5.4.0 beta (oct 2019) crashes when using vararg unpacking in luac -p -l -l

Bas Groothedde

Hi there!

I'm creating a godbolt.org like service for Lua, and during my development I noticed that Luac 5.4.0 Beta (Oct 2019) does not 
like the vararg operator enclosed in a new table. 

I'm not sure if this is changed behaviour in 5.4 or if it has already been reported, however it causes a segmentation fault when 
listing the instructions of a previously dumped chunk and that didn't seem like desired.

code:

local function lua540_beta_oct_2019_vararg(...)
  local asTable = {...}; -- causes luac -p -l -l to crash
  return asTable;
end

reproduce:

  1. Dump this code using luac; luac -o crash.luac crash.lua
  2. List the instructions using luac; luac -p -l -l crash.luac

OS:

  • Windows 10 Professional, Lua 5.4 x64 bit build MSVC
  • Ubuntu 18.04 LTS, gcc 8 x64 and x86 builds

Thank you.



Bas Groothedde
Imagine Programming

Reply | Threaded
Open this post in threaded view
|

Re: Luac 5.4.0 beta (oct 2019) crashes when using vararg unpacking in luac -p -l -l

Luiz Henrique de Figueiredo
In luac.c in case OP_EXTRAARG remove this line:
printf(COMMENT); PrintConstant(f,ax);

Thanks for the report.

Reply | Threaded
Open this post in threaded view
|

Re: Luac 5.4.0 beta (oct 2019) crashes when using vararg unpacking in luac -p -l -l

Bas Groothedde

On 08-12-2019 19:04, Luiz Henrique de Figueiredo wrote:

In luac.c in case OP_EXTRAARG remove this line:
printf(COMMENT); PrintConstant(f,ax);

Thanks for the report.


Thank you, easy fix. This explains the unexpected comments in the EXTRAARG output as well.