-
Notifications
You must be signed in to change notification settings - Fork 37
Better error and log messages #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ryanofsky
wants to merge
4
commits into
bitcoin-core:master
Choose a base branch
from
ryanofsky:pr/errs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
21b2f65
logging: Add better logging on IPC server-side failures
ryanofsky 2af6a9b
debug: Add TypeName() function and log statements for Proxy objects b…
ryanofsky 0fc31ec
(workaround for ci, to be dropped after #214 is merged)
ryanofsky 437f042
ci: try to get stack trace from mptest
ryanofsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't the local
server_capturebeing captured by reference problematic ifinvokeis being called async? Possible that's smashing the stack here?(Maybe I'm way off, these tangled callbacks a breaking my brain).
But I think I'd expect this to be
return ReplaceVoid([server_context = std::move(server_context)]()...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should double-check all the lifetimes here, but I think the problem in the gnu32 job is weirder than a lifetime issue, because in gdb I can inspect the
kj::Exception&& evariable here and it is a valid object containing the "thread busy" error and full context information. But then two calls deeper in the call stack, the stringify function which is supposed to print the exception, somehow receives a garbage reference to akj::Exceptionwith a completely different address. So it seems like there is an ABI issue or compiler bug exposed by this change, but I am not sure.On
servervsserver_context, theserverobject is actually the one with the longer lifetime. When you declare aninterface MyInterface { myMethod @0 () -> (); }capnproto generates C++ class like:which you inherit from to implement all the methods. The
servervariable is a reference to the object implementing these methods, and there is also aMyInterface::Clientclass generated to call the methods. The lifetime of the server object is completely controlled by Cap'n Proto. It will keep the server around until nothing is referencing it, so it will be alive as long as any client on a live connection exists, and as long as any IPC call is in progress, even if the client is released or disconnected.By contrast
server_contextis just a local variable in theserverInvokefunction, so you would need to copy or move it like you suggested to use it in a promise.then() handler but it is fine to use by reference inReplaceVoidlambdas because of the wayReplaceVoidis defined, where it just calls them right away before returning. I try to use convention of using[&]and implicit captures for any lambda that will be called right away before the statement returns, and using explicit captures for lambdas that are delayed callbacks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at anything here, but I presume capnp is compiled with clang in the CI and libmultiprocess with GCC, so it just reminds me of bitcoin/bitcoin#31772. But I haven't checked any of this.