Resolve some compatibility issues with macOS#5
Open
alerighi wants to merge 6 commits intoveluca93:masterfrom
Open
Resolve some compatibility issues with macOS#5alerighi wants to merge 6 commits intoveluca93:masterfrom
alerighi wants to merge 6 commits intoveluca93:masterfrom
Conversation
Tmbox forks a process that has a loop that calls `ps` to find the process memory usage. However, at the end of the execution, tmbox tries to kill this memory watcher process with no success. Tmbox keeps wait()-ing for the process to terminate, but it never terminates. Thus tmbox will hang forever till you kill it, leaving an orphan process on the system. From POSIX specifications if you send a SIG_KILL to a process it should *always* terminate. That is not always the case on macOS, I think the reason is that if the process is in sleep status it ignores SIG_KILL. This could be a bug of the kernel? For now I disabled forking a memory watcher process, and instead I'm calling the function that computes the memory usage from the main process. This however shouldn't be a problem. A better solution would be to investigate the system call that `ps` uses to retrive the data from the kernel and call it directly from tmbox. Maybe I will implement it in the future, for now this solution should fix the problem and allow to use tmbox on macOS.
Tmbox forks a process that has a loop that calls `ps` to find the process memory usage. However, at the end of the execution, tmbox tries to kill this memory watcher process with no success. Tmbox keeps wait()-ing for the process to terminate, but it never terminates. Thus tmbox will hang forever till you kill it, leaving an orphan process on the system. From POSIX specifications if you send a SIG_KILL to a process it should *always* terminate. That is not always the case on macOS, I think the reason is that if the process is in sleep status it ignores SIG_KILL. This could be a bug of the kernel? For now I disabled forking a memory watcher process, and instead I'm calling the function that computes the memory usage from the main process. This however shouldn't be a problem. A better solution would be to investigate the system call that `ps` uses to retrive the data from the kernel and call it directly from tmbox. Maybe I will implement it in the future, for now this solution should fix the problem and allow to use tmbox on macOS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've done some fixes to make
tmboxwork on macOS:tmboxprocess not terminate