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

Error%7eerror triggers crash after handling exceptions thrown by errorexit twice

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 3, 2007, 10:16
Default Description: The delete messa
  #1
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
Description:
The delete messageStreamPtr_; line in error::~error() triggers crash after handling *this object thrown in error::exit() twice if throwExceptions_ is set to true. I think this is because throw *this; in error::exit() actually throws a temporary bitwise copy of *this (even if the object is caught by reference), and the destructor of the temporary object deletes *messageStreamPtr_ of the static object FatalError or FatalIOError (which must not be deleted except when the application terminates). Thus, the first exception handling deletes *messageStreamPtr_, while the second one triggers crash trying to delete the already deleted *messageStreamPtr_.

Solver/Application:
All that sets FatalError.throwExceptions() and FatalIOError.throwExceptions().

Source file:
src/OpenFOAM/db/error/error.C

Testcase:
I'm not sure if you get the description above... I'll be posting a testcase if that is the case.

Platform:
linux64

Version:
1.4

Notes:
7islands is offline   Reply With Quote

Old   September 3, 2007, 17:16
Default Thanks for the detailed bug re
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
Thanks for the detailed bug report. To fix this bug in OpenFOAM version 1.4.1 replace OpenFOAM-1.4.1/src/OpenFOAM/db/error/error.H with error.H , OpenFOAM-1.4.1/src/OpenFOAM/db/error/error.C with error.C and OpenFOAM-1.4.1/src/OpenFOAM/db/IOstreams/StringStreams/OStringStream.H with OStringStream.H and recompile the OpenFOAM library.
henry is offline   Reply With Quote

Old   September 4, 2007, 05:24
Default Tried the fix with 1.4.1. It w
  #3
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
Tried the fix with 1.4.1. It works perfectly. Thanks!

Takuya
7islands 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
Energy handling with STAR Veera Siemens 1 June 20, 2004 11:06
Very large martix handling Vinay Kumar Main CFD Forum 5 December 9, 2002 10:07
handling conduction in CFX Trushar CFX 1 October 7, 2002 17:39
macros handling vectors sivakumar FLUENT 0 January 18, 2002 16:16
regarding low pressure handling subodh kumar Main CFD Forum 1 November 20, 1999 22:23


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