Skip to content

Commit 8daad33

Browse files
committed
enable test_init_teardown in CI
1 parent c27abca commit 8daad33

File tree

8 files changed

+27
-117
lines changed

8 files changed

+27
-117
lines changed

.github/workflows/nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ jobs:
5959

6060
- name: Run regular tests
6161
working-directory: ${{github.workspace}}/build
62-
run: ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz|test_init_teardown"
62+
run: ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz"
6363

6464
- name: Run regular tests with proxy library
6565
working-directory: ${{env.BUILD_DIR}}
66-
run: LD_PRELOAD=./lib/libumf_proxy.so ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz|test_init_teardown"
66+
run: LD_PRELOAD=./lib/libumf_proxy.so ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz"
6767

6868
- name: Fuzz long test
6969
working-directory: ${{github.workspace}}/build

.github/workflows/pr_push.yml

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -16,88 +16,5 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
CodeChecks:
20-
uses: ./.github/workflows/reusable_checks.yml
21-
FastBuild:
22-
name: Fast builds
23-
needs: [CodeChecks]
24-
uses: ./.github/workflows/reusable_fast.yml
25-
Build:
26-
name: Basic builds
27-
needs: [FastBuild]
28-
uses: ./.github/workflows/reusable_basic.yml
29-
DevDax:
30-
needs: [FastBuild]
31-
uses: ./.github/workflows/reusable_dax.yml
3219
MultiNuma:
33-
needs: [FastBuild]
3420
uses: ./.github/workflows/reusable_multi_numa.yml
35-
L0:
36-
needs: [Build]
37-
uses: ./.github/workflows/reusable_gpu.yml
38-
with:
39-
provider: "LEVEL_ZERO"
40-
runner: "L0"
41-
shared_lib: "['ON']"
42-
L0-BMG:
43-
needs: [Build]
44-
uses: ./.github/workflows/reusable_gpu.yml
45-
with:
46-
provider: "LEVEL_ZERO"
47-
runner: "L0-BMG"
48-
shared_lib: "['ON']"
49-
os: "['Ubuntu']"
50-
CUDA:
51-
needs: [Build]
52-
uses: ./.github/workflows/reusable_gpu.yml
53-
with:
54-
provider: "CUDA"
55-
runner: "CUDA"
56-
shared_lib: "['ON']"
57-
Sanitizers:
58-
needs: [FastBuild]
59-
uses: ./.github/workflows/reusable_sanitizers.yml
60-
QEMU:
61-
needs: [FastBuild]
62-
uses: ./.github/workflows/reusable_qemu.yml
63-
with:
64-
short_run: true
65-
ProxyLib:
66-
needs: [Build]
67-
uses: ./.github/workflows/reusable_proxy_lib.yml
68-
Valgrind:
69-
needs: [Build]
70-
uses: ./.github/workflows/reusable_valgrind.yml
71-
Coverage:
72-
# total coverage (on upstream only)
73-
if: github.repository == 'oneapi-src/unified-memory-framework'
74-
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
75-
uses: ./.github/workflows/reusable_coverage.yml
76-
secrets: inherit
77-
with:
78-
trigger: "${{github.event_name}}"
79-
Coverage_partial:
80-
# partial coverage (on forks)
81-
if: github.repository != 'oneapi-src/unified-memory-framework'
82-
needs: [Build, QEMU, ProxyLib]
83-
uses: ./.github/workflows/reusable_coverage.yml
84-
CodeQL:
85-
needs: [Build]
86-
permissions:
87-
contents: read
88-
security-events: write
89-
uses: ./.github/workflows/reusable_codeql.yml
90-
Trivy:
91-
needs: [Build]
92-
permissions:
93-
contents: read
94-
security-events: write
95-
uses: ./.github/workflows/reusable_trivy.yml
96-
Compatibility:
97-
needs: [Build]
98-
uses: ./.github/workflows/reusable_compatibility.yml
99-
strategy:
100-
matrix:
101-
tag: ["v0.11.0-rc1"]
102-
with:
103-
tag: ${{matrix.tag}}

