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

Arch_DebuggerIsAttachedPosix failure. #148

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

Conversation

marsupial
Copy link
Contributor

Description of Change(s)

Arch_DebuggerIsAttachedPosix can return true in cases where the process is in fact not being debugged (on OS X always and when YAMA trace_scope is enabled). This will cause the process to hang after a crash as it assumes the process is being traced. Fixed on OS X by testing if debugger is attached according to Apple docs, and on Linux by making sure the forked child has permission to attach.

Also fixes a typo where variable is compared rather than assigned to.

Fixes Issue(s)

Hanging after crash in OS X and Linux kernels with YAMA
defaultGalId not begin set properly when empty.

@marsupial
Copy link
Contributor Author

These are major defects. Any feedback?

@c64kernal
Copy link
Contributor

Thanks for the PR. We still need time to go through the ARCH_CONSTRUCTOR change (we have a similar one internally that we're testing).

Thanks for the finding the Hd typo. That is a dead code path right now, but it's a great catch nonetheless. If you wouldn't mind breaking it out into its own pull request (it's not related to this PR), that would be great.

Thanks again!

@marsupial
Copy link
Contributor Author

After rebasing to dev I seem to have pushed the wrong commits into this PR.
It was (and now is again) only related to Arch_DebuggerIsAttachedPosix failing on OS X and Ubuntu.

Sorry bout the confusion.

@jtran56
Copy link

jtran56 commented Jun 2, 2017

Filed as internal issue #147125.

@sunyab
Copy link
Contributor

sunyab commented Jun 9, 2017

We made a similar change to the OSX portions of this pull request in commit 3f9467c.

I've been looking at merging the YAMA-related parts of this change, but I think there's a potential race condition here: if the child process tries to attach before the parent process has a chance to finish calling prctl, I think the attach will fail.

It seems like we'd want the child process to wait until the parent process says it's ready before trying to attach. Perhaps we can use pipes to do this, similar to Arch_DebuggerRunUnrelatedProcessPosix.

@marsupial marsupial force-pushed the bugs branch 2 times, most recently from dbda4d3 to 8c66c5b Compare June 9, 2017 23:57
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
USD 22.08 required MaterialX 1.38.4 minimum. At Autodesk we want to align on 1.38.5.
The changes are based on an open Pixar PR PixarAnimationStudios#1965
(cherry picked from commit d9b3c81)
Co-authored-by: Pablo Delgado Krämer <[email protected]>
@nvmkuruc
Copy link
Collaborator

@pmolodo Do you think #3014 might address this same issue?

@jesschimein
Copy link
Contributor

/AzurePipelines run

Copy link

Pull request contains merge conflicts.

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

Successfully merging this pull request may close these issues.

6 participants