Periodic BDM segfault in 1.2.0

Bug #1162010 reported by Andrew McRae
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Confirmed
Undecided
Unassigned

Bug Description

Using 1.2.0 stable, built with dorsal. I get either a segfault (or occasionally a hang) with the code below.

Code:
========================================================
from dolfin import *

def SinglyPeriodicBC():
    class PeriodicBoundaryX(SubDomain):
        def inside(self, x, on_boundary):
            return on_boundary and near(x[0], 0)
        def map(self, x, y):
            y[0] = x[0] - 1
            y[1] = x[1]

    pbc = PeriodicBoundaryX()
    return pbc

mesh = UnitSquareMesh(16, 16)
pbc = SinglyPeriodicBC()
print "1"
T1 = FunctionSpace(mesh, 'CG', 1) # works
print "2"
T2 = FunctionSpace(mesh, 'CG', 1, constrained_domain=pbc) # works
print "3"
S1 = FunctionSpace(mesh, 'BDM', 1) # works
print "4"
S2 = FunctionSpace(mesh, 'BDM', 1, constrained_domain=pbc) # fails
print "5"
========================================================

Output:
========================================================
atm112@ae-amcrae:~/Dropbox/FEniCS/scratch$ python BDMbroken.py
1
2
3
4
[ae-amcrae:07493] *** Process received signal ***
[ae-amcrae:07493] Signal: Segmentation fault (11)
[ae-amcrae:07493] Signal code: Address not mapped (1)
[ae-amcrae:07493] Failing at address: 0x3adca38
[ae-amcrae:07493] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f885bc23cb0]
[ae-amcrae:07493] [ 1] /home/atm112/local/fenics/lib/libdolfin.so.1.2(_ZN6dolfin13DofMapBuilder32build_constrained_vertex_indicesERKNS_4MeshERKSt3mapIjSt4pairIjjESt4lessIjESaIS5_IKjS6_EEERSt6vectorImSaImEE+0x3a9) [0x7f88552ddcf9]
[ae-amcrae:07493] [ 2] /home/atm112/local/fenics/lib/libdolfin.so.1.2(_ZN6dolfin13DofMapBuilder9build_ufcERNS_6DofMapERSt3mapIiiSt4lessIiESaISt4pairIKiiEEERKNS_4MeshEN5boost10shared_ptrIKS3_IjS3_IjS6_IjjES4_IjESaIS6_IKjSH_EEESI_SaIS6_ISJ_SM_EEEEENSG_IKNS_11RestrictionEEE+0x276) [0x7f88552df1e6]
[ae-amcrae:07493] [ 3] /home/atm112/local/fenics/lib/libdolfin.so.1.2(_ZN6dolfin13DofMapBuilder5buildERNS_6DofMapERKNS_4MeshEN5boost10shared_ptrIKSt3mapIjS8_IjSt4pairIjjESt4lessIjESaIS9_IKjSA_EEESC_SaIS9_ISD_SG_EEEEENS7_IKNS_11RestrictionEEE+0xdc) [0x7f88552e3b4c]
[ae-amcrae:07493] [ 4] /home/atm112/local/fenics/lib/libdolfin.so.1.2(_ZN6dolfin6DofMapC2EN5boost10shared_ptrIKN3ufc6dofmapEEERKNS_4MeshENS2_IKNS_9SubDomainEEE+0x6b9) [0x7f88552f2279]
[ae-amcrae:07493] [ 5] /home/atm112/local/fenics/lib/python2.7/site-packages/dolfin/cpp/_fem.so(+0x85d03) [0x7f883b46fd03]
[ae-amcrae:07493] [ 6] python(PyEval_EvalFrameEx+0x48d8) [0x49c4d8]
[ae-amcrae:07493] [ 7] python(PyEval_EvalCodeEx+0x1a0) [0x49f1c0]
[ae-amcrae:07493] [ 8] python() [0x4a8960]
[ae-amcrae:07493] [ 9] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] [10] python() [0x4ec11a]
[ae-amcrae:07493] [11] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] [12] python() [0x4eb39e]
[ae-amcrae:07493] [13] python() [0x4db6a6]
[ae-amcrae:07493] [14] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] [15] python(PyEval_EvalFrameEx+0x86a) [0x49846a]
[ae-amcrae:07493] [16] python(PyEval_EvalCodeEx+0x1a0) [0x49f1c0]
[ae-amcrae:07493] [17] python() [0x4a8960]
[ae-amcrae:07493] [18] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] [19] python() [0x4ec11a]
[ae-amcrae:07493] [20] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] [21] python(PyEval_EvalFrameEx+0x86a) [0x49846a]
[ae-amcrae:07493] [22] python(PyEval_EvalCodeEx+0x1a0) [0x49f1c0]
[ae-amcrae:07493] [23] python() [0x4a8a92]
[ae-amcrae:07493] [24] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] [25] python() [0x4ec11a]
[ae-amcrae:07493] [26] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] [27] python() [0x4eb39e]
[ae-amcrae:07493] [28] python() [0x4db6a6]
[ae-amcrae:07493] [29] python(PyObject_Call+0x36) [0x4e9f36]
[ae-amcrae:07493] *** End of error message ***
Segmentation fault (core dumped)
========================================================

Revision history for this message
Andrew McRae (andymc) wrote :

Same thing happens for BDFM and RT elements.

Revision history for this message
Garth Wells (garth-wells) wrote :

Check that you're up-to-date. This code snippet work fine for me, and the BDM case is covered by a unit test (in test/unit/fem/python/PeriodicBC.py).

Revision history for this message
Andrew McRae (andymc) wrote :

I managed to run this successfully on trunk, when I eventually got it built (not using Dorsal), so maybe not a bug that 'needs fixing' per se. I'm just worried by how it works fine for Lagrange elements, but breaks for the vector types - perhaps a symptom of something deeper.

Revision history for this message
Andrew McRae (andymc) wrote :

Just to confirm that I still get this error in 1.2.0 but not 1.2.0+. Here's my procedure:

Set up two instances of a fully-updated, but otherwise fresh, Ubuntu 12.04 VM.
Installed bzr on each
Executed bzr co lp:dorsal from a subdir of 'home'
Set up a local.cfg in the dorsal root directory, each had PROCS=2, one had STABLE_BUILD = true, the other false
Copied precise.platform into the dorsal root directory, commenting out all packages except petsc and slepc
Ran ./dorsal.sh without arguments to bring up the 'required packages' text
Installed the packages, but did not continue with the dorsal installation
Ran ./dorsal.sh ./precise.platform to install petsc and slepc.
Added the 'source .../fenics.conf' to my .bashrc, reopen terminal windows.
Modify precise.platform to skip:petsc, skip:slepc, uncomment fiat, ran ./dorsal.sh ./precise.platform to install fiat
Modify precise.platform to skip:fiat, uncomment ufc, ran ./dorsal.sh ./precise.platform (repeat for ufl, ffc, instant, dolfin)
[I'm pretty sure that I could do these 6 at once, but I can't do all 8 at once on trunk because I'd need to add the 'source .../fenics.conf' to compile the forms with ffc, and this doesn't exist initially]
[I noticed that the generate-all script didn't run in the trunk version, so I had to run this manually otherwise dolfin would fail to build almost immediately after running dependency tests.]

Ran the above code in each VM. Trunk: fine. Stable: segfault.

Revision history for this message
Johannes Ring (johannr) wrote :

Confirmed with 1.2.x. Works fine with trunk.

Changed in dolfin:
status: New → Confirmed
milestone: none → 1.2.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.