Closed GoogleCodeExporter 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)
Original comment by konstant...@gmail.com
on 8 Feb 2012 at 3:42
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];
}
Original comment by konstant...@gmail.com
on 8 Feb 2012 at 6:45
This particular test is fixed by r150101 / r150102.
Will see if it fixes more complicated cases.
Original comment by konstant...@gmail.com
on 8 Feb 2012 at 9:41
Adding Project:AddressSanitizer as part of GitHub migration.
Original comment by ramosian.glider@gmail.com
on 30 Jul 2015 at 9:12
Original issue reported on code.google.com by
samso...@google.com
on 8 Feb 2012 at 1:35