github / codeql-action

Actions for running CodeQL analysis
MIT License
1.16k stars 321 forks source link

Unset `DYLD_INSERT_BINARIES` when unneeded #2428

Closed angelapwen closed 2 months ago

angelapwen commented 2 months ago

Previously, the tracer environment variables were set for the current process, and for future steps, in the init action. In certain scenarios (such as on MacOS ARM runners with System Integrity Protection disabled), these environment variables are not unset by the system. In particular, the DYLD_INSERT_BINARIES variable interferes with later system calls.

This change unsets the DYLD_INSERT_BINARIES variable for the current process in init. It also unsets the variables either at the beginning of autobuild, or analyze, if autobuild has not run.

Merge / deployment checklist

angelapwen commented 2 months ago

Getting some unbound variable errors from the autobuilders. I'll test out only unsetting the variable that we need to fix this issue.

angelapwen commented 2 months ago

Hrm... hang on, still getting warnings related to the insertion when running on macos-latest so moving back to draft.

angelapwen commented 2 months ago

Closing as unsetting this variable doesn't seem to have done what we'd hoped. We will stop running the system binary instead for now: https://github.com/github/codeql-action/pull/2434