lua-users home
lua-l archive

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

>>>>> "Sean" == Sean Conner <> 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

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.