-
Notifications
You must be signed in to change notification settings - Fork 7.5k
settings: Bluetooth: Failed parse/lookup #13572
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
Comments
I wonder what's going on here. Bluetooth writes to flash only through the settings API, so the corruption would have to happen on some lower level. Is it really a good policy to have settings assert, instead of throwing an error, when encountering corrupted flash content? |
Can be reproduced every time. |
@jhedberg I agree asserting here is unfortunate. If we ignore such error, the previous record will be used, if any was valid before (am I correct?). It may also be an effect of Bluetooth host writing something incorrect. |
@jhedberg, @Qbicz: It is unfortunate that an assert is triggered, this is triggered if there is a record in flash that has no set handler. As a result it is not possible to store data on the flash that is not related to settings.
This is written after the disconnect and is clearly wrong. |
@Laczen are you sure that's not just a missing log_strdup() call? Ever since we moved to deferred logging trying to log any on-stack strings will give you garbage like that, since by the time the logger thread processes the message the string is already out of scope. |
@Laczen I just looked at the code and bt_settings_encode_key() is indeed missing a log_strdup(). So this corrupted string is a red herring, I think, i.e. probably safe to ignore (someone should submit a PR to add the log_strdup though). |
@jhedberg, OK, I really dislike this deferred logging. |
@jhedberg, in gatt.c: |
@jhedberg, it might be something else: in |
FYI @Vudentz |
Fixes zephyrproject-rtos#13572. Initialize key used to store Client Features even when config was not found. Signed-off-by: Filip Kubicz <[email protected]>
Fixes #13572. Initialize key used to store Client Features even when config was not found. Signed-off-by: Filip Kubicz <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Bluetooth host cannot load the values it previously stored in settings. After wake up or reset, it asserts with
set-value operation failure
.In
settings_set_value_priv()
,settings_parse_and_lookup()
fails and-EINVAL
is returned (-22
).Similar problem has been previously fixed in #11576, but now it happens again.
To Reproduce
ASSERTION FAIL [rc == 0]
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: