fix: add terminal/session symbols to GOT patching for bash job control#47
Merged
Conversation
Each TerminalSession now creates its own vproc session instead of sharing a global one. This enables true concurrency between sessions: - Each session has its own driver thread - run_until_exit in one session no longer blocks create_process in another - Fixed ANR issue in Hermux when creating new terminals Changes: - JNI bridge: removed global g_vproc_session_id, added session array - createSubprocess: creates new vproc session per call - waitFor: uses session_id to call run_until_exit - Added testConcurrentSessions and testRunUntilExitDoesNotBlockCreate Bahtya
bash reports "cannot set terminal process group: Bad file descriptor" because dup2(2,255) creates only a virtual fd, and the real tcsetpgrp falls through to libc which sees no kernel fd 255 → EBADF. Adding these symbols to the GOT patch list routes them to the existing interceptors. Bahtya
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.
Summary
tcsetpgrp,tcgetpgrp,setsid,getpgrp,pipe2were missing from the GOT patching list inpatch_got_for_loaded_binary. When bash is loaded viadlopen, these calls bypassed vproc interceptors and hit real libc, causing EBADF on virtual fds.src/vexec.rs). The interceptors already exist inpreload.rs— this just ensures they are routed correctly.bash: cannot set terminal process group (NNN): Bad file descriptorandbash: no job control in this shellwarnings.Test plan
sleep 100 &followed byfgworks correctlycargo test)Bahtya