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

progresswatcher crashes with NSRunLoop error #233

Open
MagerValp opened this issue Jun 14, 2019 · 3 comments
Open

progresswatcher crashes with NSRunLoop error #233

MagerValp opened this issue Jun 14, 2019 · 3 comments
Assignees
Labels

Comments

@MagerValp
Copy link
Owner

MagerValp commented Jun 14, 2019

Originally posted by @rickheil in #232 (comment)

When running with sudo and passing -r:

2019-06-04 17:28:32.126 AutoDMG[12957:144790] TMPDIR is not set
Running as root, using /var/root/Library/Application Support/AutoDMG
AutoDMG v1.9 build 578
Mac OS X 10.15 19A471t
CPython 2.7.10 (GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.21.8))
PyObjC 2.5.1
Setting source path to '/Volumes/Install macOS 10.15 Beta/Install macOS 10.15 Beta.app'
Setting output path to '/Users/onepath/Desktop/test.apfs'
Setting volume name to 'Testing'
Setting volume size to '100'
Installer: /Volumes/Install macOS 10.15 Beta/Install macOS 10.15 Beta.app
Examining source…
Found source: Mac OS X 10.15 19A471t
Accepted source /Volumes/Install macOS 10.15 Beta/Install macOS 10.15 Beta.app: Mac OS X 10.15 19A471t
Found installer: Mac OS X 10.15 19A471t
Output Path: /Users/onepath/Desktop/test.apfs
Volume Name: Testing
Unrecognized filesystem setting '(null)'
Starting build
Using installer: Mac OS X 10.15 19A471t
Using output path: /Users/onepath/Desktop/test.apfs
TMPDIR is set to: (null)
Task taskPrepare with 1 phases:
    Phase 'Preparing' with weight 34.0
Task taskInstall with 4 phases:
    Phase 'Starting install' with weight 21.0
    Phase 'Creating disk image' with weight 21.0
    Phase 'Installing OS' with weight 4096.0
    Phase 'Converting disk image' with weight 313.0
Task taskFinalize with 4 phases:
    Phase 'Scanning disk image' with weight 2.0
    Phase 'Scanning disk image' with weight 1.0
    Phase 'Scanning disk image' with weight 150.0
    Phase 'Scanning disk image' with weight 17.0
Task taskFinish with 1 phases:
    Phase 'Finishing' with weight 1.0
Starting task Prepare with 1 phases
Starting phase: Preparing
phase: Preparing
progress: 0.0%
1 packages to install:
    /Volumes/Install macOS 10.15 Beta/Install macOS 10.15 Beta.app/Contents/SharedSupport/InstallInfo.plist requires 16.2 GB
Workflow requires a 16.2 GB disk image
Using a 100 GB disk image
Starting task Install with 4 phases
Phase Preparing with weight 35651584 finished after 0.007 seconds
Starting phase: Starting install
phase: Starting install
progress: 0.7%
Install task running
Launching install with arguments:
    '/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources/progresswatcher.py'
    '--cd'
    '/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources'
    '--socket'
    '/tmp/se.gu.it.IEDSocketListener.259de147ae1af35d'
    'installesdtodmg'
    '--user'
    '0'
    '--group'
    '0'
    '--fstype'
    'apfs'
    '--output'
    '/Users/onepath/Desktop/test.apfs'
    '--volume-name'
    'Testing'
    '--size'
    '100'
    '--template'
    '/tmp/tmpJcpvJy/AutoDMG-20190604.adtmpl'
    '/Volumes/Install macOS 10.15 Beta/Install macOS 10.15 Beta.app/Contents/SharedSupport/InstallInfo.plist'
Install task launched
2019-06-04 17:28:33.160 Python[12973:144959] progresswatcher launching
2019-06-04 17:28:33.160 Python[12973:144959] progresswatcher arguments: (
    "/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources/progresswatcher.py",
    "--cd",
    "/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources",
    "--socket",
    "/tmp/se.gu.it.IEDSocketListener.259de147ae1af35d",
    installesdtodmg,
    "--user",
    0,
    "--group",
    0,
    "--fstype",
    apfs,
    "--output",
    "/Users/onepath/Desktop/test.apfs",
    "--volume-name",
    Testing,
    "--size",
    100,
    "--template",
    "/tmp/tmpJcpvJy/AutoDMG-20190604.adtmpl",
    "/Volumes/Install macOS 10.15 Beta/Install macOS 10.15 Beta.app/Contents/SharedSupport/InstallInfo.plist"
)
2019-06-04 17:28:33.160 Python[12973:144959] progresswatcher uid: 0, euid: 0
2019-06-04 17:28:33.164 Python[12973:144959] progresswatcher language: en
2019-06-04 17:28:33.167 Python[12973:144959] progresswatcher uid: 0, euid: 0
2019-06-04 17:28:33.170 Python[12973:144959] progresswatcher died with an uncaught exception: Traceback (most recent call last):
  File "/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources/progresswatcher.py", line 363, in main
    args.func(args)
  File "/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources/progresswatcher.py", line 324, in installesdtodmg
    run(pwargs, args.socket, "ied")
  File "/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources/progresswatcher.py", line 300, in run
    pw.watchTask_socket_mode_(args, sockPath, mode)
  File "/Volumes/AutoDMG-1.9/AutoDMG.app/Contents/Resources/progresswatcher.py", line 76, in watchTask_socket_mode_
    task.launch()
ValueError: NSInvalidArgumentException - *** -scheduleInRunLoop:forMode: cannot be sent to an abstract object of class NSMachPort: Create a concrete instance!
2019-06-04 17:28:33.170 Python[12973:144959] PyObjC: Exception during dealloc of proxy: *** -removeFromRunLoop:forMode: cannot be sent to an abstract object of class NSMachPort: Create a concrete instance!
Install task finished with exit status 70
Workflow failed: Build failed (Install task failed with status 70)
Build failed: Build failed
    Install task failed with status 70
@MagerValp MagerValp self-assigned this Jun 14, 2019
@MagerValp MagerValp added the bug label Jun 14, 2019
@MagerValp
Copy link
Owner Author

This works:

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {

        NSTask *task = [[NSTask alloc] init];
        task.executableURL = [NSURL fileURLWithPath:@"/usr/bin/true"];
        [task launch];
        
        NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
        for (;;) {
            [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
        }
    }
    return 0;
}

This crashes:

#!/usr/bin/python

from Foundation import *

task = NSTask.alloc().init()

task.setExecutableURL_(NSURL.fileURLWithPath_("/usr/bin/true"))
task.launch()

runLoop = NSRunLoop.currentRunLoop()
while True:
    runLoop.runMode_beforeDate_(NSDefaultRunLoopMode, NSDate.distantFuture())

@cybertunnel
Copy link

Did you implement this fix into any code yet? I am getting this on 10.15.0 b3

@MagerValp
Copy link
Owner Author

No, I don't know how to fix the crash yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants