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

Registering extensions fails on arm32 due to bug in STRING_construct_sprintf() invocation #634

Open
HarryWaschkeit opened this issue Jun 7, 2024 · 0 comments

Comments

@HarryWaschkeit
Copy link
Contributor

HarryWaschkeit commented Jun 7, 2024

Expected Behavior

When device update agent starts up, prestep handlers prepare for extensions to be loaded later on by providing json descriptions bearing the SHA256 sum of the extension library.

Current Behavior

While the json files are generated the sha256sum fields contain "(null)" on arm32 (i.MX6) causing the agent startup to fail.

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. compile and use on arm32 platform

Device Information

  • Host OS [e.g. Ubuntu 18.04, Windows Server IoT 2019]: yocto 4.0.18 based own distribution
  • Architecture [e.g. amd64, arm32, arm64]: arm32
  • Provisioning Method: N/A
    *DU Agent Version (run 'sudo -u adu /usr/bin/AducIotAgent -v'): 1.1.0

Logs

Jun 07 08:36:14 hwt-tx6s systemd[1]: Starting Device Update Agent daemon....
Jun 07 08:36:14 hwt-tx6s AducIotAgent[8351]: Successfully registered a handler for 'microsoft/steps:1'. Registration file: /var/lib/adu/extensions/update_content_handlers/microsoft_steps_1/content_handler.json.
Jun 07 08:36:14 hwt-tx6s AducIotAgent[8352]: Successfully registered a handler for 'microsoft/swupdate:2'. Registration file: /var/lib/adu/extensions/update_content_handlers/microsoft_swupdate_2/content_handler.json.
Jun 07 08:36:15 hwt-tx6s AducIotAgent[8353]: Successfully registered a handler for 'microsoft/update-manifest:5'. Registration file: /var/lib/adu/extensions/update_content_handlers/microsoft_update-manifest_5/content_handler.json.
Jun 07 08:36:15 hwt-tx6s AducIotAgent[8354]: Successfully registered a handler for 'omnect/swupdate_consent:1'. Registration file: /var/lib/adu/extensions/update_content_handlers/omnect_swupdate_consent_1/content_handler.json.
Jun 07 08:36:15 hwt-tx6s AducIotAgent[8355]: Successfully registered an extension. Info: /var/lib/adu/extensions/content_downloader/extension.json
Jun 07 08:36:16 hwt-tx6s AducIotAgent[8360]: 2024-06-07T08:36:16.2596Z 8360[8360] [E] Hash for /usr/lib/adu/extensions/libdeliveryoptimization_content_downloader.so is not valid [LoadExtensionLibrary:140]
Jun 07 08:36:16 hwt-tx6s AducIotAgent[8360]: 2024-06-07T08:36:16.2625Z 8360[8360] [E] Failed to set DO connection string in Nested Edge scenario, result: 0x00000000 [StartupAgent:798]
[...]

Additional Information

Root cause for the bug is using string format specifier "%d" for a "long long [int]" argument which confuses vsnprintf().
Fix already available as PR #633.

Sorry for creating a PR before reporting, next time I'll do it the other way around ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant