CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
75 lines
1.6 KiB
C++
75 lines
1.6 KiB
C++
// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -std=c++11 -O0 %s -o %t && %run %t
|
|
//
|
|
// Test that va_arg shadow from a signal handler does not leak outside.
|
|
|
|
// Reported deadly signal due to stack-overflow
|
|
// XFAIL: target={{.*netbsd.*}}
|
|
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <sanitizer/msan_interface.h>
|
|
#include <assert.h>
|
|
#include <sys/time.h>
|
|
#include <stdio.h>
|
|
|
|
const int kSigCnt = 200;
|
|
|
|
void f(bool poisoned, int n, ...) {
|
|
va_list vl;
|
|
va_start(vl, n);
|
|
for (int i = 0; i < n; ++i) {
|
|
void *p = va_arg(vl, void *);
|
|
if (!poisoned)
|
|
assert(__msan_test_shadow(&p, sizeof(p)) == -1);
|
|
}
|
|
va_end(vl);
|
|
}
|
|
|
|
int sigcnt;
|
|
|
|
void SignalHandler(int signo) {
|
|
assert(signo == SIGPROF);
|
|
void *p;
|
|
void **volatile q = &p;
|
|
f(true, 10,
|
|
*q, *q, *q, *q, *q,
|
|
*q, *q, *q, *q, *q);
|
|
++sigcnt;
|
|
}
|
|
|
|
int main() {
|
|
signal(SIGPROF, SignalHandler);
|
|
|
|
itimerval itv;
|
|
itv.it_interval.tv_sec = 0;
|
|
itv.it_interval.tv_usec = 100;
|
|
itv.it_value.tv_sec = 0;
|
|
itv.it_value.tv_usec = 100;
|
|
setitimer(ITIMER_PROF, &itv, NULL);
|
|
|
|
void *p;
|
|
void **volatile q = &p;
|
|
|
|
do {
|
|
f(false, 20,
|
|
nullptr, nullptr, nullptr, nullptr, nullptr,
|
|
nullptr, nullptr, nullptr, nullptr, nullptr,
|
|
nullptr, nullptr, nullptr, nullptr, nullptr,
|
|
nullptr, nullptr, nullptr, nullptr, nullptr);
|
|
f(true, 20,
|
|
*q, *q, *q, *q, *q,
|
|
*q, *q, *q, *q, *q,
|
|
*q, *q, *q, *q, *q,
|
|
*q, *q, *q, *q, *q);
|
|
} while (sigcnt < kSigCnt);
|
|
|
|
itv.it_interval.tv_sec = 0;
|
|
itv.it_interval.tv_usec = 0;
|
|
itv.it_value.tv_sec = 0;
|
|
itv.it_value.tv_usec = 0;
|
|
setitimer(ITIMER_PROF, &itv, NULL);
|
|
|
|
signal(SIGPROF, SIG_DFL);
|
|
return 0;
|
|
}
|