.github/workflows/reusable_multi_numa.yml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
strategy:
2222
matrix:
2323
os: [ubuntu-22.04, rhel-9.1, sles-15]
24-
build_type: [Debug, Release]
25-
shared_library: ['ON', 'OFF']
24+
build_type: [Debug]
25+
shared_library: ['ON']
2626
runs-on: ["DSS-MULTI-NUMA", "DSS-${{matrix.os}}"]
2727

2828
steps:
@@ -57,37 +57,13 @@ jobs:
5757
# On RHEL/SLES, hwloc version is just a little too low.
5858
# Skip some tests until we upgrade hwloc and update CMake to properly handle local hwloc installation.
5959
# TODO: fix issue #560
60-
# TODO: add issue for -E test_init_teardown - it is not clear why it fails
6160
- name: Run tests (on RHEL/SLES)
6261
if: (matrix.os == 'rhel-9.1') || (matrix.os == 'sles-15')
6362
working-directory: ${{github.workspace}}/build
6463
run: |
65-
ctest --output-on-failure --test-dir test -E "test_provider_os_memory_multiple_numa_nodes|test_init_teardown"
64+
UMF_LOG="level:debug;flush:debug;output:stderr;pid:no" ctest --output-on-failure --test-dir test -E "test_provider_os_memory_multiple_numa_nodes"
6665
./test/test_provider_os_memory_multiple_numa_nodes \
67-
--gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave"
68-
69-
- name: Run NUMA tests under valgrind
70-
if: (matrix.os != 'rhel-9.1') && (matrix.os != 'sles-15')
71-
run: |
72-
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} memcheck "${{env.NUMA_TESTS}}"
73-
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} drd "${{env.NUMA_TESTS}}"
74-
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} helgrind "${{env.NUMA_TESTS}}"
75-
76-
- name: Check coverage
77-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'ubuntu-22.04' }}
78-
working-directory: ${{env.BUILD_DIR}}
79-
run: |
80-
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
81-
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
82-
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
83-
mkdir -p ${{env.COVERAGE_DIR}}
84-
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
85-
86-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
87-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'ubuntu-22.04' }}
88-
with:
89-
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}
90-
path: ${{env.COVERAGE_DIR}}
66+
--gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave" --verbose
9167
9268
- name: Get information about platform
9369
if: always()

