segmentator icon indicating copy to clipboard operation
segmentator copied to clipboard

calling segmentator causes system crash (mac-os)

Open katjaq opened this issue 4 years ago • 14 comments

hello dear Faruk,

after lots of enjoyable work using your awesome segmentator, it now crashes my entire system when calling it. (and I see the login screen and my computer is completely restarted, all applications had been shot down) Have you come across this? It may have to do with a mac update? It happened using my old segmentator installation, and it also happens now that I downloaded and installed segmentator again. This is a part of the console log:

Oct 21 01:52:05 aumburgPr0-6 AGMService[18897]: ProcessPath : /anaconda3/bin/python3.6
Oct 21 01:52:06 aumburgPr0-6 com.apple.xpc.launchd[1] (com.apple.WindowServer[16640]): Service exited due to SIGSEGV | sent by exc handler[16640]
Oct 21 01:52:06 aumburgPr0-6 com.apple.xpc.launchd[1] (com.apple.ViewBridgeAuxiliary[22273]): Service exited with abnormal code: 2
Oct 21 01:52:06 aumburgPr0-6 sessionlogoutd[22274]: DEAD_PROCESS: 16639 console

I can send you the complete log if more info is needed. Any idea?

Many many thanks for your awesome work! best katja

katjaq avatar Oct 21 '19 16:10 katjaq

Thanks for the report @katjaq . Sounds mysterious.

@ingo-m & @MSchnei did you encounter this after the mac update?

ofgulban avatar Oct 22 '19 08:10 ofgulban

@katjaq could you post the complete log?

ofgulban avatar Oct 22 '19 09:10 ofgulban

Dear @katjaq ,

I think the issue that you are having is related to the matploblib backend. Which was TkAgg by default. After reading some threads, I suspect that some Tkagg - Catalina interaction is somehow causing the crash (not Segmentator by itself).

Since I do not have access to a mac with catalina update, I do not know for sure whether your issue will be solved but try the following:

  1. Clone segmentator from devel branch and install it.
  2. When you are calling segmentator in the command line, add --matplotlib_backend qt5agg as an additional flag

There are other backends that you can try (see here). I think that either qt5agg orqt4agg will solve your issue.

Please let me know whether this works or not. Thanks a lot for your time and patience :).

ofgulban avatar Oct 24 '19 09:10 ofgulban

hello dear @ofgulban , thanks so much for your replies. I only have system log, not a specific error log from segmentator though. When I call it, it stops right there and then everything crashes before it ever gets to print anything to the console. I will definitely try your suggestion and hope it runs :) Thanks !! I am still on Mojave... if it fails, I will update the Mac and try again ^^ and report back! :) Many thanks! very best katja

katjaq avatar Oct 24 '19 20:10 katjaq

hello! Thanks for suggesting devel branch – I tried, and it crashes everything :.( BUT: it crashes after printing a few lines on console :D we are getting one step further here :D

I am on macOS Mojave v 10.14.6. I did the setup on devel branch using the 2 setup steps you specify in your ReadMe. They both look happy, no errors, first (requirments) tells me that everything is already satisfied, second one also no error message. Then launching segmentator with a nifti makes my computer crash. I see a few lines of output (normal stuff, no error messages); and then "building GUI" – and after that my system crashes. Any further ideas? I am on devel, not devel-entropy. Is that the good one to test my error?

Thank you so much for help. Stay safe!

katjaq avatar Mar 13 '20 16:03 katjaq

Hi Katja, thanks for the report :) . Yes you tried the right branch. Can you send me the exact command you have used that causes the crash?

ofgulban avatar Mar 14 '20 14:03 ofgulban

Sounds like a Matplotlib backend related problem. One thing comes to my mind is to try different matplotlib backend options with the following segmentator flag:

--matplotlib_backend tkagg
                        Change in case of issues during startup or visual
                        glitches. Some options are: wxagg, qt4agg, qt5agg,
                        agg, cairo.

ofgulban avatar Mar 14 '20 14:03 ofgulban

@katjaq just a reminder in case if github notifications did not work :) :arrow_up:

ofgulban avatar Mar 23 '20 16:03 ofgulban

Hello! Thank you, dear @ofgulban for reaching out to me again. As it crashes my entire system, it is not very often a convenient moment to test that – and get kicked out from anything else you are running :) I am sorry , that makes it a bit scattered that I get back to you only every once in a while :/ I haven't yet tried the options you proposed – just because I couldn't afford it yet ;) But I very much appreciate your support. I hope it is okay that I have long pauses in between my reports.. Will test above options asap. thanks again. <3

katjaq avatar Mar 23 '20 17:03 katjaq

Hey @katjaq no worries I understand :) Test it whenever you can, no rush.

I suspect that this behavior comes from the matplotlib backend, so I wonder: Can you plot figures as usual using Matplotlib? This might give me some clue.

ofgulban avatar Mar 24 '20 10:03 ofgulban

Hi @ofgulban – I'm having this same issue (also on 10.14.6 Mojave), and using the --matplotlib_backend flag on the devel branch has the same result.

As far as I know, matplotlib otherwise works fine on this machine.

sitek avatar Jul 09 '20 23:07 sitek

@sitek thanks for the report. Can you try running segmentator with --matplotlib_backend Qt5Agg?

ofgulban avatar Jul 10 '20 08:07 ofgulban

Ah! once I installed PyQt5, --matplotlib_backend Qt5Agg seems to work.

sitek avatar Jul 10 '20 14:07 sitek

Ok good to know! I will put something to switch to that when the OS is mac, and/or give some warnings. Also see this page for the additional keyboard shortcuts for the left panel control.

@katjaq see the previous comment, should work for you too.

ofgulban avatar Jul 10 '20 17:07 ofgulban