python segmentation fault

Asked by Yaakoub El Khamra

Not much of a question, just a note for others who might run into the same issue.

I recently ran into an illusive issue where importing dolfin in python resulted in a segmentation fault. Interestingly, importing dolfin in ipython worked fine.

The latest nvidia drivers introduced libraries that cause segmentation faults in glibc at strcmp. The error disappears when running with gdb or valgrind but I could reproduce it by running:
python -vvv -c "import dolfin"
....
# trying /home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/cpp/impmodule.so
# trying /home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/cpp/imp.py
# trying /home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/cpp/imp.pyc
# trying /home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/cpp/_common.so
dlopen("/home/yye00/Work/FEniCS/lib64/python2.7/site-packages/dolfin/cpp/_common.so",
<segmentation fault>

rolling back to 310.14 drivers fix this. Switching to mesa for the libgl libraries might fix this as well but I did not try that.

Regards
Yaakoub

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Yaakoub El Khamra
Solved:
Last query:
Last reply:
Revision history for this message
Myles English (mylesenglish) said :
#1

Hi Yaakoub,

I can confirm this behaviour with C++ too, I got a backtrace:

https://answers.launchpad.net/dolfin/+question/218024

I had to rebuild much of my stack with debug symbols and turn off optimisation to get the backtrace, took about a week. Using libGL from mesa does indeed workaround this problem, but now I can't use evince.

I was using nvidia drivers 310.19-2.

Revision history for this message
Yaakoub El Khamra (yelkhamra) said :
#2

Closing the question.

Revision history for this message
Yaakoub El Khamra (yelkhamra) said :
#3

Sorry I closed the question before replying Myles. I am glad you have the mesa work-around but too bad about evince. Okular is an ok alternative. I can tell you one thing for sure: the next card I am buying is not going to be an nvidia.

Good luck!

Regards
Yaakoub

Revision history for this message
Yaakoub El Khamra (yelkhamra) said :
#4

Another work-around worth mentioning: you can include vtk in dorsal for dorsal to build. You will have to make modifications (best done with cd dorsal_build_dir then ccmake ../) to enable OSMESA:
 OSMESA_INCLUDE_DIR /usr/include
 OSMESA_LIBRARY /usr/lib64/libOSMesa.so

and disable:
 VTK_USE_RENDERING OFF
 VTK_USE_PARALLEL OFF
 VTK_USE_DISPLAY OFF

you will also have to disable some of these options:

disable parallel python
disable infovispython
disable freetype

make clean; make -j 8; make install

then you will have a local, non-system VTK built with osmesa that does not depend on the nividia drivers.

Regards
Yaakoub

Revision history for this message
Joachim Haga (jobh) said :
#5

Nice. It would be cool if this information was encoded in a dorsal
packaging step, e.g. FEniCS/packages/vtkoffscreen.package. Just make a copy
of vtk.package and set the necessary parameters -DVTK_USE_RENDERING=OFF etc.

On 24 January 2013 03:55, Yaakoub El Khamra <
<email address hidden>> wrote:

> Question #219106 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/219106
>
> Yaakoub El Khamra posted a new comment:
>
> Another work-around worth mentioning: you can include vtk in dorsal for
> dorsal to build. You will have to make modifications (best done with cd
> dorsal_build_dir then ccmake ../) to enable OSMESA:
> OSMESA_INCLUDE_DIR /usr/include
> OSMESA_LIBRARY /usr/lib64/libOSMesa.so
>
> and disable:
> VTK_USE_RENDERING OFF
> VTK_USE_PARALLEL OFF
> VTK_USE_DISPLAY OFF
>
> you will also have to disable some of these options:
>
> disable parallel python
> disable infovispython
> disable freetype
>
> make clean; make -j 8; make install
>
> then you will have a local, non-system VTK built with osmesa that does
> not depend on the nividia drivers.
>
> Regards
> Yaakoub
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>