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

[osx] Crash Report #110

Closed
josegomez opened this issue Apr 15, 2020 · 20 comments · Fixed by #147
Closed

[osx] Crash Report #110

josegomez opened this issue Apr 15, 2020 · 20 comments · Fixed by #147
Labels
bug Something isn't working

Comments

@josegomez
Copy link
Collaborator

See: https://sqrl.grc.com/threads/mac-osx-testing-feedback.1111/post-9365
I'm now getting a crash whenever I press Export ID.

Process:               SQRLDotNetClientUI [25169]
Path:                  /Applications/SQRL.app/Contents/MacOS/SQRLDotNetClientUI
Identifier:            com.sqrldev.sqrldotnetclient
Version:               0.48.2 (0.48.2)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           SQRLDotNetClientUI [25169]
User ID:               501

Date/Time:             2020-04-15 15:33:41.950 +0300
OS Version:            Mac OS X 10.15.4 (19E287)
Report Version:        12
Bridge OS Version:     4.4 (17P4281)
Anonymous UUID:        39786309-6B18-62A9-8610-C63291AC7DFF

Sleep/Wake UUID:       5A2FF665-FEEE-445C-B531-D31397EDDEAF

Time Awake Since Boot: 500000 seconds
Time Since Wake:       22000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
@josegomez josegomez added the bug Something isn't working label Apr 15, 2020
@alexhauser
Copy link
Member

Can you reproduce this in your virtual environment, @josegomez?

@josegomez
Copy link
Collaborator Author

@alexhauser trying now.

@josegomez
Copy link
Collaborator Author

Log from Post.

2020-04-16 12:11:54.553 +03:00 [INF] New app instance is being launched on Darwin 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar  4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64
2020-04-16 12:11:54.708 +03:00 [INF] IPC server starts listening...
2020-04-16 12:11:55.206 +03:00 [INF] App initialization completed!
2020-04-16 12:11:55.303 +03:00 [INF] Initialializing Apple Delegate
2020-04-16 12:11:55.640 +03:00 [INF] Initializing Mac App Delegate
2020-04-16 12:11:55.781 +03:00 [INF] DB Directory: /Applications/SQRL.app/Contents/MacOS
2020-04-16 12:11:56.540 +03:00 [INF] IdentityManager initialized.
2020-04-16 12:11:56.542 +03:00 [INF] Instanciating System Event Notifier
2020-04-16 12:11:56.548 +03:00 [INF] System Event Notifier was Innitialized Successfully
2020-04-16 12:11:56.549 +03:00 [INF] SystemEventNotifier polling task started
2020-04-16 12:11:56.550 +03:00 [INF] QuickPass system event handlers initialized.
2020-04-16 12:11:56.550 +03:00 [INF] QuickPassManager initialized.

@josegomez
Copy link
Collaborator Author

No I cannot @alexhauser but I bet is the QR Code generation bit I've seen a similar issue before if they didn't have the libgdiplus
Let me see if I can have him double check that.

@alexhauser
Copy link
Member

If it really is due to a missing libgdiplus, we should definitely try to handle this more gracefully by trying to decect that it is missing and give a useful error message.

@josegomez
Copy link
Collaborator Author

yeah hard to tell I'm having him re-install it, I also think we need to find a better QR code generator. Are you using that same one for the PDF?
When I run it on a Mac on my VM it looks like this
image

Now I think that's an artifact of the VM itself? But I'm not 100% sure. Looks fine in the PDF though

@josegomez
Copy link
Collaborator Author

Yeah I just double checked you are using the same library so it's an artifact of the VM as I expected. Good, let's see if the gdiplus fixes his issue if it does we'll try to handle.
One mitigation would be to only show the QR on button press instead of automatically... that way there are other export options if the QR isn't available.

@alexhauser
Copy link
Member

@josegomez, please try running the latest version in OSX. I made some changes in the export screen meanwhile, and also changed the qrcode generation code a little, since we were feeding it the whole identity instead of only block2+3. The qrcode was massively crowded before, and should be much cleaner in the latest version. Please check.

@josegomez
Copy link
Collaborator Author

