We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does asan Intercept vfork() ? using options -lpthread -fsanitize=address -fsanitize=undefined, clang 15.0.4
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <errno.h> #include <unistd.h> #include <pthread.h> #include <wait.h> void *TestPopen(void *arg) { printf("hello TestPopen.\n"); pid_t pid = vfork(); if (pid < 0) { printf("error vfork.\n"); } else if (pid == 0) { printf("I'm child.\n"); pid_t childPid = vfork(); if (childPid < 0) { printf("error vfork.\n"); } else if (childPid == 0) { // vfork a grand processes printf("I'm grand child, and call exit(0).\n"); _exit(0); } else { printf("I'm child vfork, and call exit(0).\n"); _exit(0); } } else { // father Processes printf("I'm parent.\n"); } while(1) { sleep(1); } return NULL; } int main() { printf("hello\n"); pthread_t tid; int ret = pthread_create(&tid, NULL, TestPopen, NULL); printf("create pthread ret %d.\n", ret); while(1) { sleep(1); } return 0; }
The result is not same without asan
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Why does asan Intercept vfork() ? using options -lpthread -fsanitize=address -fsanitize=undefined, clang 15.0.4
The result is not same without asan
The text was updated successfully, but these errors were encountered: