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

Fsa/report mmap on failure #7057

Closed
wants to merge 17 commits into from
Closed

Conversation

finnschiermer
Copy link
Contributor

@finnschiermer finnschiermer commented Oct 13, 2023

What, How & Why?

This PR

  • Associates every memory mapping with the point in the source code, where it was created.
  • On mmap failure, we log all mappings. If our respons on mmap failure is to throw, we now include a list of all mappings in the exception string
  • The "page reclaimer" in the encryption layer has been removed.

The format of the dumped list is as follows:

Mappings at point of failure:
    0x7f4400000000 - 0x7f4400001000          1000    primary       --M
    0x7f4400001000 - 0x7f4404000000       3fff000    primary       FR-                          /home/finn/core/realm-core/build.release/testShared_MultipleSharersOfStreamingFormat.1.path.realm
    0x7f441426e000 - 0x7f441426f000          1000    primary       --M
    0x7f441426f000 - 0x7f441826e000       3fff000    primary       FR-                          /home/finn/core/realm-core/build.release/testShared_MultipleSharersOfStreamingFormat.1.path.realm
    0x7f44187ff000 - 0x7f4418800000          1000    block wr      --M
    0x7f4418800000 - 0x7f44188006c0           6c0    versions      F--            0 in File     /home/finn/core/realm-core/build.release/testShared_MultipleSharersOfStreamingFormat.1.path.realm.lock
    0x7f4418801000 - 0x7f44188016c0           6c0    meta          F--            0 in File     /home/finn/core/realm-core/build.release/testShared_MultipleSharersOfStreamingFormat.1.path.realm.lock
    0x7f4418802000 - 0x7f44188026c0           6c0    versions      F--            0 in File     /home/finn/core/realm-core/build.release/testShared_MultipleSharersOfStreamingFormat.1.path.realm.lock
    0x7f441883c000 - 0x7f441883c6c0           6c0    meta          F--            0 in File     /home/finn/core/realm-core/build.release/testShared_MultipleSharersOfStreamingFormat.1.path.realm.lock

@coveralls-official
Copy link

coveralls-official bot commented Oct 13, 2023

Pull Request Test Coverage Report for Build github_pull_request_284258

  • 305 of 320 (95.31%) changed or added relevant lines in 11 files are covered.
  • 34 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.3%) to 91.935%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/realm/db.cpp 5 6 83.33%
test/test_transactions.cpp 0 1 0.0%
src/realm/util/file.cpp 30 32 93.75%
src/realm/util/file_mapper.cpp 176 187 94.12%
Files with Coverage Reduction New Missed Lines %
src/realm/array_string.cpp 2 88.0%
src/realm/transaction.cpp 2 94.71%
src/realm/sync/noinst/server/server.cpp 3 75.86%
src/realm/alloc_slab.cpp 4 98.27%
src/realm/index_string.cpp 6 87.87%
src/realm/util/file_mapper.cpp 8 93.5%
src/realm/util/file.cpp 9 94.54%
Totals Coverage Status
Change from base Build 1829: 0.3%
Covered Lines: 232286
Relevant Lines: 252663

💛 - Coveralls

@finnschiermer finnschiermer force-pushed the fsa/report-mmap-on-failure branch from 95f74be to 6a1fa67 Compare October 20, 2023 12:40
@finnschiermer finnschiermer force-pushed the fsa/report-mmap-on-failure branch from a49b5ef to aa98846 Compare October 25, 2023 05:59
@finnschiermer finnschiermer force-pushed the fsa/report-mmap-on-failure branch from 4dd174d to 33e18c0 Compare October 26, 2023 09:52
@finnschiermer finnschiermer force-pushed the fsa/report-mmap-on-failure branch from e888d37 to c45aefb Compare October 27, 2023 10:48
@finnschiermer finnschiermer force-pushed the fsa/report-mmap-on-failure branch 2 times, most recently from c8aa42f to d80dcaa Compare October 30, 2023 17:03
@finnschiermer finnschiermer force-pushed the fsa/report-mmap-on-failure branch from df14682 to cbf621d Compare October 31, 2023 13:17
@finnschiermer finnschiermer requested a review from jedelbo October 31, 2023 15:43
@finnschiermer finnschiermer marked this pull request as ready for review October 31, 2023 15:44
Copy link
Contributor

@jedelbo jedelbo left a comment

Choose a reason for hiding this comment

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

I would like to have a unit test for memory mapping where the logging functionality is exercised.

Review to be continued.

src/realm/alloc_slab.cpp Outdated Show resolved Hide resolved
src/realm/alloc_slab.cpp Outdated Show resolved Hide resolved
src/realm/util/file_mapper.cpp Outdated Show resolved Hide resolved
src/realm/util/file_mapper.cpp Show resolved Hide resolved
src/realm/util/file_mapper.cpp Outdated Show resolved Hide resolved
@jedelbo jedelbo closed this Aug 14, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants