I'm currently debugging Instrew using GDB, trying to figure out how Instrew actually works and get more details when client and server are running.
But once GDB goes to fexecve(memfd, const_cast<char* const*>(&exec_args[0]), environ);(server/connection.cc: 165), GDB just collapses and doesn't know where to continue.
After I retrieved and read a lot, I realized maybe int memfd = memfd_create("instrew_stub", MFD_CLOEXEC);(server/connection.cc: 142) should be to blame. I guess it is the anonymous file(instrew-client in a byte stream form) created by memfd_create() made GDB lost, for GDB can't find it on hard drive. If I change
fexecve(memfd, const_cast<char* const*>(&exec_args[0]), environ);(server/connection.cc: 165) to
int client_fd = open("./build/client/instrew-client", O_RDONLY);
fexecve(client_fd, const_cast<char *const *>(&exec_args[0]), environ);
Hi there!
I'm currently debugging Instrew using GDB, trying to figure out how Instrew actually works and get more details when client and server are running.
But once GDB goes to
fexecve(memfd, const_cast<char* const*>(&exec_args[0]), environ);
(server/connection.cc: 165), GDB just collapses and doesn't know where to continue.After I retrieved and read a lot, I realized maybe
int memfd = memfd_create("instrew_stub", MFD_CLOEXEC);
(server/connection.cc: 142) should be to blame. I guess it is the anonymous file(instrew-client in a byte stream form) created bymemfd_create()
made GDB lost, for GDB can't find it on hard drive. If I changefexecve(memfd, const_cast<char* const*>(&exec_args[0]), environ);
(server/connection.cc: 165) toor
then GDB is OK to continue to debug the client process.
Is my guess correct? Hopes if dear developer or someone could give some insights.