Fix execution in silent mode#407
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #407 +/- ##
==========================================
+ Coverage 73.51% 73.99% +0.48%
==========================================
Files 23 23
Lines 1193 1196 +3
Branches 111 111
==========================================
+ Hits 877 885 +8
+ Misses 316 311 -5
🚀 New features to boost your workflow:
|
Collaborator
|
This comment is just to educate myself more than anything. What is a situation somebody would use |
anutosh491
commented
Apr 29, 2026
Collaborator
Author
|
The clang format is asking for changing something already present upstream. Just bloating. Can be skipped I think. |
JohanMabille
approved these changes
Apr 29, 2026
Collaborator
JohanMabille
left a comment
There was a problem hiding this comment.
LGTM once the copy and move semantic have been deleted.
Collaborator
Author
Addressed. Thanks for the review ! |
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Collaborator
Author
|
Merging. |
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.
Description
@JohanMabille and I were discussing that xeus-cpp might not be respecting how execution works in silent mode.
To confirm this I forced
config.silentas true from the xeus side. Probably the statementconfig.silent = truecan be added at the top of theexecute_request_implto verify this.In silent mode on upstream I see the kernel segfaults.

Problem
The temporary
xnullobject used whenconfig.silent = truewas destroyed at the end of the if-block, leavingstd::coutandstd::cerrwith dangling streambuf pointers. This caused signal 11 (segmentation fault) on any subsequent flush or write.Solution
Prevent segmentation fault in silent execution mode by managing the lifetime of the xnull stream buffer with a std::unique_ptr. Now works as expected
Type of change
Please tick all options which are relevant.