[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3.4 and LPeg 1.0.1 dumped core on me
- From: Andrew Gierth <andrew@...>
- Date: Sat, 10 Nov 2018 06:31:31 +0000
>>>>> "Sean" == Sean Conner <sean@conman.org> writes:
Sean> So I'm participating in this years National Novel Generation
Sean> Month [1] and I finished my entry. While generating the output, I
Sean> had to use Lua 5.1 because Lua 5.3 would crash---hard.
Looks like lpeg is at fault: substcap is passing a bad length to
luaL_addlstring.
Here in substcap:
403 while (!isclosecap(cs->cap)) { /* traverse nested captures */
404 const char *next = cs->cap->s;
405 luaL_addlstring(b, curr, next - curr); /* add text up to capture */
"next" is 0x0 while "curr" is a valid pointer.
If it helps, here is the text:
(gdb) print curr
$5 = 0x80128317f "in. By that time you may be more sensible.\""
Sean> System specifics: x86 Linux (so 32-bit). I haven't tried it on
Sean> any other system yet. But the code is available:
I tested on 64-bit freebsd and lua 5.3.5, it died with "not enough
memory for buffer allocation", but the cause looks to be the same as
your error.
--
Andrew.