Skip to content

Commit fa60a00

Browse files
committed
regular tests pass now having issues with sanitizer passes with driver issues. addresses this problem
1 parent 364994d commit fa60a00

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,28 @@ jobs:
117117
submodules: recursive
118118

119119
- name: Configure (ASan preset)
120-
run: cmake --preset asan
120+
run: |
121+
if [[ -f /etc/profile.d/lmod.sh ]]; then
122+
source /etc/profile.d/lmod.sh
123+
fi
124+
if command -v module >/dev/null 2>&1; then
125+
module purge
126+
module load nvhpc/23.11/nvhpc-hpcx-cuda12
127+
fi
128+
cmake --preset asan
121129
122130
- name: Build
123131
run: cmake --build --preset asan --parallel
124132

125133
- name: Run tests (ASan)
126134
run: |
135+
if [[ -f /etc/profile.d/lmod.sh ]]; then
136+
source /etc/profile.d/lmod.sh
137+
fi
138+
if command -v module >/dev/null 2>&1; then
139+
module purge
140+
module load nvhpc/23.11/nvhpc-hpcx-cuda12
141+
fi
127142
# ASan is baked into the shared libraries. The dynamic linker does not
128143
# guarantee it initializes before main(), so we must preload it first.
129144
# Without this, every test fails with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Version numbers follow [Semantic Versioning](https://semver.org/).
8484
- `LorenzoStage` (the old fused predictor+quantizer) removed and replaced by `LorenzoQuantStage`; `LorenzoStage` now refers exclusively to the plain integer delta predictor
8585

8686
### Fixed
87+
- ASan: avoid a use-after-free in `CompressionDAG::addStage` by taking the stage name by value
8788
- CI: make CUDA module loading optional when lmod/module are unavailable so non-Jetstream runners do not fail early
8889
- vGPU compatibility: added fallback from `cudaMallocAsync`/`cudaFreeAsync` to `cudaMalloc`/`cudaFree` when memory pools are unavailable; `MemoryPool` gracefully degrades to regular malloc mode with warning log; fixes "operation not supported" errors on virtualized GPUs (e.g., Jetstream NVIDIA Virtual Compute Server)
8990
- vGPU stream synchronization: fallback code paths in `MemoryPool`, `DifferenceStage`, `RLEStage`, and `RZEStage` now synchronize streams before calling `cudaFree()` to prevent use-after-free race conditions when kernels are still using freed memory

include/pipeline/dag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class CompressionDAG {
9393
// ── Construction ──────────────────────────────────────────────────────────
9494

9595
/** Add a stage and return its node for wiring dependencies. */
96-
DAGNode* addStage(Stage* stage, const std::string& name = "");
96+
DAGNode* addStage(Stage* stage, std::string name = "");
9797

9898
/**
9999
* Add a dependency between two nodes, creating an intermediate buffer.

src/pipeline/dag.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ CompressionDAG::~CompressionDAG() {
7676
}
7777
}
7878

79-
DAGNode* CompressionDAG::addStage(Stage* stage, const std::string& name) {
79+
DAGNode* CompressionDAG::addStage(Stage* stage, std::string name) {
8080
if (is_finalized_) {
8181
throw std::runtime_error("Cannot modify DAG after finalization");
8282
}
@@ -90,7 +90,11 @@ DAGNode* CompressionDAG::addStage(Stage* stage, const std::string& name) {
9090

9191
auto* node = new DAGNode(stage);
9292
node->id = static_cast<int>(nodes_.size());
93-
node->name = name.empty() ? "stage_" + std::to_string(node->id) : name;
93+
if (name.empty()) {
94+
node->name = "stage_" + std::to_string(node->id);
95+
} else {
96+
node->name = std::move(name);
97+
}
9498

9599
cudaError_t err = cudaEventCreate(&node->completion_event);
96100
if (err != cudaSuccess) {

0 commit comments

Comments
 (0)