Skip to content

Fix unsigned packing bug in merge_regions #8544 #8788

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

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

kaidokert
Copy link
Contributor

Description

There is a randomly occuring bug at the merge_regions build stage which throws depending on computed CRC32 value. If 32-bit ( instead of 31-bit ) value is calculated, merge fails as follows:

Merging Regions
  Filling region bootloader with /opt/m/mbed/compiletest/cloud-2.0/mbed-os/features/FEATURE_BOOTLOADER/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/TARGET_UBLOX_EVK_ODIN_W2/mbed-bootloader-sotp-v3_4_0.bin
  Padding region bootloader with 0x684 bytes
Traceback (most recent call last):
  File "/opt/m/mbed/compiletest/cloud-2.0/mbed-os/tools/make.py", line 293, in <module>
    ignore=options.ignore
  File "/opt/m/mbed/compiletest/cloud-2.0/mbed-os/tools/build_api.py", line 552, in build_project
    merge_region_list(region_list, res, notify)
  File "/opt/m/mbed/compiletest/cloud-2.0/mbed-os/tools/build_api.py", line 427, in merge_region_list
    _fill_header(region_list, region).tofile(header_filename, format='hex')
  File "/opt/m/mbed/compiletest/cloud-2.0/mbed-os/tools/build_api.py", line 397, in _fill_header
    header.puts(start, struct.pack(fmt, zlib.crc32(ih.tobinarray())))
struct.error: 'l' format requires -2147483648 <= number <= 2147483647

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@0xc0170 0xc0170 requested a review from a team November 19, 2018 08:41
Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect fix!

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 22, 2018

Info: This PR has been re-bundled into a new rollup PR (#8838 ).

No further work is needed here, as once that PR is merged, this PR will also be closed and marked as merged.
If any more commits are made in this PR, this PR will remain open and have to go through CI on its own.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 23, 2018

This PR fails to build for client example.


Traceback (most recent call last):

  File "/builds/ws/mbed-os-ci_cloud-client-test/mbed-cloud-client-example/mbed-os/tools/make.py", line 71, in wrapped_build_project

    src_dir, build_dir, mcu, *args, **kwargs

  File "/builds/ws/mbed-os-ci_cloud-client-test/mbed-cloud-client-example/mbed-os/tools/build_api.py", line 549, in build_project

    merge_region_list(region_list, res, notify)

  File "/builds/ws/mbed-os-ci_cloud-client-test/mbed-cloud-client-example/mbed-os/tools/build_api.py", line 422, in merge_region_list

    _fill_header(region_list, region).tofile(header_filename, format='hex')

  File "/builds/ws/mbed-os-ci_cloud-client-test/mbed-cloud-client-example/mbed-os/tools/build_api.py", line 392, in _fill_header

    header.puts(start, struct.pack(fmt, zlib.crc32(ih.tobinarray())))

error: integer out of range for 'L' format code

@ARMmbed/mbed-os-tools Please review

@cmonr
Copy link
Contributor

cmonr commented Nov 27, 2018

Starting CI, just to make sure something odd didn't happen with the Rollup PR.

@mbed-ci
Copy link

mbed-ci commented Nov 27, 2018

Test run: SUCCESS

Summary: 4 of 4 test jobs passed
Build number : 1
Build artifacts
Build logs

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 27, 2018

I reviewed build jobs, they look fine. However not certain why we had the previous build failure in the rollup. I set this to 5.11.1 (if this should be in 5.11.0, please shout now) as we can have this on master for some time to test

@cmonr cmonr removed the risk: A label Nov 28, 2018
@cmonr cmonr merged commit d478d6b into ARMmbed:master Nov 29, 2018
cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Nov 30, 2018
This reverts commit d478d6b, reversing
changes made to f9d07f3.
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 30, 2018

I reviewed build jobs, they look fine. However not certain why we had the previous build failure in the rollup. I set this to 5.11.1 (if this should be in 5.11.0, please shout now) as we can have this on master for some time to test

Still this is valid, this PR is going to be reverted soon

@kaidokert Please review the failure I shared 7 days ago

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 30, 2018

Removed release label (not yet released, will be reverted just on master)

0xc0170 added a commit that referenced this pull request Nov 30, 2018
Revert "Merge pull request #8788 from kaidokert/master"
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 30, 2018

PR was reverted. Please review failures, as this was fixing another issue, would be good to have the fix

@cmonr
Copy link
Contributor

cmonr commented Nov 30, 2018

@kaidokert Fyi ^^^

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

Successfully merging this pull request may close these issues.

5 participants