-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
ExeWithContext
returns an error with a Go binary on newer versions of macOS
#1622
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
Comments
Can you share with us the result of |
Sure, here is the output of the command with a similar process
|
Thank you for the information. From the code, Perhaps the lsof version has been updated to 4.93 or later. I tested on old version of macOS which has lsof version 4.91, and the output has multiple |
Sure, here is the output:
For what it's worth, we have an integration test suite that was running on version 11 of macOS that did not have this problem so you're theory could be correct. |
Thank you for the information. This means that the code may need to be changed depending on the number of |
Closing this as the fix has now been merged. |
Describe the bug
The
ExeWithContext
function here expects a specific number offtxt
entries before it extract the executable file path. It appears that on newer versions of macOS this output has changed.To Reproduce
Passing the following code a running Go binary creates an error. I haven't tested with other running processes.
❯ CGO_ENABLED=0 go run main.go 64030 Could not get executable of process: missing txt data returned by lsof exit status 1
When I run the
lsof
command I can see only oneftxt
line in the output.Expected behavior
The
proc.Exe()
call does not fail and returns the executable file path.Environment (please complete the following information):
ver
]/etc/os-release
and the result ofuname -a
]sw_vers
anduname -a
freebsd-version -k -r -u
anduname -a
]uname -a
]Additional context
For the product I'm working on we have an integration test suite that runs on an older version of macOS. The issue does not appear to be present there. Below are the details from the integration test runner:
The text was updated successfully, but these errors were encountered: