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

OpenFOAM 1.7.1 and gcc 4.6.3: scalarField no bounds check?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 26, 2012, 09:37
Default OpenFOAM 1.7.1 and gcc 4.6.3: scalarField no bounds check?
  #1
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16
adhiraj is on a distinguished road
Hi
I am using OpenFOAM-1.7.1 and gcc 4.6.3 in Ubuntu. I noticed that when the code is compiled in Optimized mode, I can access elements outside of scalarField bounds without segfaulting.
So if you have a scalarField a(10) and you write
Code:
Info<<a[100]<<endl;
you get zero instead of a segfault.
In the debug version you get an error when you run, telling you that the index is not within limits.

This is unlikely to be an OpenFOAM problem, for in gcc 4.3.3, OpenFOAM 1.7.1 segfaults on array bound exceeding, as it should.

Any thoughts/comments welcome.
adhiraj is offline   Reply With Quote

Old   May 26, 2012, 10:20
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Adhiraj,

It was for these reasons that I created this page: http://openfoamwiki.net/index.php/In...tion_.28GCC.29
As you can see, Gcc 4.6.3 is incompatible with OpenFOAM 1.7.1.

You can try and look in the OpenFOAM 2.0.x and 2.1.x git repositories for the modifications required for things to work as intended with Gcc 4.6.

Best regards,
Bruno
__________________
wyldckat 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
OpenFOAM 1.7.1 installation problem on Fedora 14 armonica OpenFOAM Installation 16 March 31, 2011 14:16
OpenFOAM 1.6.x, 1.7.0 and 1.7.x are not fully prepared to work with gcc-4.5.x wyldckat OpenFOAM Bugs 18 October 21, 2010 06:51
How to Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 15:43
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 14:43
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07


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