Skip to content

memory leak #53

@levBagryansky

Description

@levBagryansky

I started besm666_page_pool_tests with sanitaizers adding to test/memory/CMakeLists the following:

target_compile_options(besm666_page_pool_tests PUBLIC -fsanitize=address -g)
set_target_properties(besm666_page_pool_tests PROPERTIES LINK_FLAGS "-fsanitize=address")

and get the error below:

2/8 Test #2: gprf-tests .......................   Passed    0.01 sec
    Start 3: besm666_page_pool
3/8 Test #3: besm666_page_pool ................***Failed    0.10 sec
Running main() from gmock_main.cc
[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from page_allocator
[ RUN      ] page_allocator.out_of_memory
[       OK ] page_allocator.out_of_memory (0 ms)
[ RUN      ] page_allocator.page_overlapping
[       OK ] page_allocator.page_overlapping (0 ms)
[ RUN      ] page_allocator.page_writting
[       OK ] page_allocator.page_writting (0 ms)
[----------] 3 tests from page_allocator (0 ms total)

[----------] Global test environment tear-down
[==========] 3 tests from 1 test suite ran. (0 ms total)
[  PASSED  ] 3 tests.

=================================================================
==54189==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2048 byte(s) in 1 object(s) allocated from:
    #0 0x7fd365cb6357 in operator new[](unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:102
    #1 0x55c71410fb2e in page_allocator_page_overlapping_Test::TestBody() /home/tardis3/BESM-666/test/memory/page-pool-tests.cpp:33

SUMMARY: AddressSanitizer: 2048 byte(s) leaked in 1 allocation(s).

    Start 4: besm666_phys_mem
4/8 Test #4: besm666_phys_mem .................   Passed    0.00 sec
    Start 5: RV64I-executor-tests
5/8 Test #5: RV64I-executor-tests .............   Passed    0.01 sec
    Start 6: simple-programs
6/8 Test #6: simple-programs ..................   Passed    0.01 sec
    Start 7: bit-magic-tests
7/8 Test #7: bit-magic-tests ..................   Passed    0.01 sec
    Start 8: decoder_test
8/8 Test #8: decoder_test .....................   Passed    0.01 sec

88% tests passed, 1 tests failed out of 8

Total Test time (real) =   0.19 sec

The following tests FAILED:
          3 - besm666_page_pool (Failed)

@mmamayka Could you please fix this?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions