Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong detect of stack-buffer-underflow/overflow #1205

Open
hotrhino opened this issue Mar 16, 2020 · 1 comment
Open

wrong detect of stack-buffer-underflow/overflow #1205

hotrhino opened this issue Mar 16, 2020 · 1 comment

Comments

@hotrhino
Copy link

i useluajit in my project and i found asan3 can't detect the stack-buffer probs right. It report my program stack-buffer-underflow/overflow while it's not.

orgin files:
lua_test.tar.gz
lj_debug.txt

stacktrace:
==4342==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7ffc1b1043d8 at pc 0x7fc3d67e99d7 bp 0x7ffc1b1041d0 sp 0x7ffc1b103978
WRITE of size 9 at 0x7ffc1b1043d8 thread T0
#0 0x7fc3d67e99d6 in strcpy (/lib64/libasan.so.3+0x919d6)
#1 0x406e14 in lj_debug_shortname /home

/zhongzhihao/LuaJIT/src/lj_debug.c:332
#2 0x40758d in lj_debug_getinfo /home/zhongzhihao/LuaJIT/src/lj_debug.c:454
#3 0x493092 in lj_cf_debug_getinfo /home/zhongzhihao/LuaJIT/src/lib_debug.c:127
#4 0x435b64 in lj_BC_FUNCC (/home/zhongzhihao/eclipse-cpp/lua_test/lua_test+0x435b64)
#5 0x414121 in lua_pcall /home/zhongzhihao/LuaJIT/src/lj_api.c:1129
#6 0x402f35 in main /home/zhongzhihao/eclipse-cpp/lua_test/lua_test.cpp:54
#7 0x7fc3d5989504 in __libc_start_main (/lib64/libc.so.6+0x22504)
#8 0x4025a8 (/home/zhongzhihao/eclipse-cpp/lua_test/lua_test+0x4025a8)

Address 0x7ffc1b1043d8 is located in stack of thread T0==4342==AddressSanitizer CHECK failed: ../../../../libsanitizer/asan/asan_thread.cc:243 "((ptr[0] == kCurrentStackFrameMagic)) != (0)" (0x0, 0x0)
#0 0x7fc3d68287ca (/lib64/libasan.so.3+0xd07ca)
#1 0x7fc3d682f183 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/lib64/libasan.so.3+0xd7183)
#2 0x7fc3d682cdc1 (/lib64/libasan.so.3+0xd4dc1)
#3 0x7fc3d68241fa (/lib64/libasan.so.3+0xcc1fa)
#4 0x7fc3d68247ca (/lib64/libasan.so.3+0xcc7ca)
#5 0x7fc3d6827c29 (/lib64/libasan.so.3+0xcfc29)
#6 0x7fc3d67e99f8 in strcpy (/lib64/libasan.so.3+0x919f8)
#7 0x406e14 in lj_debug_shortname /home/zhongzhihao/LuaJIT/src/lj_debug.c:332
#8 0x40758d in lj_debug_getinfo /home/zhongzhihao/LuaJIT/src/lj_debug.c:454
#9 0x493092 in lj_cf_debug_getinfo /home/zhongzhihao/LuaJIT/src/lib_debug.c:127
#10 0x435b64 in lj_BC_FUNCC (/home/zhongzhihao/eclipse-cpp/lua_test/lua_test+0x435b64)
#11 0x414121 in lua_pcall /home/zhongzhihao/LuaJIT/src/lj_api.c:1129
#12 0x402f35 in main /home/zhongzhihao/eclipse-cpp/lua_test/lua_test.cpp:54
#13 0x7fc3d5989504 in __libc_start_main (/lib64/libc.so.6+0x22504)
#14 0x4025a8 (/home/zhongzhihao/eclipse-cpp/lua_test/lua_test+0x4025a8)

@hotrhino
Copy link
Author

gcc6 libasan3 would report this bug above. i upgrade to gcc8 and libasan5 is OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant