-
Notifications
You must be signed in to change notification settings - Fork 53
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
Exit code detection failing on iOS/tvOS 15+ #819
Comments
Seems like the issue is Xcode 13.2 rather than OSX 12.00. Also I found out, I might be able to use
|
Oh noez, the sentence "The exit status will be stored in data." actually only appears in FreeBSD man pages and not OSX man pages 😢 I have tested getting the PID (the line with // cc test.c -framework CoreFoundation -O
#include <CoreFoundation/CoreFoundation.h>
#include <unistd.h>
#include <sys/event.h>
// build: cc test.c -framework CoreFoundation -O
// run: ./a.out 57168
static void noteProcDeath(CFFileDescriptorRef fdref, CFOptionFlags callBackTypes, void *info) {
struct kevent kev;
int fd = CFFileDescriptorGetNativeDescriptor(fdref);
kevent(fd, NULL, 0, &kev, 1, NULL);
// take action on death of process here
printf("process with pid '%u' died with '%ld'\n", (unsigned int)kev.ident, kev.data);
CFFileDescriptorInvalidate(fdref);
CFRelease(fdref); // the CFFileDescriptorRef is no longer of any use in this example
}
// one argument, an integer pid to watch, required
int main(int argc, char *argv[]) {
if (argc < 2) exit(1);
int fd = kqueue();
struct kevent kev;
EV_SET(&kev, atoi(argv[1]), EVFILT_PROC, EV_ADD|EV_ENABLE, NOTE_EXIT, 0, NULL);
kevent(fd, &kev, 1, NULL, 0, NULL);
CFFileDescriptorRef fdref = CFFileDescriptorCreate(kCFAllocatorDefault, fd, true, noteProcDeath, NULL);
CFFileDescriptorEnableCallBacks(fdref, kCFFileDescriptorReadCallBack);
CFRunLoopSourceRef source = CFFileDescriptorCreateRunLoopSource(kCFAllocatorDefault, fdref, 0);
CFRunLoopAddSource(CFRunLoopGetMain(), source, kCFRunLoopDefaultMode);
CFRelease(source);
// run the run loop for 20 seconds
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 200.0, false);
return 0;
} It is always This also supports that: https://lists.apple.com/archives/Darwin-dev/2009/Aug/msg00210.html |
This is not a problem of Xcode, this is a problem of iOS 15. The system log of the simulator contains a very limited amount of logs compared to 13.5 for example (both running on Xcode 13.1). |
I was able to get more logs via:
The exit code is there, so is the stdout. So we should also be able to fix #694 More info: |
Solution for Simulators is here: https://github.com/premun/xharness/tree/prvysoky/simulator-exit-code MacCatalyst is left |
With the latest move of
dotnet/runtime
onto OSX 12.00,apple run
andapple just-run
commands started failing in 100% of cases:The text was updated successfully, but these errors were encountered: