Segmentation Violation

Issue #104 on hold
Marco Magliulo created an issue

I do not know if it is an issue coming from petsc4py, or a problem coming from my setup/installation. I installed petsc4py using pip

I am not able to run even the easiest examples on my local machine. For example, if I fo the following:

git clone https://github.com/JesseLu/petsc4py-tutorial.git
cd petsc4py-tutorial
python mat_serial.py

I immediately get:

[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 59.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------

Comments (7)

  1. Lisandro Dalcin

    Try to run some simple example in the petsc4py repo. If you are using an optimized build of PETSc, and there is a bug in the way you use the API, then you may get a segmentation fault just because PETSc's internal error checking machinery is disabled. Are you able to execute a script with just "from petsc4py import PETSc" ?

  2. Marco Magliulo reporter

    I could execute a script with just from petsc4py import PETSc I also could run test_mat_aij.py without issues

    I did not build PETSc myself as I followed these instructions

    Everything seems up-to-date:

    pip3 install --upgrade petsc petsc4py numpy mpi4py
    Requirement already up-to-date: petsc in /usr/local/lib/python3.6/site-packages
    Requirement already up-to-date: petsc4py in /usr/local/lib/python3.6/site-packages
    Requirement already up-to-date: numpy in /usr/local/lib/python3.6/site-packages
    Requirement already up-to-date: mpi4py in /usr/local/lib/python3.6/site-packages 
    

    Am I missing something obvious here ?

  3. Lisandro Dalcin

    No, I don't think so. Maybe the mat_serial.py script has a bug, or it is outdated. I did not write that code. You should raise an issue to the author of that code. Run the script with valgrind, i.e. valgrind python mat_serial.py, maybe we can get some insight about where the problem is.

  4. Marco Magliulo reporter

    Sorry I did not have the time to investigate further. I went back to scipy.sparse routines for the time being :) I will keep you posted when I come back to PETSc

  5. Log in to comment