Geoviewer tab - Segmentation fault still occuring

Hello FLUKA experts,

I recently installed FLUKA and Flair on my personal machine (macOS Mojave10.14.5), in preperation for the upcoming training course through CERN. I am having a similar issue as others in the forum have had. When I click the ‘Geometry’ tab or try to open a flair project file, flair crashes and the following message appears:

/Users/J/Desktop/FLUKA/flair: line 14: 72710 Segmentation fault: 11 = ${PYTHON} -O -W ignore ${DIR}/flair.py "$@"

I also get a pop-up window saying “Python quit unexpectedly”

I have tried replacing the ‘d3layer.cc’ file as reccomended in a similar thread as well as downgrading xorg-libxcb and xorg-xcb-proto from verion 1.14 to 1.13 as reccommended in the ‘Known warnings and errors’ section of the install guide.

Finally, for completeness I should mention when I launch flair I get the following error:

w> Warning: PIL.Image and PIL.ImageTk not found

Any advice or assistance would be very much appreciated.

Thank you!
-Jason

Hi @Jason_O,

the error due to the xcb has been fixed in the distributed geoviewer version (3.1-2). That fix is now outdated.

Concerning your last error, you need to install the py3*-Pillow port.
Please give a look at section Optionally, but strongly recommended in the Mac OSX instruction in the Flair download page.

Please let us know if you need further assistance

Hi @luillo

I believe I already installed py38-Pillow port but tried again and returned:

—> Computing dependencies for py38-Pillow
—> Cleaning py38-Pillow
—> Scanning binaries for linking errors
—> No broken files found.
—> No broken ports found.

So I think that has been installed correctly. As for the core issue, clicking the ‘Geometry’ tab or loading a flair project still crashes the program and produces the Segmentation fault : 11 error message.

Any other ideas of what might be causing these issues? I have uninstalled and reinstalled several times and tried to follow the instructions explicitly and in order. On one of my attempts I was able to open the ‘Geometry’ tab but all I saw was what looked like a frozen example screen. If memory serves this was before installing geoviewer and I would get messages in the command line to the effect of ‘cannot find geoviewer’

Thanks for your help!

Hi @Jason_O,
as initial basic checks, can you provide me the output of these commands?

port echo requested
flair -h | grep Version
lsof | grep xcb

For the last one, please be sure that a Flair instance is running.

@luillo

Jasons-MacBook-Pro-2:flair-3.1 J$ port echo requested
gcc10                          @10.2.0_0 
gdb                            @9.2_0 
ghostscript                    @9.52_0+x11 
gnuplot                        @5.2.8_0+aquaterm+luaterm+pangocairo+wxwidgets+x11 
pkgconfig                      @0.29.2_0 
py37-matplotlib                @3.3.0_1+tkinter+webagg 
py37-numpy                     @1.19.1_0+gfortran+openblas 
py37-Pillow                    @7.2.0_0 
py37-pip                       @20.2.2_0 
py37-pydicom                   @2.0.0_0 
py37-scipy                     @1.5.2_0+gfortran+openblas 
py37-tkinter                   @3.7.8_0 
py38-matplotlib                @3.3.0_1+tkinter+webagg 
py38-numpy                     @1.19.1_0+gfortran+openblas 
py38-Pillow                    @7.2.0_0 
py38-pip                       @20.2.2_0 
py38-pydicom                   @2.0.0_0 
py38-scipy                     @1.5.2_0+gfortran+openblas 
py38-tkinter                   @3.8.5_0 
py38-xlib                      @0.26_0 
python37                       @3.7.8_0 
xorg                           @20090316_0 
xorg-libxcb                    @1.13.1_0+python37 
xorg-server                    @1.20.8_1 
xorg-xcb-proto                 @1.13_2+python37  

Jasons-MacBook-Pro-2:flair-3.1 J$ flair -h | grep Version

-bash: flair: command not found

Jasons-MacBook-Pro-2:flair-3.1 J$ lsof | grep xcb
Python    76783    J  txt       REG                1,4    146276 12929367126 /opt/local/lib/libxcb.1.dylib
Python    76802    J  txt       REG                1,4    146276 12929367126 /opt/local/lib/libxcb.1.dylib

