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

Fix several valgrind failures #7789

Merged
merged 1 commit into from
Jun 8, 2024
Merged

Fix several valgrind failures #7789

merged 1 commit into from
Jun 8, 2024

Conversation

tgoyne
Copy link
Member

@tgoyne tgoyne commented Jun 7, 2024

Checking actual == 0 rather than actual < encryption_page_size resulted in us proceeding to try to hash the partial read, which if this was the very first page read with the current AESCryptor would hash uninitialized data. This was probably harmless in practice as the hmac check would fail anyway.

Not zero-initializing the hmac variable lets valgrind produce an error if we ever fail to initialize it (which did not turn out to be the problem).

The TwoPages and ThreePages were failing to test the scenarios they were intending to test when page_size() wasn't 4k. In particular, the TwoPages test would read a complete page and hit a normal decryption failure rather than an incomplete read.

Group_TableNameTooLong used uninitialized data as the table name. This was actually almost fine, but building the error message when throwing an exception involved string formatting on the uninitialized data and thus branching.

The suppressions file was super out of data and most of the things being suppressed are long-gone.

(This will need to be rebased after the release is complete to put the changelog entry in the correct place).

@tgoyne tgoyne added the no-jira-ticket Skip checking the PR title for Jira reference label Jun 7, 2024
@tgoyne tgoyne requested a review from ironage June 7, 2024 21:46
@tgoyne tgoyne self-assigned this Jun 7, 2024
@cla-bot cla-bot bot added the cla: yes label Jun 7, 2024
Copy link

coveralls-official bot commented Jun 7, 2024

Pull Request Test Coverage Report for Build thomas.goyne_398

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on tg/valgrind at 90.96%

Totals Coverage Status
Change from base Build 2399: 91.0%
Covered Lines: 214550
Relevant Lines: 235873

💛 - Coveralls

Copy link
Contributor

@ironage ironage left a comment

Choose a reason for hiding this comment

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

💯

Copy link

coveralls-official bot commented Jun 8, 2024

Pull Request Test Coverage Report for Build thomas.goyne_399

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • 83 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.004%) to 90.947%

Files with Coverage Reduction New Missed Lines %
src/realm/sync/network/websocket.cpp 1 71.79%
src/realm/db.cpp 2 92.05%
src/realm/object-store/shared_realm.cpp 2 91.89%
src/realm/query_expression.hpp 2 93.81%
src/realm/query_engine.cpp 3 92.36%
src/realm/sync/noinst/protocol_codec.hpp 3 73.5%
src/realm/sync/noinst/client_impl_base.cpp 4 82.67%
src/realm/sync/noinst/server/server_history.cpp 4 63.51%
test/fuzz_tester.hpp 4 57.32%
src/realm/table.cpp 5 90.16%
Totals Coverage Status
Change from base Build 2400: -0.004%
Covered Lines: 214521
Relevant Lines: 235875

💛 - Coveralls

@tgoyne tgoyne merged commit f3928e3 into master Jun 8, 2024
39 checks passed
@tgoyne tgoyne deleted the tg/valgrind branch June 8, 2024 01:31
@github-actions github-actions bot mentioned this pull request Jun 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes no-jira-ticket Skip checking the PR title for Jira reference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants