Fixed: Fix SIGKILL, am socket result frame and socket fd bugs in termux-shared - #5246
Open
BuildWithAni wants to merge 1 commit into
Open
Fixed: Fix SIGKILL, am socket result frame and socket fd bugs in termux-shared#5246BuildWithAni wants to merge 1 commit into
BuildWithAni wants to merge 1 commit into
Conversation
…ux-shared - Fixed: Send SIGKILL to process in AppShell.killIfExecuting() unconditionally since setStateFailed() sets state to FAILED and isExecuting() will always be false after that, so SIGKILL was never sent - Fixed: Return early in AmSocketServer.processAmClient() after sending error result to client so that a bogus success result frame is not sent afterwards - Fixed: Use client socket fd instead of server socket fd in LocalClientSocket.available() to check for available data
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.
Fixes the following bugs found while reviewing the codebase. All changes are in the
termux-sharedmodule.AppShell.killIfExecuting()never kills the process (AppShell.java). The conditionif (isExecuting())is always false aftersetStateFailed()is called inAppShell.execute(), so thekill()call was dead code. Killing is now done unconditionally. This also affectsPhantomProcessUtilsand otherAPP_SHELLusers where a shell process that failed to start (e.g. killed with signal 9 by android phantom process trimming) would never be killed on timeout.AmSocketServer.processAmClient()missingreturn(AmSocketServer.java). After sending theRESULT_ERROR_FRAMEfor a failed command, execution continued and sent a secondRESULT_SUCCESS_FRAME, causing the caller to wait forever for a result.LocalClientSocket.available()checks the wrong fd (LocalClientSocket.java). It polled the server socket's fd instead of the client's ownmFD, so the read timeout logic never triggered and reads could hang forever.All modules compile successfully: