Segfault in writing out XML with master

Issue #361 resolved
Patrick Farrell created an issue
from dolfin import *

mesh = UnitSquareMesh(100, 100)
V = VectorFunctionSpace(mesh, "CG", 2)
P = FunctionSpace(mesh, "CG", 1)
Z = MixedFunctionSpace([V, P])

z = Function(Z)
File("example.xml") << z

segfaults on two processors with master:

[pef@aislinn:/tmp]$ python dump.py 
[pef@aislinn:/tmp]$ mpiexec -n 2 python dump.py 
Number of global vertices: 10201
Number of global cells: 20000
--------------------------------------------------------------------------
mpiexec noticed that process rank 0 with PID 22901 on node aislinn exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------

Something to do with the recent dofmap changes? A backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffdf2ad93a in dolfin::XMLFunctionData::write (u=..., xml_node=...)
    at /home/pef/local/fenics-dbg-20140817/src/dolfin/dolfin/io/XMLFunctionData.cpp:190
190             = (unsigned int) global_dof_to_cell_dof[i][0].first;
(gdb) bt
#0  0x00007fffdf2ad93a in dolfin::XMLFunctionData::write (u=..., xml_node=...)
    at /home/pef/local/fenics-dbg-20140817/src/dolfin/dolfin/io/XMLFunctionData.cpp:190
#1  0x00007fffdf27db1d in dolfin::XMLFile::operator<< (this=0x31c0560, 
    output=...)
    at /home/pef/local/fenics-dbg-20140817/src/dolfin/dolfin/io/XMLFile.cpp:240
#2  0x00007fffb67913a9 in dolfin::File::operator<< <dolfin::Function> (
    this=0x31bc170, t=...)
    at /home/pef/local/fenics-dbg-20140817/src/dolfin/dolfin/io/File.h:234
#3  0x00007fffb676e41f in _wrap_File___lshift____SWIG_20 (nobjs=2, 
    swig_obj=0x7fffffffcf70)
    at /home/pef/local/fenics-dbg-20140817/src/dolfin/build.master/dolfin/swig/modules/io/modulePYTHON_wrap.cxx:21665

Comments (4)

  1. Patrick Farrell reporter

    It works with XDMF, yes. (I find the Function(V, filename) interface very convenient and tend to use XML when performance isn't critical.)

  2. Log in to comment