ssrg-vt / popcorn-kernel

Popcorn Linux kernel for distributed thread execution
Other
156 stars 22 forks source link

Not all resources are released after migrated process is killed at origin #64

Closed bxatnarf closed 5 years ago

bxatnarf commented 5 years ago

I've found that not all of a process' resources are released after it is killed (signal 9) on the origin. I have not tested if this is also the case when the process is killed on other hosts -- this should be checked as well. I have found this is the case when migrating between two hosts on x86, but I suspect this is an issue on all architectures.

If the process at its origin is killed (-9), its file handles do not seem to be released at the origin or remote host (however I do not know what happens if it is running on more than two hosts). I have found that if a migrated executable located at ~/mt is killed at its host, ~/mt remains locked at both the origin and the remote host. I am able to rm ~/mt on both the target and the origin

Furthermore, if ~/mt is killed -9 at the origin, its corresponding process on the remote host remains running, and thus it's resources remain locked

popcorn@x86:~$ ps -ef | grep mt
root       640     2  0 14:06 ?        00:00:50 [mt]
popcorn@x86:~$ lsof | grep mt
mt         640           root  cwd   unknown                       /proc/640/cwd (readlink: Permission denied)
mt         640           root  rtd   unknown                       /proc/640/root (readlink: Permission denied)
mt         640           root  txt   unknown                       /proc/640/exe (readlink: Permission denied)
mt         640           root NOFD                                 /proc/640/fd (opendir: Permission denied)
popcorn@x86:~$ cp m mt
cp: cannot create regular file ‘mt’: Text file busy

It appears that the mt resource is not completely released on the origin. Although it is possible to successfully copy a file locally to ~/mt, since I do receive a Text file busy error if I try to scp a file over the origin's ~/mt from a remote host.

bxatnarf commented 5 years ago

This bug seems to have resolved itself with https://github.com/ssrg-vt/popcorn-kernel/commit/071f622ec709327f28cae92487bedd833e17bf72