Skip to content
New issue

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

ThreadSanitizer: unexpected memory mapping #806

Closed
raminfp opened this issue May 4, 2017 · 1 comment
Closed

ThreadSanitizer: unexpected memory mapping #806

raminfp opened this issue May 4, 2017 · 1 comment

Comments

@raminfp
Copy link

raminfp commented May 4, 2017

Hi,

Linux 4.10.x and gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 I get this error:

FATAL: ThreadSanitizer: unexpected memory mapping 0x5637e5c3b000-0x5637e5c3c000

//gcc -fsanitize=thread -pie -fPIC -ltsan -g race.c && ./a.out

#include <pthread.h>
#include <stdio.h>

int y;

void *thread(void *x) {
    y++;
    return NULL;
}

int main() {
    pthread_t t[2];
    pthread_create(&t[0], NULL, thread, NULL);
    y = 100;
    pthread_join(t[0], NULL);
}
@dvyukov
Copy link
Contributor

dvyukov commented May 4, 2017

Dup of #503
This is fixed in newer gcc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67308
Try updating, or as workaround try to remove -pie -fPIC flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants