Philipp Thomas wrote:
You should also provide the code of RunSet, at least the relevant parts, otherwise it's hard to see why the constructor fails.
alan@ibgames.com wrote:
I'd need to see the definition of runset, and the constructor to help...
OK, that itself is helpful. I'd forgotten to look in the most obvious
place (and forgotten to switch of optimisation before debugging ;-( )
When constructing RunSet on the stack, I get a segmentation fault during
dynamic_cast in setStream(). I don't understand that one at all. I can
work around this one, but I'd really like to know what's going on here
in case there's a more subtle bug lurking.
Does anyone know what "warning: can't find class named `ssc::RunSet', as
given by C++ RTTI" means? (See debug info below)
RunSet::RunSet(){
result = new Result( stream );
result->setShowIntroduction( true );
result->setShowOutput( true );
result->setShowSummary( true );
setStream( &std::cout, "output" );
algorithm = 0;
multipleRuns = 0;
upperBounds = 0;
lowerBounds = 0;
resultType = BEST;
}
void RunSet::setStream( std::ostream* stream,
const std::string stream_name ){
if( dynamic_caststd::ofstream*( this->stream ) )
delete this->stream;
this->stream = stream;
/* propagate to result and algorithm->result */
result->setStream( this->stream );
if( algorithm != 0 )
algorithm->setStream( this->stream );
this->stream_name = std::string( stream_name );
}
Program received signal SIGSEGV, Segmentation fault.
0x4029834f in __dynamic_cast () from /usr/lib/libstdc++.so.5
(gdb) #1 0x080768c4 in ssc::RunSet::setStream(std::ostream*, std::string) (
this=0xbffff3e0, stream=0x80ab0f8, stream_name=
{static npos = 4294967295, _M_dataplus = {