Closed jjang3 closed 1 year ago
I reviewed the code of libdft-dta.cpp, and it appears that it won't exit due to the file descriptor values. Could you try reproducing the issue with a minimal program such as a simple server/client instead of using Redis? Additionally, DTA will only exit with an 'alert' and log something. Can you check if there are any log files there?
Hello, thank you for your response. So I did some debug testing as you suggested with a minimum server program like https://gist.github.com/GaryMeloney/424e502956f49b2fc58487d9d510ed80, and I realized that I couldn't reproduce the issue. Therefore, I tried building everything from scratch with a very clean slate, and it seemed like it might have been some other issues outside of libdft
. I apologize for the inconvenience! Thank you again for sharing the code.
Hello, thank you for sharing the code of
libdft64
.I just wanted to inform an interesting bug with this line of code with
accept
system call handling part of the code:It is stated in the manual: https://man7.org/linux/man-pages/man2/accept.2.html that
accept()
returnsa new file descriptor referring to that socket
, and whenever(int)ctx->ret
value is greater than 7, the hooked program abruptly ends. This is a key part because there is no segmentation fault or anything of an error, but just that the program gracefully exits.The output looks like this:
and then on the other terminal, if I were to execute
./redis-cli
, then the above screen will outputand the program ends with the connection closed on the other terminal.
I have statically replaced
(int)ctx->ret
with a value less than 8, and was able to successfully determine that the file descriptor number is the issue. I have also tested usingstd::list
andstd::hash_set
instead ofDoesn't seem to fix it though... Also tried
GDB
ing thelibdft-dta.so
, but nothing useful came out of there either.