Closed ramosian-glider closed 9 years ago
or 3) instrumenting all noreturn calls with __tsan_unpoison_stack or some such.
I'll give it a try.
(and thanks for the repro)
Reported by konstantin.s.serebryany
on 2012-02-08 15:42:11
shorter repro:
#include <sched.h>
#include <stdio.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int Child(void *arg) {
char x[32] = {0};
fprintf(stderr, "Child: %p\n", x);
volatile char *ch = x + 32;
_exit(1);
}
int main(int argc, char **argv) {
const int kStackSize = 1 << 20;
char child_stack[kStackSize + 1];
char *sp = child_stack + kStackSize; // Stack grows down.
fprintf(stderr, "Parent: %p\n", sp);
pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL, 0, 0, 0);
waitpid(clone_pid, NULL, 0);
for (int i = 0; i < kStackSize; i++)
child_stack[i] = i;
return child_stack[argc - 1];
}
Reported by konstantin.s.serebryany
on 2012-02-08 18:45:54
This particular test is fixed by r150101 / r150102.
Will see if it fixes more complicated cases.
Reported by konstantin.s.serebryany
on 2012-02-08 21:41:50
Fixed
Adding Project:AddressSanitizer as part of GitHub migration.
Reported by ramosian.glider
on 2015-07-30 09:12:58
Originally reported on Google Code with ID 37
Reported by
samsonov@google.com
on 2012-02-08 13:35:04