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

[ADU] Changing ucScratchBuffer size to less than 600 bytes causes AzureIoTADUClient_SendAgentState to hang #205

Closed
ewertons opened this issue Jul 12, 2022 · 1 comment
Assignees
Labels

Comments

@ewertons
Copy link
Collaborator

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

change the size of ucScratchBuffer to 560 bytes and run the ESP32 ADU sample.
https://github.com/Azure-Samples/iot-middleware-freertos-samples/blob/ota/demos/sample_azure_iot_adu/sample_azure_iot_adu.c#L173

Any log messages given by the failure

Execution hangs here:

I (99931) AZ IOT: Starting the mbedtls calculation: image size 864816

.............
I (105421) AZ IOT: Done

I (105421) AZ IOT: SHAs match

I (105421) AZ IOT: [ADU] Enable the update image

I (105431) esp_image: segment 0: paddr=00120020 vaddr=3f400020 size=23388h (144264) map
I (105651) esp_image: segment 1: paddr=001433b0 vaddr=3ffb0000 size=04f04h ( 20228)
I (105661) esp_image: segment 2: paddr=001482bc vaddr=40080000 size=07d5ch ( 32092)
I (105721) esp_image: segment 3: paddr=00150020 vaddr=400d0020 size=962f0h (615152) map
I (106631) esp_image: segment 4: paddr=001e6318 vaddr=40087d5c size=0ced4h ( 52948)
I (106701) esp_image: segment 5: paddr=001f31f4 vaddr=50000000 size=00010h (    16)
I (106771) AZ IOT: [ADU] Send property update.

Expected/desired behavior

Execution to proceed to reset the device.

I (106781) AZ IOT: [ADU] Reset the device

Versions

Observed starting with #204
Earlier versions of the code might have been previously affected.

@ewertons ewertons self-assigned this Jul 12, 2022
@danewalton danewalton added the ADU label Jul 15, 2022
@ewertons
Copy link
Collaborator Author

The code has changed a little since this issue was filed.

Testing it again with the same parameters of the original issue, the crash no longer occurs.
The sample correctly just failed all the way on the top (when the update request is received) with:

I (13626) AZ IOT: Properties component name: deviceUpdate
E (13626) AZ IOT: az_iot_adu_client_parse_service_properties failed
E (13636) AZ IOT: AzureIoTADUClient_ParseRequest failed: result 0x00000012
I (13666) MQTT: Packet received. ReceivedBytes=2.

Which is the correct behavior (the result code above is for not enough memory).

This, closing this issue.

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

No branches or pull requests

2 participants