Hi

I had a boost::thread_resource_error now on several different parts of
the code. That's why I've now added logging and exception-handling for
every event to keep the application running as long as possible and to
find out, which events can end up in this error.

You were talking about pointers that are garbage because of wrong code.
=> Couldn't it be possible, that sometimes pointers are valid, as long
as passed, but in the meantime (before the boost-binding is executed)
the corresponding objects are already destroyed? Think of a
"userStateChanged" event (if this exists) when somebody goes offline =>
While one thread wants to remove this contact from the contactlist,
another thread could be deleting this object. => Are there no such
"doubled-bindings" that could lead to exactly this situation?

Cheers, Pirmin

> I did my own investigations, and I believe I have an explanation for 
> this (but not for the crash :-( ). Here it is:
> 
> All begins in CContactList::contactMovedEventHandler(). It creates a 
> ThreadEvent3<std::string, std::string, std::string> event (let's call it 
> event3) and posts it using PFactory::postEvent().
> 
> The Qt implementation of PFactory::postEvent() wraps the event it 
> received in a QtThreadEvent (let's call it qtevent), and posts qtevent 
> using QCoreApplication::postEvent().
> 
> ThreadEventFilter::eventFilter() receives all events posted using 
> QCoreApplication::postEvent(), so it receives qtevent, casts it to a 
> QtThreadEvent and calls qtevent->callback().
> 
> qtevent wraps event3, so qtevent->callback() calls event3->callback().
> 
> The reason why you don't see the code going through 
> QtThreadEvent::callback() is probably because the code for this method 
> is in QtThreadEvent.h, so it's inlined by the compiler and does not 
> appear in the backtrace.
> 
> As a conclusion, I would say that the event system is working correctly. 
> If the pointers passed to event3 are garbage, this is probably caused by 
> wrong code in either CContactList or ContactList. It would be nice if 
> you could get to check if the references passed to 
> CContactList::contactMovedEventHandler are valid.
> 
> Aurélien
> 

_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

Reply via email to