Skip to content

Fix test failures on armhf#135

Merged
Karsten1987 merged 3 commits intoros2:masterfrom
aws-ros-dev:fix-test-armhf
Jul 18, 2019
Merged

Fix test failures on armhf#135
Karsten1987 merged 3 commits intoros2:masterfrom
aws-ros-dev:fix-test-armhf

Conversation

@prajakta-gokhale
Copy link
Copy Markdown

@prajakta-gokhale prajakta-gokhale commented Jun 25, 2019

Fix rosbag2_transport unit test failures on armhf.

Related to armhf tier-2 support fixes: ros2/ros2#721
Fixes unit test failure reported here.

Signed-off-by: Prajakta Gokhale prajaktg@amazon.com

@prajakta-gokhale
Copy link
Copy Markdown
Author

@emersonknapp - please run this CI job
Gist: https://gist.githubusercontent.com/prajakta-gokhale/211bac73533a4576537436f416baea2a/raw/d03c798754795f5e307bdf4d7922654491587bca/ros2.repos
BUILD args: --packages-up-to rosbag2_transport
TEST args: --packages-select rosbag2_transport
Job: ci_launcher

Copy link
Copy Markdown
Collaborator

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

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

I wonder if we should just disable this test for 32 bit platform. It doesn't feel correct to say that these maxed out values are actually a tebi/pebibyte in the first place. Thoughts?

@clalancette
Copy link
Copy Markdown
Contributor

I wonder if we should just disable this test for 32 bit platform. It doesn't feel correct to say that these maxed out values are actually a tebi/pebibyte in the first place. Thoughts?

I agree with that part, it is very odd to say this.

But actually, this is problematic in other ways. First of all, this should have nothing to do with address space size; this is formatting for a file size, and there is no reason you can't have a 1 TiB file on 32-bit armhf.

The real problem looks to be in the API. It is using a size_t for the number passed into format_file_size, which is only 32-bit on armhf, so it can only represent up to 4GiB. I think the correct fix here is to switch to a uint64_t for the format_file_size API, which means that all of this will work on both 32-bit and 64-bit platforms.

@prajakta-gokhale
Copy link
Copy Markdown
Author

The real problem looks to be in the API. It is using a size_t for the number passed into format_file_size, which is only 32-bit on armhf, so it can only represent up to 4GiB. I think the correct fix here is to switch to a uint64_t for the format_file_size API, which means that all of this will work on both 32-bit and 64-bit platforms.

I didn't realize that, thanks for pointing it out! Will change it in the next commit.

Fixes for unit test failures from armhf builds.

Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
@emersonknapp
Copy link
Copy Markdown
Collaborator

emersonknapp commented Jun 25, 2019

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status
  • Linux-armhf Build Status

@prajakta-gokhale
Copy link
Copy Markdown
Author

@clalancette please take a look agian, thanks!

Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
@prajakta-gokhale
Copy link
Copy Markdown
Author

@Karsten1987 could you please review these changes and let us know what you think about changing member variable types from size_t to uint64_t?

@Karsten1987
Copy link
Copy Markdown
Collaborator

I agree, having size_t here is indeed prone to error. Therefore, I agree with @clalancette for the proposed changes. I am still a bit undecided whether we have to bump the version when it's obviously a wrong behavior.

@clalancette
Copy link
Copy Markdown
Contributor

I am still a bit undecided whether we have to bump the version when it's obviously a wrong behavior.

So for the bag_size itself, there is actually a comment there saying that it is not serialized. If we just change that, we may not have to bump the version. But the fact that message_count is also a size_t, and is serialized, means (to me) that we have to bump the version. There probably aren't a ton of bag files out there now, but having a different size without bumping the version may lead to difficult-to-debug bugs.

@prajakta-gokhale
Copy link
Copy Markdown
Author

There probably aren't a ton of bag files out there now, but having a different size without bumping the version may lead to difficult-to-debug bugs.

I agree with that reasoning. For the sake of fixing unit test failures in the nightlies, we could merge this PR as is and create a new one to change variable types (and bump up the version?)

@clalancette
Copy link
Copy Markdown
Contributor

I agree with that reasoning. For the sake of fixing unit test failures in the nightlies, we could merge this PR as is and create a new one to change variable types (and bump up the version?)

I'd prefer not to do that; it will be too easy to forget about this problem once it is "hidden" with this PR merged.

@prajakta-gokhale Please make the changes to BagMetadata switching the size_t -> uint64_t, and bumping the version. @Karsten1987 can then review, and if he still disagrees with the version bump it's just a one-line change.

Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
@prajakta-gokhale
Copy link
Copy Markdown
Author

@Karsten1987 I have changed the variable types and bumped up BagMetadata::version in the latest commit. Please take a look.

Copy link
Copy Markdown
Collaborator

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

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

Changes look good to me (with green CI)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@prajakta-gokhale please let me know if you want me to test something specifically.

@emersonknapp
Copy link
Copy Markdown
Collaborator

Lets also check that the armhf tests are fixed :) Build Status

@emersonknapp
Copy link
Copy Markdown
Collaborator

@Karsten1987 we're happy with this - if you are too let's get this merged - I think this is the final PR for ci_linux-armhf to be fully green.

@Karsten1987 Karsten1987 merged commit 4bb9d89 into ros2:master Jul 18, 2019
@prajakta-gokhale prajakta-gokhale deleted the fix-test-armhf branch July 18, 2019 18:13
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.

armhf support is incomplete

4 participants