Problem installing FreeSurfer in Mac

Hi everyone,

I’m trying to enable FreeSurfer in my laptop (Mac / Big Sur), but I’m facing a strange error.

I downloaded the installation package and installed without any problem, and also added the lines in terminal for:

  • exporting the FREESURFER_HOME address, SUBJECT_DIR, and
  • doing the environment setup (SetUpFreeSurfer.sh).

Still, when I execute “freeview” (either in the terminal or in Finder), the application doesn’t run. If I run it in the terminal, I get the following error:

“lline 2: 667 Segmentation fault: 11”

Has anyone experienced something similar?

Many thanks!

Fernando

Are you on Intel or M1?

Thanks! My laptop has an Intel.

Is the error message you included the full traceback?

The full terminal tracebar is:

/Applications/freesurfer/7.2.0/bin/freeview: line 2: 2150 Segmentation fault: 11 $FREESURFER_HOME/Freeview.app/Contents/MacOS/freeview “$@”

(Btw, I’m pretty convinced the $FREESURFER_HOME is pointing towards the right folder)

Thanks!

just to be sure, in terminal, echo $FREESURFER_HOME should return /Applications/freesurfer/7.2.0/. Is that the case for you?

I’m super confused now…

I usually get
/Applications/freesurfer/7.2.0
without the last “/”.

After seeing you email, I changed FREESURFER_HOME (with an export command) to includ the last “/”. And somehow freeview ran.
But then, I closed and re-started the Terminal, and now is not running again,
even after following (to the best of my memory) these same steps that seem to made it run before.

Any ideas of why this could have been?

Is the error message the same now?

Yes, always the same error message.

Sounds like your shell is not configured. You may have been using bash before, and the default is now zsh. You will need to either switch your default shell (User option) or the Terminal app’s default shell or update the configuration file that gets loaded for the default shell (for instance .zshrc).

I am having the exact same problem (segmentation fault) Did this get solved?
if so how?
thanks
Marie

OK folks…I solved the issue…it was a simple memory problem.
thank you anyway!
Marie

Hi Marie,
How did you solved the problem? I haven’t really found a solution…
Thanks!

sorry to get your hopes up, actually ,it worked only one time, after I did some "clearing of things on my desktop: then when I open freeview again the same error (segentation fault. error). I did not make any changes in the script ,so I am mystified about what to do next.

Any update on this issue?? I had some problems opening Freeview yesterday but after updating Freeview.app (UpdateFreeview - Free Surfer Wiki) I was able to open my files properly. Somehow it is no longer opening today, even after re-updating Freeview.app… I’m confused… Here’s the error message I get:

/Applications/freesurfer/7.2.0/bin/freeview: line 2: 6263 Segmentation fault: 11 FREESURFER_HOME/Freeview.app/Contents/MacOS/freeview "@"

Many thanks!

You might want to be sure to configure the shell environment with the scripts Freesurfer provides. For example, if you are using bash or zsh, you can use

source /Applications/freesurfer/7.2.0/sources.sh

for tcsh, use
source /Applications/freesurfer/7.2.0/sources.csh

You can replace the “/Applications/freesurfer/7.2.0” with the variable $FREESURFER_HOME

This is going to sound absurd, but it appears to be related to the monitor that is in focus. I tested this after reading comments about resolution here -Re: [Freesurfer] Mac install of Freesurfer 7.2.0 - Freeview quitsunexpectedly

If the terminal from which I am trying to launch freeview is on an external monitor, I get an immediate segfault, same as this first post. If I drag the terminal to my MacBook display and launch freeview it works. Dragging the terminal back to an external monitor after this successful launch and trying again gets me the same segfault. So - if you run into this issue, and it isn’t a license problem, try moving the terminal window over to the inbuilt display.

Edit - This is an M1 mac, with Monterey 12.3.1.

Good news - after launching freeview, you can move it to you (likely larger) external monitor and there are no complaints (as long as you don’t close it).

3 Likes

We’ve seen similar issues in the past with multiple monitors and X11. I haven’t seen it on ARM systems. Also there can be problems related to the number of colors and refresh rate.

Wow… thanks a lot @dowdlelt for sharing that! I would have look forever for that! But sure enough, I just moved the terminal from my external screen to my MacBook pro screen and :boom:! Problem solved!

1 Like