[Interest] Advice on random program finish crash

alexander golks alex at golks.de
Wed Jan 7 10:50:40 CET 2015


Am Wed, 7 Jan 2015 09:32:21 +0000
schrieb Nuno Santos <nunosantos at imaginando.pt>:

> Hi,
> 
> I’m having a problem with a random crash that not always happens. I would like to have your advice on how to find the origin of it.
> 
> This crash always happens on program exit and the stack trace is the following:
> 
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0   org.qt-project.QtCore         	0x0000000109a03549 QMutexPrivate::allocate() + 105
> 1   org.qt-project.QtCore         	0x0000000109a02d1c QBasicMutex::lockInternal(int) + 92
> 2   org.qt-project.QtCore         	0x0000000109a02c64 QMutex::lock() + 52
> 3   org.qt-project.QtCore         	0x0000000109a0b6fd QWaitCondition::wait(QMutex*, unsigned long) + 173
> 4   org.qt-project.QtCore         	0x0000000109a0aeae QThread::wait(unsigned long) + 110
> 5   org.qt-project.QtNetwork      	0x000000010a4870da QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate() + 58
> 6   org.qt-project.QtNetwork      	0x000000010a48722e QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate() + 14
> 7   org.qt-project.QtCore         	0x0000000109c3e7c7 QObject::~QObject() + 1879
> 8   org.qt-project.QtNetwork      	0x000000010a483c16 QNetworkAccessManager::~QNetworkAccessManager() + 262
> 
> The only particularity of this QNetworkAccessManager is the fact that it is instantiated on a class that is a singleton:
> 
> class Manager : public QObject
> {
> public:
> 
> 	static Manager* sharedManager();
> 
> 	...
> 
> 	QNetworkAccessManager* networkAccessManager();
> 
> 	...
> 
> protected:
> 
> 	Manager();
> 	~Manager();
> 
> 	...
> 	
> 	QNetworkAccessManager _networkAccessManager;
> };
> 
> 
> Manager* Manager::sharedManager()
> {
> 	QMutexLocker lock(&managerMutex);
> 	static Manager manager;
> 	return &manager;
> }
> 
> Manager::Manager() :
> 	_networkAccessManager()
> {
> 	...	
> }
> 
> Manager::~Manager()
> {
> 	
> }
> 
> Is there any obvious reason for this crash to happen randomly at program termination?
> 
> Thanks,
> 
> Regards,
> 
> Nuno Santos
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

i have not a real advice, but perhaps a hint. i last had strong problems which lead to nearly same stacktraces due to the fact:
- that i deleted running QThread*
- that i had QObject* deletedLater() in wrong threads
and well, static qobjects are not always easy to handle.

perhaps you should check for runtime warnings comming from qt, related to thread affinity problems?

alex

-- 
/*
 *  printk("Illegal format on cdrom.  Pester manufacturer.\n");
 *          linux-2.2.16/fs/isofs/inode.c
 */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150107/79f493eb/attachment.sig>


More information about the Interest mailing list