1 view
Skip to first unread message

Jul 30, 2011, 9:00:07 AM7/30/11
to SpoVNet
I followed the "Threading and the SystemQueue" Examples on the ariba
website for a proper threading solution, and tried to subclass
BlockingMethod in order to read from disc.

The problem is, even a minimal implementation always crashes on
"dispatch();" with the error message:
> pure virtual method called
> terminate called without an active exception
> Abgebrochen

In the ariba code I found this possible source of error:


void handleSystemEvent(const SystemEvent& event);

but in it's superclass SystemEventListener.h:
public: // should be private, see comments in SystemEvent.h
virtual void handleSystemEvent( const SystemEvent& event ) = 0;

But changing both functions beeing either public or protected and
adding "virtual" in BlockingMethod.h didn't fix the problem.


My code looks as follows:


#include "ariba/utility/system/BlockingMethod.h"
using ariba::utility::BlockingMethod;

class Blocking_buffer : public BlockingMethod
virtual ~Blocking_buffer();

void test_loop(Useroutputinterface* ui);

virtual void blockingFunction();
virtual void dispatchFunction();

bool running;
int counter;

#endif /* BLOCKING_BUFFER_H_ */


#include "Blocking_buffer.h"

Blocking_buffer::Blocking_buffer() : running(false), counter(0)


void Blocking_buffer::test_loop(Useroutputinterface* ui)
if ( ! running )
running = true;

cout << "BEFORE blocking function" << endl;
// blockingFunction();
cout << "AFTER blocking function" << endl;

/** BlockingMethod Inteface **/
void Blocking_buffer::blockingFunction()

void Blocking_buffer::dispatchFunction()
cout << "DISPATCH function" << endl;
running = false;

It always crashes on "dispatch();".

I don't believe the bug is on my side and hope it can be investigated

Best regards, Mario

Christoph Mayer

Jul 30, 2011, 2:10:34 PM7/30/11
to SpoVNet
Hi, I integrated your exact code into the pingpong sample and it
worked perfectly. Are you actually compiling Blocking_buffer.cpp in
the It rather seems to me that the pure virtual function
results from the fact that the object file of the class is not
compiled into the executable.


On 30 Jul., 15:00, "" <>

Jul 31, 2011, 12:42:03 PM7/31/11
to SpoVNet
Hello Christoph, thank you for your quick reply.

Hm, I followed your example and also integrated the Blocking_buffer
into the Pingpong sample. But here I get the same errors. I also
double checked the ;-) The program makes it to:
> BEFORE blocking function
> AFTER blocking function

and then crashes with:
> pure virtual method called
> terminate called without an active exception
> Aborted

Could you please send me your pingpong folder as tar.gz (or
something), probably my fault lies somewhere I don't expect it...

On which compliler did you build it? I tried it under ubuntu 10.10 and
in the Contest-VM.
A bit strange is also that on ubuntu 10.10 it crashes after sleep(5)
on dispatch but in the VM it crashes just after "AFTER blocking

Which version of ariba do you use? I have 0.7.0. What about the
missing "virtual" in BlockingMethod.h, does it run's on your machine

Kind regards, Mario

Aug 1, 2011, 5:28:47 AM8/1/11
to SpoVNet
Hello Christoph,

thank you for your assistence. Your Pingpong code also works fine
here, with ariba-0.7.0.
I tracked down the problem that the crash always happens when creating
the Blocking_buffer on the stack. Afterwords not so surprising at all,
as the Blocking_buffer is destroyed before dispatch is invoked.. The
error messages of c++ sometimes can just be a little bit confusing.

Regards, Mario
Reply all
Reply to author
0 new messages