This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Check for undefined symbols in .so and warn about run-time errors #17850
Merged
Conversation
This file contains 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
mvines
reviewed
Jun 8, 2021
Codecov Report
@@ Coverage Diff @@
## master #17850 +/- ##
=======================================
Coverage 82.6% 82.6%
=======================================
Files 431 431
Lines 120996 121001 +5
=======================================
+ Hits 99988 100003 +15
+ Misses 21008 20998 -10 |
dmakarov
added
the
automerge
Merge this Pull Request automatically once CI passes
label
Jun 10, 2021
Hey @dmakarov , sorry about the late review, feeling like a pinball recently. My comment above is not necessarily a blocker but I think we are on thin ground by throwing out an error that might not be real. |
I agree that issuing an error about a valid program may be bad. I tried to
phrase the warning in a cautious way, so that users can still proceed with
deploying their program.
The list of known syscalls will indeed get out of sync. If users build
their programs with a toolchain older than the runtime they’re going to run
them on, I’m not sure we can catch that. For example, how does the tool
even know which network to query for a list of syscalls? The build can be
run on a host where no solana network (runtime system) is
running/installed. Like you mentioned in the original issue, an alternative
is that the warning can be issued at loading time. Is that much different
than the undefined symbol error that the RBPF reports?
I think it’s possible to write build.rs script that would extract the list
of syscalls before cargo-build-bpf is built and the list can be built into
cargo-build-bpf. This would at least guarantee that cargo-build-bpf
knowledge of available syscalls matches the runtime which was built from
the same source base as cargo-build-bpf.
On Thu, Jun 10, 2021 at 22:20 Jack May ***@***.***> wrote:
Hey @dmakarov <https://github.com/dmakarov> , sorry about the late
review, feeling like a pinball recently. My comment above is not
necessarily a blocker but I think we are on thin ground by throwing out an
error that might not be real.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17850 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZIRWMHVKSH6QGSO5SOALTSGMJRANCNFSM46K3ZESA>
.
--
Dmitri
|
What if we keep a list in the sdk that the build tools read? That way the list will at least be tied to the sdk version the developer is building with which hopefully is also close to the one they are deploying to. |
The list would be generated automatically when |
Closed
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.
Problem
Several math functions not yet supported by the BPF toolchain may be used in users' code and trigger undefined function run-time errors.
Summary of Changes
Add a post processing step to check undefined symbols against known syscalls and issue a warning if unknown undefined symbols are found in the generated .so file.
Fixes #16552