[Interest] Advice on random program finish crash

Nuno Santos nunosantos at imaginando.pt
Wed Jan 7 10:32:21 CET 2015


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


More information about the Interest mailing list