MathInspector / MathInspector

A visual programing environment for scientific computing with python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash triggers logout on program startup (macOS Mojave)

Pugio opened this issue · comments

commented

macOS 10.14.6

The program seems to try to become full screen (I see a pure black screen), and then I am sent back to the macOS login screen.
I do not see any of the program's UI before the crash occurs.

Happy to help debug in some way...

Haven't seen that one before. Could you try the following to try debugging the issue:

Navigate the the mathinspector app in finder and then right click and choose "show package contents", then navigate to the directory ./Contents/MacOS/ then find the file mathinspector and double click on it. This should run a command prompt which will capture any error messages before launching the app. Please let me know if you are able to see any errors, and in the mean time I will try and figure out whats going on. My first guess is pyinstaller is causing a problem because I built the app on a higher version of MacOS.

commented

I tried doing that from the command line, but the log-out kept happening before I could see/capture the output.

Your method at least kept the Terminal buffer visible, so here's what I got:

 /Applications/mathinspector.app/Contents/MacOS/mathinspector ; exit;
2021-02----- mathinspector[57287:5652648] NSDocumentController Info.plist warning: The values of CFBundleTypeRole entries must be 'Editor', 'Viewer', 'None', or 'Shell'.
  [Restored

I tried adding the indicated key (<key>CFBundleTypeRole</key><string>Editor</string>) to theInfo.plist, and while that cleared the warning message, it didn't alter the crash behavior.

I am looking into what could cause an issue like this, and found this thread: pyinstaller/pyinstaller#4334

It looks like the combination of MacOS 10.14.6 and tkinter 8.6 with python version 3.7.6 is somehow causing this problem.
Do you have anaconda installed? Some people are saying that is the root cause, and I am wondering if that might be what's happening in this case.

It's also possible building the app with python version 3.8+ will solve the problem, this is going to be what I try next to resolve this issue

I tried to update the python version on the mac build from 3.7.6 to both 3.8.6 or 3.9.1, but this ended up causing a bunch of other bugs that I am currently working on. I am hopeful that once I'm able to use the latest python version it will solve this problem.

commented

I don't have Anaconda installed. I use Python 3.8.5 from pyenv, but I don't think it should conflict with use of the system python. Looking forward to those updates!

commented

I'm not sure if this is related, but I also found the following lines in my system.log:

--- com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.pid.mathinspector.90509): Could not resolve origin of domain. XPC services in this domain's bundle will not be bootstrapped: error = 107: Malformed bundle, taint = missing executable
--- mathinspector[90509]: assertion failed: 18G103: libxpc.dylib + 40590 [7DEE2300-6D8E-3C00-9C63-E3E80D56B0C4]: 0x20

Oh nice find! Hmmmmmmm. I think the first line might indicate there is a typo in info.plist. Then the second line where it says libxpc.dylib also might indicate something. I have been doing a deep dive into dylib while trying to get the mac build onto python 3.9.1, and it's kind of embarrassing, but I am not sure what dylib is supposed to do!

One thing that would be very helpful for debugging is if you could try installing math inspector from the source code and running it from the command line with python mathinspector. I am very curious to know if it runs or not, if you see any other error messages, or if doing this provides other useful clues about how to fix it.

We are going to get this problem resolved, promise!

commented

I tried it from source and realized that this a much more general bug: tkinter on Mojave causes the same exact crash if I even do: python -m tkinter. At least now I can reproduce it, independent of the app, and maybe find the right combination of python versions and library installs that will get this to work.

Nice! At least we are making a little progress. I have shared some thoughts below in the hope they will be useful for you while debugging. I have been down this rabbit hole a couple of times already, so please continue to post your progress in this thread, as I have seen many of the things that can go wrong when something like this happens.

Do you have homebrew python installed? I had to remove homebrew python from my system and install python from the website instead to get everything to be styled properly.

I think it's possible there is an underlying issue related to tcl/tk, and the behavior you are seeing is for 2 different problems. The built app comes with it's own tcl/tk files, but when you build from source it will use the tcl/tk on your system.

MacOS comes with its own version of tcl/tk, but there are some known problems, and these were resolved by including tcl/tk in python when you download python from the python.org website.

In principle, the built app should have all the tcl/tk files, and the app should be using the tcl/tk it comes bundled with instead of the system version. However, during alpha testing, there was a similar bug to this, which was resolved by including more tcl/tk files in the built app.

There is a new version of math inspector (0.9.3) which I believe will very likely resolve this issue. If you have a chance, please let me know if the new version fixes the issue. Thanks!

You can find the binary on GitHub here, it's also up on the mathinspector website
https://github.com/MathInspector/MathInspector/releases/tag/v0.9.3

I am closing this issue as I believe it is highly likely this crash has been resolved in the latest version. Please let me know if this is not the case and feel free to reopen this issue.