-
Notifications
You must be signed in to change notification settings - Fork 822
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
Add wolfcrypt test: R/O filesystem const memory pointer #6523
Conversation
The only PRB failure appears to be unrelated to the change:
|
Looks like this error is happening on other PRs as well. Probably safe to ignore until we get a fix in. |
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.
Jim, are you looking to ensure that .const globals are actually loaded? This test seems odd to require and need on all platforms. The PR is like 20 lines of actual code and 60 lines of comments. Are you really wanting this PR to be merged into master still?
Hi David, thanks for taking a look at this.
Not really. The .const globals, to my understanding, are not actually "loaded". As everything is on the same flash: read-only kernel, compiled app, and all... when the binary app runs, the .const values are not loaded into memory, rather they stay on the file system as an extreme method of resource conservation. The trick is to tell the compiler this. It was not at all intuitive to me. I learned this from @jcmvbkbc (see tweet):
I agree, however it is not an intrusive test that would cause any harm. I also do not know how to detect at runtime the fact that a compile-time directive was missing. It appears this was all caused by the cross-ng build (see tweet):
Agreed this is a bit odd. I typically add a lot of detail to code that is not very intuitive. This is some of the most unintuitive code I've ever written. Given the unintuitive nature of what it is doing, future edits might cause the test to not actually detect the problem.
I'm open to suggestion for improvement, but yes. Any future developers of a read-only kernel app will greatly appreciate the error occurring in the memory test and not some arbitrary code that accesses const values that required the |
3b445a9
to
86fec6f
Compare
After reconsidering the feedback, I've updated the changes to the new memory test. There are fewer comments and a couple of additional I've resynced with upstream master, retested with both The test is not very intrusive. I propose letting it run on all platforms and configurations. |
I'll be delayed on resolving this issue, as pulling from upstream master I now see these new cross-compile-time errors in
My current
|
d156243
to
6fa20da
Compare
Stackoverflow to the rescue regarding
Confirmed. Here's my latest wolfSSL
|
The 2 PRB errors are likely unrelated to the changes here. |
Looks good. I want to run this on some embedded targets also. We may need to wrap the test with a way to disable it. |
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.
Tests out fine on STM32U5 CortexM. Thanks
No changes, but there were recent upstream |
Description
As noted in #6522, the wolfSSL wolfcrypt test currently fails duing a memory access operation on
a read-only embedded filesystem such as Xtensa Linux kernel on the ESP32-S3 when accessing
const var pointers.
This failure does not currently occur during the memory test. This PR fixes that with a new test.
With
WOLFSSL_DEBUG
turned on, the testwolfcrypt will now show the failure during the memory test.Without this change, the memory test would pass, but the next test (
base64_test()
) would fail:Here's an example of the new failure message during the memory test:
The fix for this is to add
-mforce-l32
to the wolfSSL./configure
command. Thanks @jcmvbkbc for the suggestion.Here's an example of the memory test with the proper compiler flags and
WOLFSSL_DEBUG
turned on:For reference, here's the entire wolfSSL
./configure
command for Xtensa Linux Kernel on the ESP32-S3:Fixes zd# n/a
Testing
How did you test?
Ran wolfCrypt test in:
Checklist