[compiler-rt] [compiler-rt] [sanitizer_common] Add a testcase reproducing SIGSEGV in ForEachMappedRegion (PR #208358)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 8 18:04:13 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions c -- compiler-rt/test/sanitizer_common/TestCases/Linux/dlopen_image_base.c --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/dlopen_image_base.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/dlopen_image_base.c
index c7f7639f4..e340d0bd2 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/dlopen_image_base.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/dlopen_image_base.c
@@ -7,13 +7,13 @@
*/
#ifndef BUILD_SO
-#define _GNU_SOURCE
-#include <assert.h>
-#include <dlfcn.h>
-#include <link.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <unistd.h>
+# define _GNU_SOURCE
+# include <assert.h>
+# include <dlfcn.h>
+# include <link.h>
+# include <stdbool.h>
+# include <stdio.h>
+# include <unistd.h>
int main(int argc, char *argv[]) {
char path[4096];
@@ -29,11 +29,11 @@ int main(int argc, char *argv[]) {
dlinfo(handle, RTLD_DI_LINKMAP, &map);
if (map) {
printf("DSO link_map name: %s\n", map->l_name);
- printf("DSO link_map l_addr: %p\n", (void*)map->l_addr);
+ printf("DSO link_map l_addr: %p\n", (void *)map->l_addr);
int pipefd[2];
bool readable = false;
if (pipe(pipefd) == 0) {
- if (write(pipefd[1], (void*)map->l_addr, 1) == 1) {
+ if (write(pipefd[1], (void *)map->l_addr, 1) == 1) {
readable = true;
}
close(pipefd[0]);
@@ -50,6 +50,6 @@ int main(int argc, char *argv[]) {
return 0;
}
#else // BUILD_SO
-#include <stdio.h>
+# include <stdio.h>
void fn() { printf("DSO function called successfully\n"); }
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/208358
More information about the llvm-commits
mailing list