You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This lua script causes redis (atleast 2.6.9) to segfault:
local t={}; for i=1,288 do t[i]=0 end
redis.call("SET", KEYS[1], struct.pack(("H"):rep(288), unpack(t)))
t = struct.unpack(("H"):rep(288), redis.call("GET", KEYS[1]))
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff744f7d0 in _int_malloc (av=0x7ffff7738e40, bytes=129)
at malloc.c:4496
4496 malloc.c: No such file or directory.
in malloc.c
(gdb) bt
#0 0x00007ffff744f7d0 in _int_malloc (av=0x7ffff7738e40, bytes=129)
at malloc.c:4496 #1 0x00007ffff74527f6 in _int_realloc (av=0x7ffff7738e40,
oldp=0x6ecbc0, oldsize=80, nb=144) at malloc.c:5274 #2 0x00007ffff7452d40 in *_GI___libc_realloc (oldmem=0x6ecbd0,
bytes=128) at malloc.c:3822 #3 0x000000000045741c in luaM_realloc () #4 0x000000000045b6c8 in setarrayvector () #5 0x000000000045bfdd in resize () #6 0x000000000045bd43 in newkey () #7 0x000000000045cf95 in luaV_settable () #8 0x000000000045dfb9 in luaV_execute () #9 0x000000000045561d in luaD_call () #10 0x0000000000454cf7 in luaD_rawrunprotected () #11 0x0000000000454d72 in luaD_pcall () #12 0x000000000045249f in lua_pcall () #13 0x0000000000444b19 in evalGenericCommand (c=0x7ffff5080000,
evalsha=0) at scripting.c:872 #14 0x000000000041b60b in call (c=0x7ffff5080000, flags=7)
at redis.c:1502 #15 0x000000000041babd in processCommand (c=0x7ffff5080000)
at redis.c:1677 #16 0x000000000042641f in processInputBuffer (c=0x7ffff5080000)
at networking.c:1011 #17 0x0000000000426533 in readQueryFromClient (
el=, fd=7, privdata=,
mask=) at networking.c:1074 #18 0x000000000041767c in aeProcessEvents (eventLoop=0x7ffff6855150,
flags=) at ae.c:382 #19 0x000000000041793b in aeMain (eventLoop=0x7ffff6855150) at ae.c:425 #20 0x000000000041dc1f in main (argc=1, argv=0x7fffffffeba8)
at redis.c:2622
Activity
bjne commentedon Jan 22, 2013
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff744f7d0 in _int_malloc (av=0x7ffff7738e40, bytes=129)
at malloc.c:4496
4496 malloc.c: No such file or directory.
in malloc.c
(gdb) bt
#0 0x00007ffff744f7d0 in _int_malloc (av=0x7ffff7738e40, bytes=129)
at malloc.c:4496
#1 0x00007ffff74527f6 in _int_realloc (av=0x7ffff7738e40,
oldp=0x6ecbc0, oldsize=80, nb=144) at malloc.c:5274
#2 0x00007ffff7452d40 in *_GI___libc_realloc (oldmem=0x6ecbd0,
bytes=128) at malloc.c:3822
#3 0x000000000045741c in luaM_realloc ()
#4 0x000000000045b6c8 in setarrayvector ()
#5 0x000000000045bfdd in resize ()
#6 0x000000000045bd43 in newkey ()
#7 0x000000000045cf95 in luaV_settable ()
#8 0x000000000045dfb9 in luaV_execute ()
#9 0x000000000045561d in luaD_call ()
#10 0x0000000000454cf7 in luaD_rawrunprotected ()
#11 0x0000000000454d72 in luaD_pcall ()
#12 0x000000000045249f in lua_pcall ()
#13 0x0000000000444b19 in evalGenericCommand (c=0x7ffff5080000,
evalsha=0) at scripting.c:872
#14 0x000000000041b60b in call (c=0x7ffff5080000, flags=7)
at redis.c:1502
#15 0x000000000041babd in processCommand (c=0x7ffff5080000)
at redis.c:1677
#16 0x000000000042641f in processInputBuffer (c=0x7ffff5080000)
at networking.c:1011
#17 0x0000000000426533 in readQueryFromClient (
el=, fd=7, privdata=,
mask=) at networking.c:1074
#18 0x000000000041767c in aeProcessEvents (eventLoop=0x7ffff6855150,
flags=) at ae.c:382
#19 0x000000000041793b in aeMain (eventLoop=0x7ffff6855150) at ae.c:425
#20 0x000000000041dc1f in main (argc=1, argv=0x7fffffffeba8)
at redis.c:2622
antirez commentedon Jan 22, 2013
Thank you for reporting, fixing ASAP.
charsyam commentedon Jan 23, 2013
Hi, @bjne, How can I reproduce it?
I tried it but I can't reproduce. Thank you.
bjne commentedon Jan 23, 2013
save script to file,
redis-cli --eval script somevarname
Might have to run it couple times
antirez commentedon Jan 23, 2013
Hello, confirmed, there is a bug here, fixing ASAP, thank you for reporting.
Lua struct library updated to version 0.2.
Lua struct library updated to version 0.2.
Lua struct library updated to version 0.2.
antirez commentedon Jan 23, 2013
It Was Not My Code (TM)
The Lua struct library was to blame, I updated the code to latest version of the lib and it seems to be fixed.
Closing the issue but I'll appreciate a feedback after the upgrade (however I tested it manually and via valgrind on two systems).
Thanks again for reporting!
Lua struct library updated to version 0.2.
Squashed 'deps/hiredis/' changes from f8de9a4bd..b6a052fe0
Add support for setting the group on a unix domain socket (redis#901)
Merge pull request redis#901 from Cyan4973/dependabot/github_actions/…