Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Check for undefined symbols in .so and warn about run-time errors #17850

Merged
merged 1 commit into from
Jun 10, 2021
Merged

Check for undefined symbols in .so and warn about run-time errors #17850

merged 1 commit into from
Jun 10, 2021

Conversation

dmakarov
Copy link
Contributor

@dmakarov dmakarov commented Jun 8, 2021

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

@dmakarov dmakarov requested a review from jackcmay June 8, 2021 22:35
@mvines mvines added the v1.7 label Jun 8, 2021
@codecov
Copy link

codecov bot commented Jun 9, 2021

Codecov Report

Merging #17850 (928607b) into master (d272468) will increase coverage by 0.0%.
The diff coverage is n/a.

@@           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
Copy link
Contributor Author

dmakarov commented Jun 9, 2021

@jackcmay do you need more time to review, or ok to merge? If this is merged, are you ok with #16552 being closed or would prefer to keep it around for the second option -- checking the undefs in the loader?

@dmakarov dmakarov added the automerge Merge this Pull Request automatically once CI passes label Jun 10, 2021
@mergify mergify bot merged commit c684e2b into solana-labs:master Jun 10, 2021
mergify bot pushed a commit that referenced this pull request Jun 10, 2021
mergify bot added a commit that referenced this pull request Jun 11, 2021
…7850) (#17880)

(cherry picked from commit c684e2b)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
@jackcmay
Copy link
Contributor

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.

@dmakarov
Copy link
Contributor Author

dmakarov commented Jun 11, 2021 via email

@jackcmay
Copy link
Contributor

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.

@dmakarov
Copy link
Contributor Author

The list would be generated automatically when solana-bpf-loader-program crate is built, correct? This sounds good to me.

@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsupported external symbols in ELF are not caught until the program is run
3 participants