Thank you for your help Luigi!

Hi @Jason_O,
I do not see anything missing in your MacPorts installation. Let me note that it is not necessary to have duplicated ports for py37 and py38 and, as mentioned in my previous email, that you don’t need to downgrade the xcb library.

Before doing any change, please, run this command inside the flair directory
./flair -h | grep Version
Please note the ./ !
The output should be
Version: 3.1-2 [257a6ab0 ]

Then, please open Flair and run this command
lsof | grep xcb

Thanks, luigi

Hi @luillo

Adding the ‘./’ worked and it did return
Version: 3.1-2 [257a6ab0 ]
as you predicted.

When I run
lsof | grep xcb
with Flair open I still get
Python 76932 J txt REG 1,4 146276 12929367126 /opt/local/lib/libxcb.1.dylib

Thank you

Hi @Jason_O,
the setup seems fine.

When you open flair with the command ./flair, do you still have the same error clicking on the ‘Geometry’ tab?

Hi @luillo

Unfortuanely yes, I still get the same error using ./flair

-Jason

Hi @Jason_O,

have you tried to recompile geoviewer?
make clean; make; make install DESTDIR=<flair-path>

The last resort would be reinstalling MacPorts from scratch
(From the list of installed ports, I think that you have installed it in your machine only for Flair and not for other applications).
To proceed, run this command
sudo port uninstall installed
and please install only a version of python, do not mix the libraries and do not apply the patch. Finally, you need to recompile geoviewer.

Hi @luillo

I tried all of the steps you suggested. I even removed all traces of Fluka, flair, macports and python and reinstalled. Then I upgraded mac OS to Catalina and tried from the beginning again and still have the same result: If I don’t have geoviewer installed I can click the ‘Geometry’ tab and get a stock picture of the interface. If I have geoviewer installed and compiled the program crashes when I click the ‘Geometry’ tab and get ‘Python quit unexpectedly’

I am going to try to secure a different machine but in the meantime if you have any other ideas I will try them on the mac.

Many thanks,
-Jason

Dear @Jason_O,

Could you please sent us the output during the geoviewer compilation?
i.e. inside the geoviewer folder type:

make clean
make -j DEBUG=yes > makeinfo.log

and send to us the generated - under the same folder - makeinfo.log file.

Thanks and cheers,
Thanos

Hi @manousos

Thank you very much for looking into this! Here is the file you requested:
makeinfo.log (81.1 KB)

-Jason

Dear @Jason_O,

Could you please check that the version of python3 that is used is the one from the macport installation?
You can it by typing

which python3

in a terminal. I want to be sure, since in the output you’ve send I see two different paths of python, where only one - the one in the /opt/local/… should be called
since macports is installing everything under /opt/local by default.

In addition, and something that might help as well,
since you upgraded from Mojave to Catalina,
it would be good to unonstall and install the XCode as well,
and update the command line tools if needed.

Cheers,
Thanos

Hi @manousos,

my python version is:

/Library/Frameworks/Python.framework/Versions/3.8/bin/python3

When I upgraded to Catalina I started the install from the beginning incorperating all of the reccomendations from @luillo up until this point. For instance I made sure only to download one version of python this time (py38) and not appliy the obselete patches.

Thanks,
-Jason

Dear @Jason_O,

If you type:

sudo port select --set python3 python38

and then

which python3

you get the same output as you pointed out?
In addition, did you try to uninstall and install Xcode
and then try

make clean; make; make install DESTDIR=< flair-path >

as @luillo mentioned before? (but with a fresh Xcode installation :wink: )

Cheers,
Thanos

Hi @manousos

I still get the same output for

which python3

After uninstalling and reinstalling xcode I get:

Jasons-MacBook-Pro-2:flair-geoviewer-3.1 J$ make install DESTDIR=/Users/J/Desktop/FLUKA/flair-3.1

/Library/Developer/CommandLineTools/usr/bin/make -C viewer

make[1]: Nothing to be done for `all’.

/Library/Developer/CommandLineTools/usr/bin/make -C geometry

make[1]: Nothing to be done for `all’.

