lua-users home
lua-l archive

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


Upgrading to 0.11 unfortunately caused a seg fault for me. After some
hunting I found that the pattern causing the problem was the LPeg
parser for Moonscript. I've uploaded an butchered standalone version
of the parser here:

Simply running this with lua <file> reproduces the seg fault for me
(tried with latest LuaJIT as well as Lua 5.1.5). The resulting trace
is this:

Program terminated with signal 11, Segmentation fault.
#0  0x00000000004c68a7 in finaltarget (code=0x4157f010, i=40304) at lpcode.c:545
545	  while (code[i].i.code == IJmp)
(gdb) bt
#0  0x00000000004c68a7 in finaltarget (code=0x4157f010, i=40304) at lpcode.c:545
#1  0x00000000004c6918 in finallabel (code=0x4157f010, i=11632) at lpcode.c:556
#2  0x00000000004c793a in peephole (compst=0x7fff4eb7c720) at lpcode.c:854
#3  0x00000000004c7b0f in compile (L=0x41adc378, p=0x40539028) at lpcode.c:896
#4  0x00000000004c2738 in prepcompile (L=0x41adc378, p=0x40539028,
idx=1) at lptree.c:1039
#5  0x00000000004c2942 in lp_match (L=0x41adc378) at lptree.c:1094

This is on Linux x86_64, using gcc version 4.7.2 (Ubuntu/Linaro
4.7.2-2ubuntu1). Let me know if I can be of any further assistance.


Nils Nordman <>

On Wed, Mar 27, 2013 at 8:23 PM, Roberto Ierusalimschy
<> wrote:
> What is LPeg? LPeg is a new (well, not that new now) pattern-matching
> library for Lua, based on Parsing Expression Grammars (PEGs).