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

segment_utils.cc: runtime error: signed integer overflow #6930

Closed
twmb opened this issue Oct 25, 2022 · 4 comments · Fixed by #6941
Closed

segment_utils.cc: runtime error: signed integer overflow #6930

twmb opened this issue Oct 25, 2022 · 4 comments · Fixed by #6941

Comments

@twmb
Copy link
Contributor

twmb commented Oct 25, 2022

https://buildkite.com/redpanda/redpanda/builds/17199#01840cbd-2239-46b2-8487-c0bbb54ab702

A few odd looking things but I don't know what's relevant:

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /var/lib/buildkite-agent/builds/buildkite-amd64-xfs-builders-i-0002523df1f0fd2a4-1/redpanda/redpanda/src/v/storage/segment_utils.cc:896:32 in ^M
^[[0;39;49m^[[1;34;49m/var/lib/buildkite-agent/builds/buildkite-amd64-xfs-builders-i-0002523df1f0fd2a4-1/redpanda/redpanda/src/v/storage/tests/segment_size_jitter_test.cc(0): Leaving test case "test_segment_size_jitter_calculation"; testing time: 11763us^M
ERROR 2022-10-25 01:48:27,482 [shard 0] assert - Assert failure: (/var/lib/buildkite-agent/builds/buildkite-amd64-xfs-builders-i-0002523df1f0fd2a4-1/redpanda/redpanda/src/v/storage/segment_appender.cc:332) '_prev_head_write->available_units() == 1' Unexpected pending head write {no_of_chunks:64, closed:0, fallocation_offset:16384, committed_offset:16296, bytes_flush_pending:0}^M
@dotnwat dotnwat changed the title Failure in storage_single_thread_rpunit segment_utils.cc: runtime error: signed integer overflow Oct 25, 2022
@dotnwat
Copy link
Member

dotnwat commented Oct 25, 2022

/var/lib/buildkite-agent/builds/buildkite-amd64-xfs-builders-i-0002523df1f0fd2a4-1/redpanda/redpanda/src/v/storage/segment_utils.cc:896:32: runtime error: signed integer overflow: -2147483648 * 10 cannot be represented in type 'int'

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /var/lib/buildkite-agent/builds/buildkite-amd64-xfs-builders-i-0002523df1f0fd2a4-1/redpanda/redpanda/src/v/storage/segment_utils.cc:896:32 in 

The second assertion failure is a duplicate of #5433

@dotnwat
Copy link
Member

dotnwat commented Oct 25, 2022

@bharathv @mmaslankaprv seem like the last folks to touch this. it looks like there is a path in which the default value for jitter (named_type default constructed has -2147483648 as the value (ie number_limits::min())).

@dotnwat
Copy link
Member

dotnwat commented Oct 25, 2022

Presumably the assertion right before it jitter_percents >= 0 || jitter_percents <= 100, should be a conjunction, too.

@bharathv
Copy link
Contributor

Presumably the assertion right before it jitter_percents >= 0 || jitter_percents <= 100, should be a conjunction, too.

Yep.

I think this change is the issue, let me fix it.

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

Successfully merging a pull request may close this issue.

3 participants