/Library/Developer/CommandLineTools/usr/bin/make -C data

make[1]: Nothing to be done for `all’.

/Library/Developer/CommandLineTools/usr/bin/make -C graph

make[1]: Nothing to be done for `all’.

/Library/Developer/CommandLineTools/usr/bin/make -C math

make[1]: Nothing to be done for `all’.

/Library/Developer/CommandLineTools/usr/bin/make -C farm

make[1]: Nothing to be done for `all’.

/Library/Developer/CommandLineTools/usr/bin/make -C tool

make[1]: Nothing to be done for `all’.

/Library/Developer/CommandLineTools/usr/bin/make -C xdraw

make[1]: Nothing to be done for `all’.

c++ -o geoviewer.so geometryobject.o geoviewer.o gmesh.o gobject.o pyutils.o viewerobject.o -g -DDarwin -O3 -funroll-loops -DNDEBUG -D_DEBUG=0 -ftree-vectorize -DTHREAD -std=c++11 -pedantic -W -Wall -Wcast-align -Wcast-qual -Wextra -Wformat -Wpointer-arith -Wredundant-decls -Wshadow -Wno-write-strings -Wno-long-long -Wno-non-virtual-dtor -Wno-variadic-macros -Woverloaded-virtual -Wpointer-arith -Wshadow -Wunused -Wuninitialized -Wwrite-strings -Wshadow -pipe -pthread -Wno-class-memaccess -fwrapv -fstack-protector -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -m64 -dynamiclib -L/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin -ldl -framework CoreFoundation -L. -L/opt/local/lib -lX11 -Lviewer -lviewer -Lgeometry -lgeometry -Ldata -ldata -Lgraph -lgraph -Lmath -lmath -Lfarm -lfarm -Ltool -ltool -Lxdraw -lxdraw -lX11 -lpthread -lm -undefined dynamic_lookup

ld: unsupported tapi file type ‘!tapi-tbd’ in YAML file ‘/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd’ for architecture x86_64

collect2: error: ld returned 1 exit status

make: *** [geoviewer.so] Error 1

Now when I try to open flair it crashes immediately. With the following sequence:

Jasons-MacBook-Pro-2:~ J$ /Users/J/Desktop/FLUKA/flair-3.1/flair ; exit;

w> Warning: PIL.Image and PIL.ImageTk not found

/Users/J/Desktop/FLUKA/flair-3.1/flair: line 14: 19342 Segmentation fault: 11 ${PYTHON} -O -W ignore ${DIR}/flair.py “$@”

logout

Saving session…

…copying shared history…

…saving history…truncating history files…

…completed.

[Process completed]

Thank you,
-Jason

Hi @Jason_O,

Ok - now it might seem worse but it actually gives a hint.
Could you please try to uninstall the command line tools and re-install them?
But please do it as:

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

and then inside the geoviewer folder again:

make clean; make -j DEBUG=yes; make install DESTDIR=< path-to-flair >

and let me know!
Cheers,
Thanos

Hi @manousos

Thank you so much for perservering with me. I am still having the same problem. After running the commands I still get:

/Users/J/Desktop/FLUKA/flair-3.1/flair ; exit;

Jasons-MacBook-Pro-2:~ J$ /Users/J/Desktop/FLUKA/flair-3.1/flair ; exit;

w> Warning: PIL.Image and PIL.ImageTk not found

/Users/J/Desktop/FLUKA/flair-3.1/flair: line 14: 23060 Segmentation fault: 11 {PYTHON} -O -W ignore {DIR}/flair.py “$@”

logout

Saving session…

…copying shared history…

…saving history…truncating history files…

…completed.

[Process completed]

Dear @Jason_O,

I’m guessing that the Segmentation fault appears again when you 're trying to use the geoviewer.
From what I can figure out, there is either a mismatch / or a messy situation with your python versions (installed ones by you and the system ones).
Assuming that you’re using the macport version of python3, it still bugs me the path of its installation.
When you’re installing macports, the software adds one export command in your .profile.
Could you please share this variable in the post?
Mine is:

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"

which means that everything from macports are installed under /opt/local.

Cheers,
Thanos