-
Notifications
You must be signed in to change notification settings - Fork 652
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
Lack of Error Signaling when insufficient app memory available #1764
Comments
If you enable the process loading debug does that give you enough information to figure out what is going on? Maybe that should be enabled by default? |
Ah, yes it does! it says '[!] flash=[0x00041000:0x00041400] process=Some("t5") - couldn't allocate memory region of size >= 0xFC8'
I don't think we want to print all the process loading information in the default case -- I think the default should be to only print anything if there is an error |
Which would be a pretty easy fix (take the error reporting debug statements outside of the |
The line that is relevant here: Line 1659 in 5b61be4
Pre-TBF parsing changes addressing this issue would have been tricky, but now we can propagate an error to main.rs which will can then handle it as desired (right now we would print a message). I think I didn't want to change too much in the TBF refactor, but looking at what is and is not an error when discovering and creating apps is something worth looking into. For example, should load_processes keep trying apps after not being able to load one? I think propagating an error in that case would be more difficult.
I would, but I think we already support a better solution using |
Ah, I was working off a slightly outdated version of master that pre-dated the TBF parsing changes. Propagating that error to main.rs seems like the right solution. |
By default, libtock-c applications request 8kB of memory. On a board like Hail,
NUM_PROCS=20
, implying that 20 processes can be loaded. HoweverAPP_MEMORY
on hail is set to 49 kB, so attempting to load more than 6 processes fails. Currently, this manifests as the first 6 processes loaded onto the board work as expected, and subsequently flashed apps are treated as if they do not exist. No error messages are printed and the only signal something is wrong is that some apps do not execute.A developer encountering this problem can solve it by increasing
APP_MEMORY
, or by decreasing the amount of memory requested by apps in libtock-c -- but it can be confusing to debug.Ideally, when a board is initialized, it should at least print a debug message if there is not enough memory to load all apps, or perhaps even panic. Alternatively, perhaps tockloader could print an error if an app is loaded that there is not enough memory for?
The text was updated successfully, but these errors were encountered: