You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've run into spurious testing failures when running a TSAN instrumented executable as script interpreter in a shebang: zeek/zeek#3774
This was tracked down to TSAN deciding to reexecute and then the shebang arguments are duplicated in argv[].
Here's a short reproducer, notice the -b -- and ./main.sh entries duplicated after a reexec is forced with ulimit -s unlimited. For us it was a spurious failure because the reexec wasn't deterministic.
$ cat main.c
#include <stdio.h>
int main(int argc, const char *argv[]) {
printf("argc=%d\n", argc);
for ( int i = 0; i < argc; i++) {
printf("argv[%d]=%s\n", i, argv[i]);
}
}
$ cat main.sh
#!./main -b --
$ clang-18 -fsanitize=thread main.c -o main
$ ./main.sh -a
argc=4
argv[0]=./main
argv[1]=-b --
argv[2]=./main.sh
argv[3]=-a
# force a tsan re-exec
$ ulimit -s unlimited
$ ./main.sh -a
argc=6
argv[0]=./main
argv[1]=-b -- # duplicate
argv[2]=./main.sh # duplicate
argv[3]=-b --
argv[4]=./main.sh
argv[5]=-a
The text was updated successfully, but these errors were encountered:
We've run into spurious testing failures when running a TSAN instrumented executable as script interpreter in a shebang:
zeek/zeek#3774
This was tracked down to TSAN deciding to reexecute and then the shebang arguments are duplicated in
argv[]
.Here's a short reproducer, notice the
-b --
and./main.sh
entries duplicated after a reexec is forced withulimit -s unlimited
. For us it was a spurious failure because the reexec wasn't deterministic.The text was updated successfully, but these errors were encountered: