Developer Blog -
  • Skipper - The ORM Designer
  • VsBuilds - Parallel building
  • Pulpo - Free Skipper CLI

Crash in QTreeWidget / QTreeView index mapping on Mac OSX 10.10

This crash took me about 40hr+ to replicate and find a way how to eliminate it (unfortunately not to fix it). This crash occurred only on OS X 10.10, not 10.9, not Linux, not Windows.


Bug occurred in slightly modified QtTreePropertyBrowser where we have additional buttons for each property.


When any of these buttons caused property tree refresh, application randomly crashed. But when these actions were executed by buttons outside of the property tree, everything worked fine.

Thread 0 Crashed:: Dispatch queue:<br />
0   org.qt-project.QtWidgets      	0x0000000103f49290 QTreeModel::index(QTreeWidgetItem const*, int) const + 176<br />
1   org.qt-project.QtWidgets      	0x0000000103f4950b QTreeModel::parent(QModelIndex const&amp;) const + 75<br />
2   org.qt-project.QtWidgets      	0x0000000103f23bb7 QTreeView::isIndexHidden(QModelIndex const&amp;) const + 71<br />
3   org.qt-project.QtWidgets      	0x0000000103f17e0d QTreeView::visualRect(QModelIndex const&amp;) const + 93<br />
4   org.qt-project.QtWidgets      	0x0000000103ec490d QAccessibleTableCell::rect() const + 29<br />
5   org.qt-project.QtWidgets      	0x0000000103ec46f2 QAccessibleTableCell::state() const + 146<br />
6   libqcocoa.dylib               	0x00000001071913aa QCocoaAccessible::hasValueAttribute(QAccessibleInterface*) + 58<br />
7   libqcocoa.dylib               	0x000000010718df7e -[QMacAccessibilityElement accessibilityAttributeNames] + 398<br />
8              	0x00007fff95dea26e NSAccessibilityEntryPointAttributeNames + 115<br />
9              	0x00007fff95e275af -[NSObject(NSAccessibilityInternal) _accessibilityAttributeNamesClientError:] + 56<br />
10              	0x00007fff95e2a62a CopyAttributeNames + 216<br />
11          	0x00007fff9768cbce _AXXMIGCopyAttributeNames + 252<br />
12          	0x00007fff976950c6 _XCopyAttributeNames + 385<br />
13          	0x00007fff97671109 mshMIGPerform + 199<br />
14      	0x00007fff99259c79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41<br />
15      	0x00007fff99259beb __CFRunLoopDoSource1 + 475<br />
16      	0x00007fff9924b767 __CFRunLoopRun + 2375<br />
17      	0x00007fff9924abd8 CFRunLoopRunSpecific + 296<br />
18           	0x00007fff9695d56f RunCurrentEventLoopInMode + 235<br />
19           	0x00007fff9695d2ea ReceiveNextEventCommon + 431<br />
20           	0x00007fff9695d12b _BlockUntilNextEventMatchingListInModeWithFilter + 71<br />
21              	0x00007fff95a489bb _DPSNextEvent + 978<br />
22              	0x00007fff95a47f68 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346<br />
23  libqcocoa.dylib               	0x000000010717b29d QCocoaEventDispatcher::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) + 2093<br />
24  org.qt-project.QtCore         	0x0000000104b0337d QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) + 381<br />
25  org.qt-project.QtWidgets      	0x0000000103e6c192 QDialog::exec() + 514<br />

I updated methods from signals-slots mechanism to QEvent system. Unfortunately this didn't help as well. Next attempt was QTimer usage instead of QEvent or signal-slot to simulate real click. But also without any success.

0   org.qt-project.QtWidgets      	0x000000011112f62e QTreeModel::data(QModelIndex const&amp;, int) const + 46<br />
1   org.qt-project.QtWidgets      	0x00000001110aa7bb QAccessibleTableCell::state() const + 347<br />
2   libqcocoa.dylib               	0x00000001143913aa QCocoaAccessible::hasValueAttribute(QAccessibleInterface*) + 58<br />
3   libqcocoa.dylib               	0x000000011438df7e -[QMacAccessibilityElement accessibilityAttributeNames] + 398<br />
4              	0x00007fff95dea26e NSAccessibilityEntryPointAttributeNames + 115<br />
5              	0x00007fff95e275af -[NSObject(NSAccessibilityInternal) _accessibilityAttributeNamesClientError:] + 56<br />

With a lot of luck I finally found the reason for the crash. It's caused by erasing a property tree (and inner QTreeWidget) together with an active focus on this widget. Unfortunately I'm not able to fix it in the QtCore because according to callstack there is only some QModelIndex manipulation without any sight of what's going wrong.


The effective solution how to fix this wrong behaviour is to temporally set focus to another widget (or parent), clear the tree and set focus back to property tree. Unfortunately this solution doesn't work. Check part II of this article for better solution

  QWidget* pObject = qobject_cast&lt;QWidget*&gt;(m_propertyBrowser-&gt;parent());<br />
  if (pObject!=NULL);<br />
    pObject-&gt;setFocus();<br />
	m_propertyBrowser-&gt;clear();<br />
  m_propertyBrowser-&gt;setFocus();<br />

If anyone know how to fix that, I will be glad for any info.

18 May 2015

Wordpress upgrade

Error message:

wordpress update Could not create directory<br />
This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php<br />


#set persmissions for writing to all<br />
find -type d -print0 | xargs -0 chmod 777<br />
find -type f -print0 | xargs -0 chmod 666</p>
<p>#revert back<br />
find -type d -print0 | xargs -0 sudo chown deploy<br />
find -type f -print0 | xargs -0 sudo chown deploy</p>
<p>find -type d -print0 | xargs -0 chmod 755<br />
find -type f -print0 | xargs -0 chmod 664</p>
<p>#set permissions to correct user<br />
sudo chown deploy ./wp-includes/js/tinymce/plugins/wpemoji/*</p>

Additional links

25 Apr 2015

Posted by: ludek.vodicka

Linux #Linux #wordpress

OS X codesign failed: bundle format is ambiguous (could be app or framework)

This error can be caused by many things but I know about one more which I didn't find anywhere else ;-).

In case you compile and deploy your app by using qtmacdeploy and sign your application immediately, everything will probably works fine. The problem occurs, when you need to copy your application to different location (for example during dmg building). In such cases, this error can occur:

bundle format is ambiguous (could be app or framework)<br />

Althought codesign is executed as always, singing isn't successful:

codesign --deep --force --verbose --sign &quot;$SIGNNAME&quot; ./<br />
/path/ bundle format is ambiguous (could be app or framework)<br />

The problem is, that during the copy it's necessary to keep all symbolic links inside frameworks. Without this, singing will fail.

So instead of

cp -r ./Source ./Destination<br />

it's necessary to use

cp -R ./Source ./Destination<br />
05 Mar 2015

Posted by: ludek.vodicka

Mac OS #MacOs #certificate #codesign #singing

QDialog::reject can be invoked multiple times

When user use ESC to close the dialog and press it very quickly two or more times in a row, QDialog::reject can be invoked also multiple times.

This is very dangerous and unpredictable because in case your reject will contain some one-time-execute routine the application will start crashing.

The only solution I found is to add these routines to QDialog destructor instead of to reject/accept.

24 Feb 2015

Posted by: ludek.vodicka

Programming Qt #Qt #qtgui

S3 usage statistics

13 Feb 2015

Posted by: ludek.vodicka

Programming Linux #s3 #statistics

Execute jenkins build from command line

curl -X POST --user user:apitoken http://server/job/JOB_NAME/build?delay=0sec<br />

Api token:

http://server/user/USER_NAME/configure<br />
11 Feb 2015

Posted by: ludek.vodicka

Programming #jenkins

Keyboard and mouse recording tools

09 Feb 2015

Codesign asking for credentials for on every usage

Apple OS X codesing

to fix that, it's sufficient to configure certificate to allow any application to use it without asking:

KeyChain - allow access (step 1)

KeyChain - step 2


External links

08 Feb 2015

Posted by: ludek.vodicka

Programming Mac OS #certificate #codesign

perl: warning: Setting locale failed

sudo locale-gen en_US en_US.UTF-8<br />
sudo dpkg-reconfigure locales<br />
sudo update-locale<br />
07 Feb 2015

Posted by: ludek.vodicka


How to update gcc to 4.8.1 on any ubuntu

Everything is perfectly explained in this post:

List of commands

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update; sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
gcc --version
06 Feb 2015

Posted by: ludek.vodicka

Programming Linux #Linux #C++ #gcc

Page: 2 of 19