lua-users home
lua-l archive

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


On Sun, May 1, 2011 at 6:26 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
> On Mon, May 2, 2011 at 02:16, Alexander Gladysh <agladysh@gmail.com> wrote:
>
>> On rather small JSON data (will prepare a minimal sample ASAP) we get
>> this error from luajson[1] 1.2.1:
>
>> /luajson/lua/json/decode.lua:90: too many pending calls/choices
>
> Here is the data that triggers the crash:
>
> https://gist.github.com/950942
>
> Steps to reproduce (involving json2lua for ease of use):
>
> curl https://gist.github.com/raw/950942/f9ef959e46512793e7273a060bc58b04b567ea16/bad.json
>>bad.json
>
> sudo luarocks install json2lua
> $ json2lua <bad.json
> luajit2: /usr/local/share/lua/5.1//json/decode.lua:90: too many
> pending calls/choices
> stack traceback:
>        [C]: in function 'match'
>        /usr/local/share/lua/5.1//json/decode.lua:90: in function 'json_decode'
>        (command line):79: in main chunk
>        [C]: ?
>
> json2lua is quite unsophisticated, and should not affect the outcome:
>
> https://github.com/agladysh/json2lua/blob/master/json2lua#L182
Good catch, I've found this is indeed a nasty little problem through
many of my versions released. I'll need to figure out some way to
linearize the parsing somehow.
It appears the maximum depth LuaJSON can handle right now is ~24
levels deep, even with trivial objects.


-- 
Thomas Harning Jr.
Support my wife, Jenn, as she runs her first 10k, donations
appreciated... every dollar helps!
http://www.akidagain.org/site/TR/Cincinnati5k10k2011/General?px=1127201&pg=personal&fr_id=1140