Enrico, some more information would be helpful, like a full petsc error message. Also, PETSc version and configuration would be great. Can you run valgrind to detect where and why the code is erroring? or run with -on_error_attach_debugger ?
Thanks Stefano
