This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

segmentation fault when saving png of Constant

+1 vote

I am getting a seg fault when doing

mesh = UnitCubeMesh(10,10,10)
plotter = plot(Constant(1.0),mesh=mesh)
plotter.write_png('test.png') # breaks here

but if I do

mesh = UnitCubeMesh(10,10,10)
Q = FunctionSpace(mesh,'CG',1)
f = Function(Q)
f.vector()[:] = 1.0
plotter = plot(f)
plotter.write_png('test.png') # works here

I could track down the problem to "_function.lock()->compute_vertex_values(vertex_values, *mesh);" in VTKPlottableGenericFunction.cpp. Apperently _function is a std::weak_ptr and that seems to be the problem. Can anyone reproduce?

asked Jul 27, 2015 by chaffra FEniCS User (1,830 points)

I have the same issue with dolfin 1.6.0 on Ubuntu 15.10 64 bit, Python 2.7.10, IPython 2.3.0, libpetsc 3.4.2v5.

1 Answer

0 votes

I get the same behavior, for the first example a segmentation fault occurs.

[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range

The second example works without errors.

I am using Dolfin 1.4.0 on Ubuntu 14.04 64 bit.

answered Jul 29, 2015 by peter-ma FEniCS Novice (170 points)
...