-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
trace mode: Various improvements #299
trace mode: Various improvements #299
Commits on Sep 28, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 279717b - Browse repository at this point
Copy the full SHA 279717bView commit details -
darwintrace: Drop DYLD_FORCE_FLAT_NAMESPACE=1
This is no longer required since we switched to the interposing setup and was removed from other locations in macports base a while ago.
Configuration menu - View commit details
-
Copy full SHA for b48be17 - Browse repository at this point
Copy the full SHA b48be17View commit details -
darwintrace: Drop injected env vars on SUID binaries
The loader will ignore DYLD_INSERT_LIBRARIES on SUID/SGID binaries so we may as well not set them when running such binaries. This could potentially be extended with checks for other privileged binaries where DYLD_INSERT_LIBRARIES will not work.
Configuration menu - View commit details
-
Copy full SHA for 99fda49 - Browse repository at this point
Copy the full SHA 99fda49View commit details -
pextlib1.0: Fix check for SUID/SGID binaries
The S_ISUID and S_ISGID bits are in the st_mode field of the stat struct, not in the st_flags field. This caused our check for SUID/SGID binaries to be incorrect, which caused us to copy SUID/SGID binaries into the sip-workaround directory, where they would then not run (correctly) because they did not have the permissions required.
Configuration menu - View commit details
-
Copy full SHA for 4f765b4 - Browse repository at this point
Copy the full SHA 4f765b4View commit details -
darwintrace: Support arbitrary path lengths
darwintrace.dylib did occasionally crash in __darwintrace_is_in_sandbox due to stack canary violations, because the reimplementation of realpath and splitting into path components assumed that paths will not be longer than MAXPATHLEN. In practice, this assumption was wrong, and many build systems will invoke file system operations with paths longer than that. Switch to dynamically allocated strings and arrays and resize the buffers as necessary. This also simplifies the code significantly and fixes a number of corner cases that were previously not handled correctly, such as walking up past the root directory or multiple slashes in a row. With these changes, quassel builds successfully in trace mode – without them, the build abort(3)s.
Configuration menu - View commit details
-
Copy full SHA for 3ee5289 - Browse repository at this point
Copy the full SHA 3ee5289View commit details -
darwintrace: Add automated tests
Some of the corner cases (such as very long paths, for example) are hard to test manually, or at least you don't know exactly whether a specific code path was covered just from installing a port. Improve this situation by adding automated tests to darwintrace.
Configuration menu - View commit details
-
Copy full SHA for f314dac - Browse repository at this point
Copy the full SHA f314dacView commit details -
pextlib1.0: Cache trace lookup results for speed
99% of all time spent in process_line() in tracelib.c happens in dep_check(). In dep_check(), time is spent as follows: - 15-20 % is spent determining the filesystem's case sensitivity - 50 % of the time is spent querying the port that provides the given path - 25 % of the time is used to translate the port ID into a port name - ~8 % are in the binary search of the port name in the list of dependencies In a test build of the yubico-pam port, 13884 iterations of dep_check() were run. Among those, there are only a little more than 3000 unique paths. This means that we can get a cache hit rate of about 78 % for a cache that stores previous lookup results. This affects the time spent in dep_check() during a test build of yubico-pam as follows (all numbers in return values of mach_absolute_time()): without cache: 2131768084 total 14188 calls ~ 150251 per call with cache: 1054866053 total 14188 calls ~ 74349 per call Caching thus reduces the duration by 50.5 %.
Configuration menu - View commit details
-
Copy full SHA for 20bb73b - Browse repository at this point
Copy the full SHA 20bb73bView commit details -
darwintrace: Resign with codesign when copying
macOS Ventura seems to have broken trace mode because it kills signed processes when preload libraries are present. Fix this by re-signing binaries when copying them. I tested this on x86_64 Ventura, where it works as expected. Closes: https://trac.macports.org/ticket/66358
Configuration menu - View commit details
-
Copy full SHA for e5c4d88 - Browse repository at this point
Copy the full SHA e5c4d88View commit details -
darwintrace: 0-initialize stat buffer
During debugging I have seen cases where stat(2) did leave the mtime fields uninitialized, so make sure the entire struct is zeroized before calling stat(2) so that there is at least a useful value rather than reading from unitinialized memory.
Configuration menu - View commit details
-
Copy full SHA for 55e2e78 - Browse repository at this point
Copy the full SHA 55e2e78View commit details -
darwintrace: Fix trace mode test
This test broke because the return code of /usr/bin/crontab changed when users do not have a crontab configured. Fix this by checking the output of the command if the command fails.
Configuration menu - View commit details
-
Copy full SHA for f915262 - Browse repository at this point
Copy the full SHA f915262View commit details -
darwintrace: Use env.c from FreeBSD
Since it becomes increasingly harder and harder to get an unsigned env binary that works as expected, include a stripped-down version of the FreeBSD env.c implementation for testing.
Configuration menu - View commit details
-
Copy full SHA for 5bb0efc - Browse repository at this point
Copy the full SHA 5bb0efcView commit details
Commits on Oct 1, 2023
-
darwintrace: Disable broken tests on arm64
Let's not break CI on arm64, even though this test failure points to an actual problem. See: https://trac.macports.org/ticket/66358#comment:39
Configuration menu - View commit details
-
Copy full SHA for 01b90c5 - Browse repository at this point
Copy the full SHA 01b90c5View commit details