Closed oesteban closed 6 years ago
I've narrowed it down to the following backtrace:
#0 PyType_IsSubtype (a=0x626f6174656d5f74, b=0x7fffdc413660) at Objects/typeobject.c:1357
#1 0x00007fffdc2090cf in ?? () from /usr/local/miniconda/lib/python3.6/site-packages/sip.so
#2 0x00007fffdc209935 in ?? () from /usr/local/miniconda/lib/python3.6/site-packages/sip.so
#3 0x00007fffdbed2cdd in qpycore_init() () from /usr/local/miniconda/lib/python3.6/site-packages/PyQt5/QtCore.so
#4 0x00007fffdbea9bfc in PyInit_QtCore () from /usr/local/miniconda/lib/python3.6/site-packages/PyQt5/QtCore.so
#5 0x00007ffff7a3e55b in _PyImport_LoadDynamicModuleWithSpec (spec=0x7fffdc427390, fp=0x7fffdbea9b20 <PyInit_QtCore>) at ./Python/importdl.c:154
#6 0x00007ffff7a3b33f in _imp_create_dynamic_impl (file=<optimized out>, spec=0x7fffdc427390, module=<optimized out>) at Python/import.c:2004
...
I suspect that importing matplotlib is the origin of this Segmentation Fault (see https://github.com/matplotlib/matplotlib/issues/9294/#issuecomment-369090170)
Okay,
python -c "import matplotlib.pyplot as plt"
forces the segmentation fault. I'm closing this issue since it is not an ICA-AROMA problem per se.
However, @maartenmennes, please consider setting the 'Agg'
backend right after loading matplotlib in the beginning (probably protected by a try...except for the case when users have already set the backend themselves).
For your Dockerfile, definitely consider something along these lines: https://github.com/poldracklab/mriqc/blob/cfedd5e008510a5d02f508ee1b9ca82976d5340d/Dockerfile#L116
Hi Oscar, thanks for solving your own issue 😀 - but I'm kind of lost as to what the issue is and what I might need to implement to get this sorted at the AROMA end. This is beyond my level of dealing with python 😅
Hi Maarten,
Nine days ago you added this line:
For rendering, matplotlib uses a "backend". By default (and I don't know why), it seems like it selects QT5 (I guess that depends on pyqt being installed). These backends usually link to C libraries. In my settings (the docker image of fmriprep) QT was not fully installed and importing matplotlib caused the segfault.
In this function you don't want to pop up an interactive plot, so you are safe using the 'Agg'
backend. That is the simplest one.
To make your code robuster, you should add:
import matplotlib as mpl
mpl.use('Agg')
It used to raise exception if the backend was already set, but now checking with matplotlib 2.2.0 it doesn't seem so.
For your Dockerfile, I recommended adding a line like https://github.com/poldracklab/mriqc/blob/cfedd5e008510a5d02f508ee1b9ca82976d5340d/Dockerfile#L116 to ensure that the default backend is set to 'Agg'
within the container.
I hope this clarified a bit...
Thanks for the clarification @oesteban. I have fixed this in the classification_plots function. I have not fixed this in the Dockerfile as I currently have 0 experience with Docker. The file included in AROMA was provided by somebody else.
This is probably a duplicate of #19, but I can't reopen.
Context - https://github.com/poldracklab/fmriprep/pull/1064#issuecomment-383393821
Getting this:
Some items I checked:
umask 000
.Any ideas?