rbeckman-nextgen / test-mc6

0 stars 0 forks source link

MC Launcher crashes if trust signature dialog is not clicked fast enough #4219

Closed rbeckman-nextgen closed 4 years ago

rbeckman-nextgen commented 4 years ago

Repro steps:

  1. Have MC running with a third-party extension. The extension has a valid code signing certificate.
  2. The launcher presents a dialog to trust this certificate
  3. If "Yes" is not clicked fast enough the Launcher crashes

The Launcher logs do not show any information prior to the crash.

If "Yes" is clicked fast enough, the crash does not occur and MC launches normally.

Imported Issue. Original Details: Jira Issue Key: MIRTH-4367 Reporter: jbartels Created: 2019-01-17T15:15:12.000-0800

rbeckman-nextgen commented 4 years ago

I was able to followup with some debugging information requested in Slack and for a related report from the forums:

1) The code signing certificate used to sign this code does have the code signing extension. Verified by reviewing the public cert, it has the extension.

2) I used jarsigner to verify the JAR independently of the launcher. I ran jarsigner -verify -strict -certs -verbose /Applications/Mirth Connect Administrator Launcher.app/Contents/java/app/cache/3.5.1/extensions/the-jar-that-failed.jar . jarsigner accepts this as valid.

Regardless of whether or not the JAR is signed, not clicking the button fast enough should still not cause a crash.

Is there any additional debugging information I can provide?

Imported Comment. Original Details: Author: jbartels Created: 2019-02-01T12:01:50.000-0800

rbeckman-nextgen commented 4 years ago

This bug is reproducible using these steps:

0) Be using a Mac with OSX 10.14. I am using 10.14.3 1) Have an extension which causes the certificate accept dialog to be presented to an MC instance. A self-signed certificate is sufficient. If needed I can provide a simple extension which induces this. 2) Navigate to the application directory, typically cd /Applications/Mirth\ Connect\ Administrator\ Launcher.app/Contents/java/app/ 3) Run the Launcher directly with java -jar mirth-client-launcher.jar 4) Launch the MC instance from step 1. 5) Observe the certificate verification dialog appearing. Navigate to some other app. 6) The console logs this error: 2019-03-11 09:58:58.738 java[31545:9711907] unrecognized type is 4294967295 2019-03-11 09:58:58.738 java[31545:9711907] *** Assertion failure in -[NSEvent _initWithCGEvent:eventRef:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.20.108/AppKit.subproj/NSEvent.m:1969 2019-03-11 09:58:58.760 java[31545:9711907] Apple AWT Internal Exception: Invalid parameter not satisfying: _type > 0 && _type <= kCGSLastEventType 2019-03-11 09:58:58.760 java[31545:9711907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: _type > 0 && _type <= kCGSLastEventType' *** First throw call stack: ( 0 CoreFoundation 0x00007fff3db65ded __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff69c2d720 objc_exception_throw + 48 2 CoreFoundation 0x00007fff3db80a4a +[NSException raise:format:arguments:] + 98 3 Foundation 0x00007fff3ff24e0d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194 4 AppKit 0x00007fff3b0094d5 -[NSEvent _initWithCGEvent:eventRef:] + 3272 5 AppKit 0x00007fff3b35cb50 +[NSEvent eventWithCGEvent:] + 120 6 libglass.dylib 0x00000001159bb6fb listenTouchEvents + 59 7 SkyLight 0x00007fff63cd6bc2 _ZL19processEventTapDataPvjjjPhj + 148 8 SkyLight 0x00007fff63bd4b44 _XPostEventTapData + 278 9 SkyLight 0x00007fff63cd6ad0 _ZL22eventTapMessageHandlerP12__CFMachPortPvlS1_ + 132 10 CoreFoundation 0x00007fff3dac69eb __CFMachPortPerform + 246 11 CoreFoundation 0x00007fff3dac68e9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41 12 CoreFoundation 0x00007fff3dac6847 __CFRunLoopDoSource1 + 527 13 CoreFoundation 0x00007fff3daae8c5 __CFRunLoopRun + 2574 14 CoreFoundation 0x00007fff3daadc64 CFRunLoopRunSpecific + 463 15 Foundation 0x00007fff3fe144aa -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280 16 libglass.dylib 0x00000001159a9448 +[GlassApplication enterNestedEventLoopWithEnv:] + 136 17 libglass.dylib 0x00000001159a9eaa Java_com_sun_glass_ui_mac_MacApplication__1enterNestedEventLoopImpl + 74 18 ??? 0x000000011801e667 0x0 + 4697744999 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6

This exception seems to relate to this bug - https://bugs.openjdk.java.net/browse/JDK-8211304 That bug has been helpfully translated into plain language at - https://stackoverflow.com/questions/52323438/assertion-failure-in-nsevent

Looks like a Java FX issue. If I'm reading this right upgrading JavaFX is sufficient. Since they backported fixes to JDK 8 it should maintain compatibility with any reasonable choice of JDK within the launcher itself.

Note that in my case there is a properly signed code-signing certificate available. That the dialog appears for such a cert is odd but I think it is a secondary issue.

Imported Comment. Original Details: Author: jbartels Created: 2019-03-11T07:17:45.000-0700

rbeckman-nextgen commented 4 years ago

This bug can also be reproduced by:

  1. Have an MC instance saved in the Launcher which requires a VPN to connect to
  2. Launch that MC instance WITHOUT connecting to the VPN
  3. A dialog will appear showing a stack trace saying it could not connect
  4. The Launcher crashes

These reproduction steps are likely faster and easier to reproduce than certificate warnings. They are a useful test if the underlying bug is purely related to dialog boxes and not specific to the certificate warning.

Imported Comment. Original Details: Author: jbartels Created: 2019-04-01T12:03:00.000-0700