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

Segmentation Fault when using class based on KinematicParcel in parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2008, 16:34
Default Version: 1.5 How to reprodu
  #1
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Version: 1.5

How to reproduce: Using the rhoTurbTwinParcelFoam and the simplifiedSiwek-case. Decompose the case for 8 processors. The run fails at the first timestep with a segmentation fault:

[7] #6 Foam:stream& Foam::operator<<>(Foam:stream&, Foam::KinematicParcel<foam::basicthermoparcel> const&) at ~/OpenFOAM/OpenFOAM-1.5-debug/src/lagrangian/intermediate/lnInclude/KinematicPar celIO.C:218

The problem seems to be the line there
reinterpret_cast<const>(p.typeId()),
because typeID() is the only accessor-method in KinematicParcel that doesn't have a return-reference variant. So propably that cast trys to access the address of the returned temporary value (and the memory following it)

Possible fixes:

1. Quick and dirty: replace that line with
reinterpret_cast<const>(&p.typeId_)

2. Add a reference-variant for typeId() and do it like Thermo & ReactingParcel:
reinterpret_cast<const>(
&const_cast<kinematicparcel<parceltype>&>(p).typeI d()
),
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   August 18, 2008, 07:18
Default Thanks - we put it in.
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Thanks - we put it in.
mattijs 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
Segmentation fault with parallel computing Prad Main CFD Forum 0 December 11, 2008 08:44
Segmentation fault. Nari Siemens 3 November 8, 2007 06:04
Segmentation fault billy OpenFOAM Installation 20 April 23, 2007 23:57
Segmentation Fault Victor Main CFD Forum 5 April 5, 2005 09:09
Fluent parallel: segmentation fault? hp FLUENT 2 September 6, 2001 15:18


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