This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ compiled executable calls the wrong function
- From: Ben Dorman <ben dot dorman at gsfc dot nasa dot gov>
- To: bug-gcc at gnu dot org, gordon at milkyway dot gsfc dot nasa dot gov
- Date: Thu, 15 Nov 2001 17:08:17 -0500
- Subject: g++ compiled executable calls the wrong function
- Organization: NASA/GSF Laboratory for High Energy Astrophysics
[Get raw message]
Dear Sirs/Mesdames: I have come across a problem that I do not know how
to categorize
or isolate and I am writing to you to ask whether you can think of
anything that might help
track this down. I understand that this doesn't fit within the usual bug
submissions, but
hope you might have some advice as this does appear to be a bug: it is
persistent and
reproducible. I do not know how to go about reproducing this as a small
example, because
I have ~ 70K code lines.
I am porting this code, currently under development from Solaris to
Linux. The code as written
executes correctly on Solaris using SunPro CC 5.1. My linux
configuration is:
platform: RHL 7.1 2.4.2-smp kernel
gcc version: 3.0.1 & 3.0.2
problem: wrong code called:
in the snippet below, dSet resolves to a subclass of DataSet, (say
ODataSet) which
inherits from class O and from DataSet.
instead of calling ODataSet::initialize, something else is called [
O::isQuality]
later, inside the call to DataSet::setData , line 11,
a function called ODataSet::setArrays is to be called. Instead,
ODataSet::initialize is called, which
puts the program into a race condition.
> 1 try
> 2 {
> 3 std::auto_ptr dSet(p->MakeDataSet());
> 4 dSet->initialize(p,*record);
> 5 size_t group = record->groupNumber();
> 6 const IntegerArray& SN = record->spectrumNumber();
> 7 const IntegerArray& dataRow = record->spectrumRange();
> 8 size_t ns = SN.size();
> 9 for (size_t j = 0; j < ns; ++j)
> 10 {
> 11 dSet->setData(SN[j],group,dataRow[j]);
> 12 }
> dSet->closeSourceFiles();
> std::cerr << " after setData \n";
> record->data(dSet.release());
> ++record;
> }
> catch (XSparse::AbortLoop)
> {
> // /* was entered, remove the rest of the input arguments
> // and stop processing this loop.
> while (record != inputData.end()) record = inputData.erase(record);
> break;
> }
> catch (YellowAlert&)
> {
> // problem processing data: remove current iteration
> // and continue.
> record = inputData.erase(record);
> continue;
> }
>
I would be grateful for any suggestions.
Thanks in advance,
Ben Dorman
--
==============================================================
Ben Dorman, Ph.D. Lead Programmer Analyst, Emergent IT
Xspec Technical Support: http://xspec.gsfc.nasa.gov
Laboratory for High Energy Astrophysics Tel: [301]-286-9261
Code 664, NASA/GSFC, Greenbelt MD 20771 Fax: [301]-286-1629
e-mail:Ben.Dorman@gsfc.nasa.gov