mesh-entities-broken

Bug #713081 reported by Anders Logg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
High
Unassigned

Bug Description

The following code prints 3, 0 but should print 3, 3:

from dolfin import *

mesh = UnitSquare(2, 2)
cell = Cell(mesh, 0)

print cell.num_entities(0), len(cell.entities(0))

Perhaps a broken typemap for uint*?

Anders Logg (logg)
Changed in dolfin:
status: New → Confirmed
importance: Undecided → High
milestone: none → 0.9.10
Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 713081] [NEW] mesh-entities-broken

This looks like a Heisenbug to me!

When I put a print statement into the typemap it works, when I remove the
print statement it appears...

With print statement ("size connectivity X"):

  In [4]: print cell.num_entities(0), len(cell.entities(0))
  3size connectivity 3
  3

without:

  In [4]: print cell.num_entities(0), len(cell.entities(0))
  3 0

Puzzled...

Johan

On Friday February 4 2011 05:05:23 Anders Logg wrote:
> Public bug reported:
>
> The following code prints 3, 0 but should print 3, 3:
>
> from dolfin import *
>
> mesh = UnitSquare(2, 2)
> cell = Cell(mesh, 0)
>
> print cell.num_entities(0), len(cell.entities(0))
>
> Perhaps a broken typemap for uint*?
>
> ** Affects: dolfin
> Importance: High
> Status: Confirmed
>
> ** Changed in: dolfin
> Status: New => Confirmed
>
> ** Changed in: dolfin
> Importance: Undecided => High
>
> ** Changed in: dolfin
> Milestone: None => 0.9.10

Revision history for this message
Johan Hake (johan-hake) wrote :

Anders, can you look over the initialization of the Mesh object, and double
check that everything is correctly intialized and destroyed.

I have a funny feeling that this error was introduced because some lowlevel
hard to debug error.

The typemaps are OK, and the error goes away if I introduce a std::cout
withing the typemap, indicating memory corruption.

Johan

On Friday February 4 2011 08:27:57 Johan Hake wrote:
> This looks like a Heisenbug to me!
>
> When I put a print statement into the typemap it works, when I remove the
> print statement it appears...
>
> With print statement ("size connectivity X"):
>
> In [4]: print cell.num_entities(0), len(cell.entities(0))
> 3size connectivity 3
> 3
>
> without:
>
> In [4]: print cell.num_entities(0), len(cell.entities(0))
> 3 0
>
> Puzzled...
>
> Johan
>
> On Friday February 4 2011 05:05:23 Anders Logg wrote:
> > Public bug reported:
> >
> > The following code prints 3, 0 but should print 3, 3:
> >
> > from dolfin import *
> >
> > mesh = UnitSquare(2, 2)
> > cell = Cell(mesh, 0)
> >
> > print cell.num_entities(0), len(cell.entities(0))
> >
> > Perhaps a broken typemap for uint*?
> >
> > ** Affects: dolfin
> >
> > Importance: High
> >
> > Status: Confirmed
> >
> > ** Changed in: dolfin
> >
> > Status: New => Confirmed
> >
> > ** Changed in: dolfin
> >
> > Importance: Undecided => High
> >
> > ** Changed in: dolfin
> >
> > Milestone: None => 0.9.10

Revision history for this message
Anders Logg (logg) wrote :

Will check.

--
Anders

On Fri, Feb 04, 2011 at 08:38:34PM -0000, Johan Hake wrote:
> Anders, can you look over the initialization of the Mesh object, and double
> check that everything is correctly intialized and destroyed.
>
> I have a funny feeling that this error was introduced because some lowlevel
> hard to debug error.
>
> The typemaps are OK, and the error goes away if I introduce a std::cout
> withing the typemap, indicating memory corruption.
>
> Johan
>
>
> On Friday February 4 2011 08:27:57 Johan Hake wrote:
> > This looks like a Heisenbug to me!
> >
> > When I put a print statement into the typemap it works, when I remove the
> > print statement it appears...
> >
> > With print statement ("size connectivity X"):
> >
> > In [4]: print cell.num_entities(0), len(cell.entities(0))
> > 3size connectivity 3
> > 3
> >
> > without:
> >
> > In [4]: print cell.num_entities(0), len(cell.entities(0))
> > 3 0
> >
> > Puzzled...
> >
> > Johan
> >
> > On Friday February 4 2011 05:05:23 Anders Logg wrote:
> > > Public bug reported:
> > >
> > > The following code prints 3, 0 but should print 3, 3:
> > >
> > > from dolfin import *
> > >
> > > mesh = UnitSquare(2, 2)
> > > cell = Cell(mesh, 0)
> > >
> > > print cell.num_entities(0), len(cell.entities(0))
> > >
> > > Perhaps a broken typemap for uint*?
> > >
> > > ** Affects: dolfin
> > >
> > > Importance: High
> > >
> > > Status: Confirmed
> > >
> > > ** Changed in: dolfin
> > >
> > > Status: New => Confirmed
> > >
> > > ** Changed in: dolfin
> > >
> > > Importance: Undecided => High
> > >
> > > ** Changed in: dolfin
> > >
> > > Milestone: None => 0.9.10
>

Johan Hake (johan-hake)
Changed in dolfin:
status: Confirmed → Fix Committed
Revision history for this message
Johan Hake (johan-hake) wrote :

This was fixed when the shared_ptr interface of Mesh and Hierarchical was settled.

Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 713081] Re: mesh-entities-broken

On Fri, Feb 11, 2011 at 02:35:45AM -0000, Johan Hake wrote:
> This was fixed when the shared_ptr interface of Mesh and Hierarchical
> was settled.

Great!

Changed in dolfin:
status: Fix Committed → Fix Released
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.