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

fix on ReExec implementation for tsan under linux_arm environment #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OldChicken1
Copy link

Currently under linux arm platform, if ASLR is enabled, executable that is compiled and linked with tsan options will be set a maximum stack size instead of unlimited, and get reexecuted (because of a aarch patch, see details https://reviews.llvm.org/D18003) . And that will rename the process as exe. If multiple process run with tsan, then they will all be renamed as exe and the tsan reports are also named as exe.{pid}, which makes it hard to identify a specific process. So instead of executing the link to the executable("/proc/self/exe"), try to pass the original argv[0] to execve function. And this will make the process reexecuted with their original name.

@MLopez-Ibanez
Copy link

This is a read-only mirror that is not managed by GCC developers.

Pull requests in this read-only mirror will be ignored forever.

If you wish to contribute to GCC please read: https://gcc.gnu.org/wiki/GettingStarted

@jwakely
Copy link
Contributor

jwakely commented Feb 21, 2024

This should be fixed upstream in LLVM, then GCC will pick it up from there. A pull request here won't achieve anything.

It seems to me that using readlink to resolve /proc/self/exe would be better. The argv[0] value might not be a valid pathname and so trying to re-execute it would fail.

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