Skip to content
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

repro issue #808 #810

Closed
wants to merge 1 commit into from
Closed

repro issue #808 #810

wants to merge 1 commit into from

Conversation

qjerome
Copy link
Contributor

@qjerome qjerome commented Oct 10, 2023

Implemented test aiming to reproduce issue #808
There is a little quirk though !
It actually triggers a bug, but not the expected one ! So I hope, once the unexpected bug gets fixed it will trigger the expected one.

@netlify
Copy link

netlify bot commented Oct 10, 2023

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 024def8
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/65279032d9236d00095d3d4d
😎 Deploy Preview https://deploy-preview-810--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mergify mergify bot added the test A PR that improves test cases or CI label Oct 10, 2023
@qjerome qjerome mentioned this pull request Oct 10, 2023
@mergify
Copy link

mergify bot commented Oct 12, 2023

@qjerome, this pull request is now in conflict and requires a rebase.

@mergify mergify bot added the needs-rebase label Oct 12, 2023
Signed-off-by: Quentin JEROME <[email protected]>
@alessandrod
Copy link
Collaborator

It actually triggers a bug, but not the expected one ! So I hope, once the unexpected bug gets fixed it will trigger the expected one.

RUSTFLAGS="-C debuginfo=2" 😂

And then you get:

running 1 test
test tests::load::log_str_random ... FAILED

failures:

---- tests::load::log_str_random stdout ----
thread 'tests::load::log_str_random' panicked at 'called `Result::unwrap()` on an `Err` value: LoadError { io_error: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }, verifier_log: Validating write() func#1...
Global function write() doesn't return scalar. Only those are supported.
verification time 18 usec
stack depth 0+0
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
 }', test/integration-test/src/tests/load.rs:624:17

@alessandrod
Copy link
Collaborator

alessandrod commented Oct 17, 2023

The issue is functions from external crates get compiled as global functions instead of static. Global functions can't return non-scalar types.

In bpf-linker, we should probably detect when a global function returns a non-scalar type, and override it to be static.

@alessandrod
Copy link
Collaborator

Fixed in aya-rs/bpf-linker#173

@alessandrod alessandrod closed this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants