CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Invalid pointer handling in tmp%2360T class

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2007, 16:02
Default Any comments anyone? Should
  #1
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Any comments anyone?

Should we be worried about this potential problem in a fairly low-level but very important class for OpenFOAM?

Is it possible to know what kind of problem was solved by this modification to the file tmpI.H?

Should we reactivate the little piece of code commented out in tmp<t>::clear()?

Just curious,

Martin
mbeaudoin is offline   Reply With Quote

Old   April 24, 2007, 12:57
Default Robert, I changed the opera
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
Robert,

I changed the operation of tmp::clear() for the 1.3 release to force the clearance of temporary objects at the bottom of call-chains irrespective of their reference count, which should be valid if they really are temporary. This improved the storage efficiency of OpenFOAM and hasn't caused any problems so far. Objects for which clearance in this manner is not allowable should not be created as temporaries.

However, I wasn't careful in the handling of assignments to temporaries (not something we do very often in OpenFOAM codes) and your test code does flag-up a problem. Here is a new version of tmpI.H with a corrected handling of object clearance on assignment which solves the problem for your test code and which I now have running in our OpenFOAM test-loop under valgrind.

Henry
henry is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding tmp%2360T classes nadine OpenFOAM Running, Solving & CFD 14 January 22, 2009 09:25
What is the role of tmp%2360T class objects nicasch OpenFOAM Running, Solving & CFD 0 September 17, 2008 03:29
Error glibc detected munmap_chunk invalid pointer sega OpenFOAM Running, Solving & CFD 6 June 3, 2008 18:30
Register pointer to class in mesh objectRegistry kar OpenFOAM 1 June 3, 2008 04:57
Accessing a pointer away from current pointer shephali shrimali FLUENT 0 May 10, 2007 07:54


All times are GMT -4. The time now is 19:33.