sheagcraig / yo

Send Notification Center messages from the command line
Apache License 2.0
384 stars 44 forks source link

Issue: Application hangs when invoked in user space on some endpoints #53

Closed Oh4sh0 closed 3 years ago

Oh4sh0 commented 3 years ago

On a user's device, when the built application invoked (10.15.7+SecUpd2021-001), the application appears to hang. I can run it just fine from several devices. Haven't been able to debug what's consistent. I have noticed that most users reporting this behavior have an external dock/display.

Invoking the app is done via: /Library/Application\ Support/COName/Notifications/Notify.app/Contents/MacOS/Notify -t "test" -s "testdata"

Debugging has been a little difficult with ambiguous error messages. In his console I found: Unknown class '', using 'NSObject' instead. Encountered in Interface Builder at file path .

I don't know that that error is directly related to the problem. The LSExceptions error may be.

Some more from the log:

2021-02-08 13:14:16.463283-0600 0x2bdd1    Default     0x0                  45597  0    Notify: (AppKit) [com.apple.AppKit:Appearance] Current system appearance, (HLTB: 2), (SLS: 1)
2021-02-08 13:14:16.467602-0600 0x2bdd1    Default     0x0                  45597  0    Notify: (AppKit) [com.apple.AppKit:Appearance] Post-registration system appearance: (HLTB: 2)
2021-02-08 13:14:16.496651-0600 0x2bdd1    Fault       0xbe1b1              45597  14   Notify: (AppKit) [com.apple.runtime-issues:Nib Loading] Unknown class '<private>', using 'NSObject' instead. Encountered in Interface Builder file at path <private>.
2021-02-08 13:14:16.496651-0600 0x2bdd1    Activity    0xbe1b1              45597  0    Notify: (libsystem_trace.dylib) Activity for state dumps
2021-02-08 13:14:16.497836-0600 0x2bdd1    Default     0x0                  45597  0    Notify: (XCTTargetBootstrap) [com.apple.dt.xctest:Default] Registering for test daemon availability notify post.
2021-02-08 13:14:16.498046-0600 0x2bdd1    Default     0x0                  45597  0    Notify: (XCTTargetBootstrap) [com.apple.dt.xctest:Default] notify_get_state check indicated test daemon not ready.
2021-02-08 13:14:16.504525-0600 0x2bdd1    Default     0x0                  45597  0    Notify: (HIServices) [com.apple.processmanager:front-35286506] SignalReady: pid=45597 asn=0x0-0x80080
2021-02-08 13:14:16.505968-0600 0x2bdd1    Default     0x0                  45597  0    Notify: (LaunchServices) [com.apple.processmanager:front-35286506] SIGNAL: pid=45597 asn=0x0x-0x524416
2021-02-08 13:14:16.511070-0600 0x2bdd1    Activity    0xbe1b2              45597  0    Notify: (CoreFoundation) Loading Preferences From System CFPrefsD
2021-02-08 13:14:16.517272-0600 0x2bdd1    Activity    0xbe1b3              45597  0    Notify: (CoreFoundation) Loading Preferences From System CFPrefsD
2021-02-08 13:14:16.522236-0600 0x2bdd1    Default     0x0                  45597  0    Notify: (AppKit) [com.apple.AppKit:Appearance] NSApp cache appearance:
-NSRequiresAquaSystemAppearance: 0
-appearance: (null)
-effectiveAppearance: <NSCompositeAppearance: 0x7f9e5c50e4d0
 (
    "<NSDarkAquaAppearance: 0x7f9e5c50ea40>",
    "<NSSystemAppearance: 0x7f9e5c50ed90>"
)>
2021-02-08 13:14:16.536273-0600 0x2bdd1    Activity    0xbe1b4              45597  0    Notify: (SharedFileList) #SFLAPI LSSharedFileListCreate
2021-02-08 13:14:16.536342-0600 0x2be07    Activity    0xbe1b5              45597  0    Notify: (SharedFileList) #SFLAPI LSSharedFileListCopySnapshot
2021-02-08 13:14:16.536789-0600 0x2be10    Activity    0xbe1b6              45597  0    Notify: (SharedFileList) GenericList.fetchList
2021-02-08 13:14:26.503212-0600 0x2bdde    Default     0x0                  45597  2    Notify: (LaunchServices) **[com.apple.launchservices:default] LSExceptions shared instance invalidated for timeout.**
Oh4sh0 commented 3 years ago

I've figured this out, although I can't explain the why.

When installing this application, it was overwriting an existing terminal notifier application with the same name. On endpoints where this existing older install was present, despite the overwriting occurring successfully, the application would always hang when launched. No matter what. No useful logging would tell me why. Adding a "rm -rf" to the preinstall script to delete the existing application bundle resolved the issue entirely.