lua-users home
lua-l archive

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


  So I'm participating in this years National Novel Generation Month [1] and
I finished my entry.  While generating the output, I had to use Lua 5.1
because Lua 5.3 would crash---hard.  

[spc]lucy:~/writings/nanogenmo/2018>lua run.lua TheEmeraldCityOfOz.txt >/tmp/output
Segmentation fault (core dumped)
[spc]lucy:~/writings/nanogenmo/2018>lua-51 run.lua TheEmeraldCityOfOz.txt >/tmp/output
[spc]lucy:~/writings/nanogenmo/2018>

  I'm not sure what's going on.  From the core dump:

(gdb) where
#0  0x00bfb98c in memcpy () from /lib/tls/libc.so.6
#1  0x0805b7ff in luaL_addlstring ()
#2  0x00113487 in substcap () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#3  0x00112c47 in pushcapture () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#4  0x0011374f in getcaptures () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#5  0x00116ef4 in lp_match () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#6  0x0804ef6a in luaD_precall ()
#7  0x08058986 in luaV_execute ()
#8  0x0804f27d in luaD_call ()
#9  0x0804f2be in luaD_callnoyield ()
#10 0x0804d0eb in lua_callk ()
#11 0x00112d31 in pushcapture () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#12 0x001131be in addonestring () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#13 0x00113495 in substcap () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#14 0x00112c47 in pushcapture () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#15 0x0011374f in getcaptures () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#16 0x00116ef4 in lp_match () from /home/spc/.luarocks/lib/lua/5.3/lpeg.so
#17 0x0804ef6a in luaD_precall ()
#18 0x080589e1 in luaV_execute ()
#19 0x0804f27d in luaD_call ()
#20 0x0804f2be in luaD_callnoyield ()
#21 0x0804d146 in f_call ()
#22 0x0804e8ac in luaD_rawrunprotected ()
#23 0x0804f6ec in luaD_pcall ()
#24 0x0804d1a8 in lua_pcallk ()
#25 0x0804b0e4 in docall ()
#26 0x0804baba in pmain ()
#27 0x0804ef6a in luaD_precall ()
#28 0x0804f264 in luaD_call ()
#29 0x0804f2be in luaD_callnoyield ()
#30 0x0804d146 in f_call ()
#31 0x0804e8ac in luaD_rawrunprotected ()
#32 0x0804f6ec in luaD_pcall ()
#33 0x0804d1a8 in lua_pcallk ()
#34 0x0804bb91 in main ()

System specifics:  x86 Linux (so 32-bit).  I haven't tried it on any other
system yet.  But the code is available:

	https://github.com/spc476/NaNoGenMo-2018

You may need to modify run.lua to comment out two lines of code:

diff --git a/run.lua b/run.lua
index 2f939c4..1cfa81c 100644
--- a/run.lua
+++ b/run.lua
@@ -22,7 +22,7 @@
 -- luacheck: ignore 611
 
 local lpeg   = require "lpeg"
-local wrap   = require "org.conman.string".wrap
+--local wrap   = require "org.conman.string".wrap
 local valley = require "valley"
 local chef   = require "chef"
 
@@ -79,5 +79,5 @@ f:close()
 
 text = normalize:match(text)
 text = story:match(text)
-text = dowrap:match(text)
+--text = dowrap:match(text)
 print(text)

to get it to run (or not, in my case).

And as I said, Lua 5.1 works with no issues.  Oh, I just noticed---my Lua
5.1 is pulling in LPeg 0.12, not LPeg 1.0.1.  Hmm ... 

  -spc (So it may be an LPeg issue ... )

[1]	https://github.com/NaNoGenMo/2018