View Issue Details

IDProjectCategoryView StatusLast Update
0001009OpenFOAMBugpublic2013-09-18 13:22
Reporterwyldckat Assigned Touser2 
PrioritylowSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Summary0001009: isAbsolute() should be used in IOobject::fileNameComponents()
DescriptionOne detail concerning the modifications related to Issue #62 ( http://www.openfoam.org/mantisbt/view.php?id=62 ) did not propagate to OpenFOAM 2.2.x.

More specifically, as shown in the attached patch file, in the file "src/OpenFOAM/db/IOobject/IOobject.C", using "first == 0" in "IOobject::fileNameComponents()" is not generic.
The generic implementation should use "path.isAbsolute()" instead, in order to properly detect if it truly is the absolute path.
Additional InformationCurious detail which I found while diagnosing this: if the debug flag "objectRegistry" in the global "controlDict" is set to 1, it will crash any OpenFOAM solver/utility, right after the message that starts with:
  Destroying regIOobject called controlDict

For example, with icoFoam and blockMesh, this only occurs after the end of the run. But with snappyHexMesh, it happens a lot sooner.

It's a bit annoying to not know this beforehand, since I was using GDB and trying to figure out why on Earth it was still crashing after the reported fix... :)
TagsNo tags attached.

Activities

wyldckat

2013-09-12 18:43

updater  

using_isAbsolute.patch (469 bytes)   
--- a/src/OpenFOAM/db/IOobject/IOobject.C
+++ b/src/OpenFOAM/db/IOobject/IOobject.C
@@ -94,9 +94,9 @@ bool Foam::IOobject::IOobject::fileNameComponents
         // check afterwards
         name.string::operator=(path);
     }
-    else if (first == 0)
+    else if (path.isAbsolute())
     {
-        // Leading '/'. Absolute fileName
+        // called with absolute path
         string::size_type last = path.rfind('/');
         instance = path.substr(0, last);
 
using_isAbsolute.patch (469 bytes)   

user2

2013-09-18 13:22

  ~0002496

Thanks for the report - fixed by commit cbdfba

Issue History

Date Modified Username Field Change
2013-09-12 18:43 wyldckat New Issue
2013-09-12 18:43 wyldckat File Added: using_isAbsolute.patch
2013-09-18 13:22 user2 Note Added: 0002496
2013-09-18 13:22 user2 Status new => resolved
2013-09-18 13:22 user2 Fixed in Version => 2.2.x
2013-09-18 13:22 user2 Resolution open => fixed
2013-09-18 13:22 user2 Assigned To => user2