CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   FATAL ERROR hanging pointer cannot dereference (https://www.cfd-online.com/Forums/openfoam-solving/60009-fatal-error-hanging-pointer-cannot-dereference.html)

tsencic September 18, 2006 07:16

When I tried to run dieselEngi
 
When I tried to run dieselEngineFoam on a simulation that run perfectly before I obtained this:

--> FOAM FATAL ERROR : hanging pointer, cannot dereference

From function PtrList::operator[]
in file /home/tom/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/PtrListI.H at line 92.
FOAM aborting

What is the reason? How can I solve the problem?

stefanke September 18, 2006 07:45

Well, this information is not
 
Well, this information is not enough to say what is going wrong here. Is there no backtrace information available?

Check your dictionary files carefully!

tsencic September 18, 2006 09:00

This is the complete message:
 
This is the complete message:

Executing: /home/tom/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/dieselEngineFoam /home/tom/OpenFOAM/tom-1.3/run/. EMD8-spray > /home/tom/OpenFOAM/tom-1.3/run/./EMD8-spray/log &
tom@snjofko:~/OpenFOAM/tom-1.3/run>

--> FOAM FATAL ERROR : hanging pointer, cannot dereference

From function PtrList::operator[]
in file /home/tom/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/PtrListI.H at line 92.

FOAM aborting

Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
Foam::error::abort()
/home/tom/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/dieselEngineFoam [0x806fd9a]
/home/tom/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/dieselEngineFoam [0x805ead2]
__libc_start_main
__gxx_personality_v0

The dictionary files are coppied from a previous, succesfull simulation.

zqlhzx December 12, 2013 04:18

Quote:

Originally Posted by tsencic (Post 185556)
When I tried to run dieselEngineFoam on a simulation that run perfectly before I obtained this:

--> FOAM FATAL ERROR : hanging pointer, cannot dereference

From function PtrList::operator[]
in file /home/tom/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/PtrListI.H at line 92.
FOAM aborting

What is the reason? How can I solve the problem?

I have the same problem with you,Do you have solver it?

NICKTAVOUKT March 27, 2018 08:47

Hi all,

I'm getting a similar error with above. To give you some context I have wrote a solver which based on interFoam/waveFoam and combined it with the solid particle class in OF5

when I run it I get the following error:
Quote:

--> FOAM FATAL ERROR:
hanging pointer at index 0 (size 9), cannot dereference
From function const T& Foam::UPtrList<T>::operator[](Foam::label) const [with T = Foam::fvsPatchField<double>; Foam::label = int]
in file /apps/openfoam/5.0.x/gcc/7.2.0/OpenFOAM-5.0/src/OpenFOAM/lnInclude/UPtrListI.H at line 107.
FOAM aborting
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary::Boundary(Foam::Dimen sionedField<double, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::Boundary const&) at ??:?
#3 Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricField(Foam::Geometric Field<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#4 ? at ??:?
#5 __libc_start_main in "/lib64/libc.so.6"
#6 ? at ??:?
could someone kindly explain what UPtrListI.H does?

Thanks,
Nick

bbita August 2, 2018 01:40

Hi Nick,

I am wondering if you find the solution to this problem. I am experiencing the same issue.

Thanks.

shanvach January 23, 2019 14:25

hanging pointer at index 0 (size 3), cannot dereference
 
Hi all,

I have been getting this error while my running twoPhaseEulerFoam code. I have added a file called scalarTransport.H that solves for Scalar Transport Equation in addition to solving of the phases.

My scalarTransport.H is as follows:

Code:

dimensionedScalar dimen
(
"dimen",
dimensionSet(0,0,1,0,0,0,0),
scalar(1.0)
);
dimensionedScalar dimen1
(
"dimen1",
dimensionSet(0,0,-1,0,0,0,0),
scalar(1.0)
);
volTensorField grU_2 = (fvc::grad(U2))*dimen;
volScalarField sc = grU_2 && (grU_2 + grU_2.T());
const scalar a  = 4e-6;

dimensionedScalar dir_ste
(
"dir_ste",
dimensionSet(0,0,2,0,0,0,0),
scalar(1.0)
);
//const scalar a  = 4e-6;
const scalar K = 1;
volScalarField dsid = 0.7*.3*a*a*sc*alpha2*alpha2*dir_ste*dimen1*dimen1;
const scalar dbr = (1.380648e-23)*300/(6*3.142*(1.5e-3)*(4e-6));
volScalarField dbro = ((1.0-alpha2)/(1+0.95*alpha2))*(dbr/K);

volScalarField dnp = (dsid + dbro)*DT;

               
fvScalarMatrix scalarEqn
           
 (
                 
  fvm::ddt(psi)           
               
+ fvm::div(phi2,psi)       
               
- fvm::laplacian(dnp,psi)
               
);
 

  scalarEqn.solve();

The code compiles correctly but gives the following error at runtime.

Code:

--> FOAM FATAL ERROR:
hanging pointer at index 0 (size 3), cannot dereference

    From function const T& Foam::UPtrList<T>::operator[](Foam::label) const [with T = Foam::fvPatchField<double>; Foam::label = int]
    in file /usr/local/apps/OpenFOAM/gcc482-v1706/OpenFOAM-v1706/src/OpenFOAM/lnInclude/UPtrListI.H at line 107.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::UPtrList<Foam::fvPatchField<double> >::operator[](int) const at ??:?
#3  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::Boundary(Foam::DimensionedField<double, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary const&) at ??:?
#4  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#5  ? at ??:?
#6  __libc_start_main in "/lib64/libc.so.6"
#7  ? at ??:?

How do I rectify this?
Your help in this matter is greatly appreciated.

Thanks and Regards,
Shantanu

shiyu November 4, 2020 01:09

Hi all,
Did anyone figure this problem out? I have exactly the same issue as above.

Thanks in advance.

Cheers,Shiyu

ttsurvase January 7, 2021 03:10

The issue is the pointer created by user is empty or null. Check what is size of pointerlist. In my case, i didnt assigned value to ptrlist and i was calling using[] operator. Hope it helps.


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