Memory leak / unconverted smart pointers in down_cast().mat()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
Medium
|
Johan Hake |
Bug Description
A memory leak is reported when doing down_cast(A).mat() in python. Additionally, the smart-pointer object that is returned is not converted to a usable type. This is tested with trunk, I assume the same happens in 1.0. PETSc v3.2-p5, Trilinos v10.85.
Test code:
========
from dolfin import *
dolfin.
mesh = UnitSquare(2,2)
V = FunctionSpace(mesh, "CG", 1)
v, u = TestFunction(V), TrialFunction(V)
A = assemble(
C = down_cast(A).mat()
print C
Output:
======
<Swig Object of type 'Teuchos::RCP< Epetra_FECrsMatrix > *' at 0x9fb5140>
swig/python detected a memory leak of type 'Teuchos::RCP< Epetra_FECrsMatrix > *', no destructor found.
Changed in dolfin: | |
status: | New → Fix Committed |
importance: | Undecided → Medium |
assignee: | nobody → Johan Hake (johan-hake) |
milestone: | none → trunk |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
Have you imported PyTrilinos before you do the downcast for the Epetra
backend?
Johan
On 02/21/2012 12:45 PM, Joachim Haga wrote: parameters[ "linear_ algebra_ backend" ] = "Epetra" # also with PETSc inner(grad( u),grad( v))*dx)
> Public bug reported:
>
> A memory leak is reported when doing down_cast(A).mat() in python.
> Additionally, the smart-pointer object that is returned is not converted
> to a usable type. This is tested with trunk, I assume the same happens
> in 1.0. PETSc v3.2-p5, Trilinos v10.85.
>
> Test code:
> ========
> from dolfin import *
> dolfin.
>
> mesh = UnitSquare(2,2)
> V = FunctionSpace(mesh, "CG", 1)
> v, u = TestFunction(V), TrialFunction(V)
> A = assemble(
>
> C = down_cast(A).mat()
> print C
>
> Output:
> ======
> <Swig Object of type 'Teuchos::RCP< Epetra_FECrsMatrix> *' at 0x9fb5140>
> swig/python detected a memory leak of type 'Teuchos::RCP< Epetra_FECrsMatrix> *', no destructor found.
>
> ** Affects: dolfin
> Importance: Undecided
> Status: New
>