Hi Stefano,
On 23/11/23 20:00, Stefano Babic wrote:
> Hi Giulio,
>
> On 23.11.23 18:38, Giulio Benetti wrote:
>> Hello All,
>>
>> I've experienced that SWUpdate, if built with -Os optimization, fails
>> to update
>> randomly and using installed-directly option it fails 100% of the
>> times on the
>> last chunk of memory written to eMMC.
>>
>> This shows up on versions 2022.12, 2023.08 and master branch.
>>
>> The program fails during gunzipping here:
>>
https://github.com/sbabic/swupdate/blob/master/core/cpio_utils.c#L376
>> with -Z_DATA_ERROR
>>
>
> It is not a lot to find out which is the reason.
You're right, pardon, I'm trying to reproduce it using qemu-arm on
buildroot so I can create a defconfig to create a rootfs that exhibits
the bug.
> However, this lines
> points to the return code of zlib. How can we know if the cuse is here
> or inside the library ?
That could be a cause too, right. But if building with -O3 only SWUpdate
the error is hidden, so I think it's more probable the problem is due
to SWUpdate instead of ZLib. Of course I can't be 100% sure.
> What I can see here is that the variable outlen is used to get the
> remaining size. It should be better declared as size_t instead of int.
> Which is the architecture you are using ?
I'm on i.MX6ULL, Cortex-A7, so it's ok to use size_t, but it's already
declared as int. So that should not be the cause of the bug.
Anyway I'm coming with a test-case for this hopefully.
Thanks for the fast response!
Best regards
--
Giulio Benetti
CEO&CTO@Benetti Engineering sas
>