CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Bugs

Segmentation Fault when using class based on KinematicParcel in parallel

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   August 13, 2008, 15:34
Default Version: 1.5 How to reprodu
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
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
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

2. Add a reference-variant for typeId() and do it like Thermo & ReactingParcel:
&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, 06:18
Default Thanks - we put it in.
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
Thanks - we put it in.
mattijs is offline   Reply With Quote


Thread Tools
Display Modes

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 On
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 CD-adapco 3 November 8, 2007 06:04
Segmentation fault billy OpenFOAM Installation 20 April 23, 2007 22:57
Segmentation Fault Victor Main CFD Forum 5 April 5, 2005 08:09
Fluent parallel: segmentation fault? hp FLUENT 2 September 6, 2001 14:18

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