src/base_alloc/base_alloc_global.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct base_alloc_t {
4141
static struct base_alloc_t BASE_ALLOC = {.ac_sizes = ALLOCATION_CLASSES};
4242

4343
void umf_ba_destroy_global(void) {
44+
LOG_DEBUG("destroying global base allocator");
4445
ba_is_destroyed = true;
4546

4647
for (int i = 0; i < NUM_ALLOCATION_CLASSES; i++) {
@@ -55,7 +56,10 @@ void umf_ba_destroy_global(void) {
5556
memcpy(&ba_is_initialized, &set_once, sizeof(ba_is_initialized));
5657
}
5758

58-
bool umf_ba_global_is_destroyed(void) { return ba_is_destroyed; }
59+
bool umf_ba_global_is_destroyed(void) {
60+
LOG_DEBUG("base_alloc: ba_is_destroyed: %d", ba_is_destroyed);
61+
return ba_is_destroyed;
62+
}
5963

6064
static void umf_ba_create_global(void) {
6165
for (int i = 0; i < NUM_ALLOCATION_CLASSES; i++) {
@@ -74,6 +78,7 @@ static void umf_ba_create_global(void) {
7478
BASE_ALLOC.smallest_ac_size_log2 = utils_msb64(smallestSize);
7579

7680
LOG_DEBUG("UMF base allocator created");
81+
ba_is_destroyed = false; // TODO ??
7782
}
7883

7984
// returns index of the allocation class for a given size

src/memory_pool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ static umf_result_t umfPoolCreateInternal(const umf_memory_pool_ops_t *ops,
115115
}
116116

117117
void umfPoolDestroy(umf_memory_pool_handle_t hPool) {
118+
LOG_DEBUG("calling umfPoolDestroy");
118119
if (umf_ba_global_is_destroyed()) {
119120
return;
120121
}

src/pool/pool_scalable.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ static umf_result_t tbb_pool_initialize(umf_memory_provider_handle_t provider,
315315

316316
static void tbb_pool_finalize(void *pool) {
317317
tbb_memory_pool_t *pool_data = (tbb_memory_pool_t *)pool;
318+
fprintf(stderr, "finalizing TBB scalable pool\n");
318319
tbb_callbacks.pool_destroy(pool_data->tbb_pool);
319320
umf_ba_global_free(pool_data);
320321
}
@@ -329,6 +330,7 @@ static void *tbb_malloc(void *pool, size_t size) {
329330
}
330331
return NULL;
331332
}
333+
fprintf(stderr, "tbb_malloc ptr=%p\n", ptr);
332334
utils_annotate_acquire(pool);
333335
return ptr;
334336
}
@@ -376,6 +378,7 @@ static void *tbb_aligned_malloc(void *pool, size_t size, size_t alignment) {
376378
}
377379

378380
static umf_result_t tbb_free(void *pool, void *ptr) {
381+
fprintf(stderr, "tbb_free ptr=%p\n", ptr);
379382
if (ptr == NULL) {
380383
return UMF_RESULT_SUCCESS;
381384
}

src/provider/provider_tracking.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ static umf_result_t trackingAlloc(void *hProvider, size_t size,
494494

495495
*_ptr = ptr;
496496

497+
LOG_DEBUG("Memory region added: ptr=%p, size=%zu", ptr, size);
497498
return UMF_RESULT_SUCCESS;
498499
}
499500

@@ -729,13 +730,13 @@ static umf_result_t trackingFree(void *hProvider, void *ptr, size_t size) {
729730

730731
if (umfMemoryTrackerAdd(p->hTracker, p->pool, ptr, size) !=
731732
UMF_RESULT_SUCCESS) {
732-
LOG_ERR(
733-
"cannot add memory back to the tracker, ptr = %p, size = %zu",
734-
ptr, size);
733+
LOG_ERR("cannot add memory back to the tracker, ptr=%p, size=%zu",
734+
ptr, size);
735735
}
736736
return ret;
737737
}
738738

739+
LOG_DEBUG("Memory region removed: ptr=%p, size=%zu", ptr, size);
739740
return ret;
740741
}
741742

@@ -770,6 +771,10 @@ static void check_if_tracker_is_empty(umf_memory_tracker_handle_t hTracker,
770771
FIND_G, &rkey, (void **)&rvalue)) {
771772
if (rvalue->pool == pool || pool == NULL) {
772773
n_items++;
774+
LOG_DEBUG(
775+
"found abandoned allocation in the tracking provider: "
776+
"pool=%p, ptr=%p, size=%zu",
777+
(void *)rvalue->pool, (void *)rkey, (size_t)rvalue->size);
773778
}
774779

775780
last_key = rkey;

test/test_init_teardown.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ static int run_test(int n_init_teardown, int wrong_dtor_order) {
205205

206206
assert(umf_default);
207207
void *ptr = (*umf_alloc)(umf_default, SIZE_ALLOC);
208+
fprintf(stderr, "\n\n!!!! after alloc: %p\n", ptr);
209+
208210
(*umf_free)(umf_default, ptr);
211+
fprintf(stderr, "\n\n!!!! after free: %p\n", ptr);
209212

210213
// simulate incorrect order of destructors (an additional, unwanted destructor call)
211214
if (wrong_dtor_order) {

0 commit comments

Comments
 (0)