Its a little better, still messed up but I'm confident (ish) its the VM. We'll need someone with a real Mac to verify hopefully if Brian can get past the crash he can
image

Save as PDF does render correctly
image

@alexhauser
Copy link
Member

Allright, thanks for checking it out @josegomez, let's wait and see what Brian finds.

@josegomez
Copy link
Collaborator Author

@alexhauser confirmed a libgidplus issu fixed.
Not sure how we can check that it is there, I'm guessing we can try to invoke a gdiplus related task Image in a try catch?

@josegomez
Copy link
Collaborator Author

image
In the actual mac also looks bad... we'll have to address find a different library or something.

@alexhauser
Copy link
Member

@alexhauser confirmed a libgidplus issue fixed.
Not sure how we can check that it is there, I'm guessing we can try to invoke a gdiplus related task Image in a try catch?

I'm not sure if a try/catch will even catch a SIGABRT.
Maybe something useful can be found here: dotnet/runtime#29625
I don't know if any of this works on the Mac, I guess you'll have to try that, @josegomez.

@dxcSithLord
Copy link

I may have access to a "real" Mac and when I have been through some testing on Linux, I will try it on a Macbook - SithMagic

@alexhauser
Copy link
Member

That's great, thanks for all your efforts @dxcSithLord!

@alexhauser
Copy link
Member

@josegomez, I created a virtual macOS environment to check out how we can detect a missing libgdiplus and handle it gracefully.

However, when cloning and running the latest master build on macOS Catalina, I get this before even getting to the libgdiplus related error:

Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: Could not find a valid superclass for type _NSLocalNotificationCenter. Did you forget to register the bindings at MonoMac.ObjCRuntime.Class.Register() or call NSApplication.Init()?
   at MonoMac.ObjCRuntime.Class.Lookup(IntPtr klass, Boolean throw_on_error)
   at MonoMac.ObjCRuntime.Class.Lookup(IntPtr klass)
   at MonoMac.ObjCRuntime.Runtime.GetNSObject(IntPtr ptr)
   at MonoMac.Foundation.NSDistributedNotificationCenter.get_DefaultCenter()
   at SQRLDotNetClientUI.Platform.OSX.SystemEventNotifier..ctor(Int32 maxIdleSeconds) in /Users/madmax/Documents/Source/SQRLDotNetClient/SQRLDotNetClientUI/Platform/OSX/SystemEventNotifier.cs:line 65
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at SQRLDotNetClientUI.Models.QuickPassManager..ctor() in /Users/madmax/Documents/Source/SQRLDotNetClient/SQRLDotNetClientUI/Models/QuickPassManager.cs:line 80
   at SQRLDotNetClientUI.Models.QuickPassManager.get_Instance() in /Users/madmax/Documents/Source/SQRLDotNetClient/SQRLDotNetClientUI/Models/QuickPassManager.cs:line 48
   at SQRLDotNetClientUI.App..ctor() in /Users/madmax/Documents/Source/SQRLDotNetClient/SQRLDotNetClientUI/App.xaml.cs:line 24
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance[T]()
   at Avalonia.Controls.AppBuilderBase`1.<>c__45`1.<Configure>b__45_0()
   at Avalonia.Controls.AppBuilderBase`1.Setup()
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at SQRLDotNetClientUI.Program.Main(String[] args) in /Users/madmax/Documents/Source/SQRLDotNetClient/SQRLDotNetClientUI/Program.cs:line 78

Please not that I have intentionally NEITHER installed homebrew nor libgdiplus.
But this seems to be a MonoMac related issue. Can you make any sense of this?

@alexhauser
Copy link
Member

Nevermind @josegomez, I found and fixed the problem.

The culprit was QuickPassManager which was instantiated before a call to NSApplication.Init(). Posting a PR for the fix asap.

@josegomez
Copy link
Collaborator Author

haha yeah that bit me before, remember I mentioned having a specific sequence of stuff on the mac? It's picky picky!

@alexhauser
Copy link
Member

Yes, I do remember @josegomez!

But it's fixed already and the good news is that indeed we can handle the libgdiplus crash in a try/catch.

@josegomez
Copy link
Collaborator Author

beautiful! @alexhauser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants