Open pefarrell opened 6 years ago
Bug in Firedrake/PyOP2. We treat the off-diagonal 1xN and Nx1 blocks as matrices to the outside world. So we think they way to discard entries is to just put negative values in the Maps. But internally, we have just have an array (Dat) representing the dense block. We insert into that directly (through the provided maps). So negative entries lead to out of bounds memory access.
We could rework the PyOP2 dense stuff to use MatDense
, and then things might work. Or we need to handle these strange matrices specially.
I tried running the sample code and get a diverged linear solve rather than a segfault. Did #1662 fix this?
No, it didn't sadly.
Woops, my mistake! I misunderstood the issue and thought the problem was only in assembly.
I'm trying to solve a fairly complicated problem (Frank-Oseen, augmented with an extra real-valued variable to eliminate rotational orbits). Here is a simplified code:
When I run this, I get a segfault/double free or memory corruption error (it varies from run to run). Running with
PYOP2_DEBUG=1
and electric fence activated, it segfaults onThe generated code looks like
with sizes
Is this user error, or a bug in the compiler?