Replace apr with boost in LLProcess#5988
Merged
Merged
Conversation
5db14a6 to
e7aa1fd
Compare
e7aa1fd to
e0d7b6d
Compare
9008bcc to
0166827
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Inherit LLProcess from std::enable_shared_from_this<LLProcess> and capture a weak_ptr in the mainloop lambda. Locking the weak_ptr before calling tick() keeps *this alive for the full callback duration, so a listener that drops the last LLProcessPtr during a synchronous event post inside tick()/handleExit() cannot destroy the object while it is still on the call stack.
shared_from_this() requires the shared_ptr control block to be fully initialized, which is not the case during the constructor. Move the mainloop listener registration into a separate connectMainloop() method and call it from create() after make_shared<LLProcess>() returns.
…code for bp::child boost::process v1 only specializes initializer_tag<std::error_code> (in error.hpp), not initializer_tag<boost::system::error_code>. On macOS with Boost 1.90, these are distinct types, so passing boost::system::error_code directly to bp::child() constructor caused a template instantiation failure. Revert the two ec declarations in LLProcess::~LLProcess() and LLProcess::launch() back to std::error_code, which is what boost::process v1 expects.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
boost::process v2, when constructed with an mIOContext, installs a SIGCHLD handler via boost::asio without SA_RESTART. Without SA_RESTART, blocking waitpid() calls elsewhere in the process return EINTR when a child process exits, causing INTEGRATION_TEST_llsdserialize to fail with 'waitpid() errno 4: expected ECHILD(10) actual EINTR(4)'. After launching the child process, explicitly read back the SIGCHLD disposition and add SA_RESTART if missing, ensuring blocking syscalls are automatically restarted after SIGCHLD delivery. (The original boost::process v1 code explicitly warned about this exact issue and worked around it by not passing mIOContext to bp::child; v2 requires the executor so we fix it post-launch instead.)
maxim-productengine
approved these changes
Jul 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
indra/llcommon/llprocess.h:49
- llprocess.h uses pid_t for non-Windows process IDs/handles, but after removing APR headers it no longer includes a header that defines pid_t. This makes the header fragile and can fail to compile depending on include order.
#if LL_WINDOWS
#include "llwin32headers.h" // for HANDLE
#elif LL_LINUX
#if defined(Status)
#undef Status
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replace apr's process logic with boost::process::v2