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

bug in the gcc lib #84

Open
kyoguan opened this issue Dec 1, 2020 · 2 comments
Open

bug in the gcc lib #84

kyoguan opened this issue Dec 1, 2020 · 2 comments

Comments

@kyoguan
Copy link
Contributor

kyoguan commented Dec 1, 2020

We found the gcc lib has a bug, call the system call futex without the FUTEX_PRIVATE_FLAG flag. This would block the thread after mesh, because the phys address changed. clang' lib without this bug.

eg. std::future would trigger this bug.

@bobby-stripe
Copy link
Contributor

yikes! do you have links to the bug or a small reproducer? is it in libgcc or glibc? its surprising to me that freeing the meshed page wouldn't clear/purge the waiting futex, otherwise it seems like a process could get notified about a futex in a different process (if/when the memory is reused)

@kyoguan
Copy link
Contributor Author

kyoguan commented Dec 2, 2020

https://github.com/gcc-mirror/gcc/blob/df3e7e7eba31450357b3773f5fb028b5ec2d3669/libstdc%2B%2B-v3/src/c%2B%2B11/futex.cc

here:
const unsigned futex_wait_op = 0;
const unsigned futex_wake_op = 1;

they should be
const unsigned futex_wait_op = 0 | 128;
const unsigned futex_wake_op = 1 | 128;

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