Stack overflow in lsys_load (lua/loadlib.c:134)
###### Lua revision
version : Lua 5.4.0
###### Build platform
Ubuntu 18.10 LTS (Linux ubuntu 4.18.0-25-generic x86_64)
###### Build steps
```
add -fsanitize=address -g to CFLAGS
make
```
###### Test case
Stack_overflow_lsys_load.lua
```
function main()
v3 = _VERSION.rep(1000000.0 ,1000000.0 )
v4 = package.loadlib(v3,v3)
-- Stderr:
end
main()
```
###### Execution steps
```
$ ls
Stack_overflow_lsys_load.lua
$ ./Test_lua/lua/lua ./crashes/Stack_overflow_lsys_load.lua
AddressSanitizer:DEADLYSIGNAL
=================================================================
==90451==ERROR: AddressSanitizer: stack-overflow on address 0x7ffc56ae1e38 (pc 0x7f84c442acf7 bp 0x7ffc573773f0 sp 0x7ffc56ae1e40 T0)
#0 0x7f84c442acf6 (/lib64/ld-linux-x86-64.so.2+0x7cf6)
#1 0x7f84c442cd4d (/lib64/ld-linux-x86-64.so.2+0x9d4d)
#2 0x7f84c44379c3 (/lib64/ld-linux-x86-64.so.2+0x149c3)
#3 0x7f84c31d148e in _dl_catch_exception (/lib/x86_64-linux-gnu/libc.so.6+0x15c48e)
#4 0x7f84c44372c5 (/lib64/ld-linux-x86-64.so.2+0x142c5)
#5 0x7f84c34a9255 (/lib/x86_64-linux-gnu/libdl.so.2+0x1255)
#6 0x7f84c31d148e in _dl_catch_exception (/lib/x86_64-linux-gnu/libc.so.6+0x15c48e)
#7 0x7f84c31d151e in _dl_catch_error (/lib/x86_64-linux-gnu/libc.so.6+0x15c51e)
#8 0x7f84c34a9a24 (/lib/x86_64-linux-gnu/libdl.so.2+0x1a24)
#9 0x7f84c34a92e5 in dlopen (/lib/x86_64-linux-gnu/libdl.so.2+0x12e5)
#10 0x7f84c36c9a33 (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x8ea33)
#11 0x56529c0e5908 in lsys_load /home/test/Lua/Test_lua/lua/loadlib.c:134
#12 0x56529c0e5908 in lookforfunc /home/test/Lua/Test_lua/lua/loadlib.c:391
#13 0x56529c0e5a14 in ll_loadlib /home/test/Lua/Test_lua/lua/loadlib.c:412
#14 0x56529c09025c in luaD_call /home/test/Lua/Test_lua/lua/ldo.c:481
#15 0x56529c0b8824 in luaV_execute /home/test/Lua/Test_lua/lua/lvm.c:1614
#16 0x56529c0b8824 in luaV_execute /home/test/Lua/Test_lua/lua/lvm.c:1614
#17 0x56529c090605 in luaD_callnoyield /home/test/Lua/Test_lua/lua/ldo.c:525
#18 0x56529c08dc51 in luaD_rawrunprotected /home/test/Lua/Test_lua/lua/ldo.c:148
#19 0x56529c0911e0 in luaD_pcall /home/test/Lua/Test_lua/lua/ldo.c:749
#20 0x56529c086f8f in lua_pcallk /home/test/Lua/Test_lua/lua/lapi.c:1031
#21 0x56529c08042a in docall /home/test/Lua/Test_lua/lua/lua.c:139
#22 0x56529c08179d in handle_script /home/test/Lua/Test_lua/lua/lua.c:228
#23 0x56529c08179d in pmain /home/test/Lua/Test_lua/lua/lua.c:603
#24 0x56529c09025c in luaD_call /home/test/Lua/Test_lua/lua/ldo.c:481
#25 0x56529c090605 in luaD_callnoyield /home/test/Lua/Test_lua/lua/ldo.c:525
#26 0x56529c08dc51 in luaD_rawrunprotected /home/test/Lua/Test_lua/lua/ldo.c:148
#27 0x56529c0911e0 in luaD_pcall /home/test/Lua/Test_lua/lua/ldo.c:749
#28 0x56529c086f8f in lua_pcallk /home/test/Lua/Test_lua/lua/lapi.c:1031
#29 0x56529c07fbda in main /home/test/Lua/Test_lua/lua/lua.c:629
#30 0x7f84c309909a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
#31 0x56529c080239 in _start (/home/test/Lua/Test_lua/lua/lua+0x18239)
SUMMARY: AddressSanitizer: stack-overflow (/lib64/ld-linux-x86-64.so.2+0x7cf6)
==90451==ABORTING
```
```
./lua/lua Stack_overflow_lsys_load.lua
Segmentation fault
```
###### Backtrace
```
$ gdb -q -args Stack_overflow_lsys_load.lua
Reading symbols from ./lua/lua...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/test/Lua/lua/lua Stack_overflow_lsys_load.lua
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7fdacf7 in open_path (
name=name@entry=0x7ffff6694028 "1000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.01000000.010"..., namelen=namelen@entry=9000001, mode=mode@entry=-1879048190, sps=sps@entry=0x7ffff7ffc8d0 <rtld_search_dirs>, realname=realname@entry=0x7fffffffd0f0,
fbp=fbp@entry=0x7fffffffd100, loader=0x7ffff7ffe190, whatcode=64, found_other_class=0x7fffffffd0ef) at dl-load.c:2041
2041 dl-load.c: No such file or directory.
(gdb) x/5i $rip
=> 0x7ffff7fdacf7 <open_path+215>: callq 0x7ffff7ff3900 <mempcpy>
0x7ffff7fdacfc <open_path+220>: mov %rax,%r14
0x7ffff7fdacff <open_path+223>: lea -0xc0(%rbp),%rax
0x7ffff7fdad06 <open_path+230>: mov %rax,-0xf8(%rbp)
0x7ffff7fdad0d <open_path+237>: mov -0xd0(%rbp),%rax
(gdb)
```