file descriptor depletion in the QtHelp plugin

René J.V. Bertin rjvbertin at gmail.com
Wed Oct 17 10:08:20 BST 2018


Hi,

File descriptor depletion has come up a few times in discussions I've been having in the context of rewriting KDevelop's signal handler.

One context where I am used to run into this problem is with QtHelp on Mac, where Qt's Assistant will crash with even a reasonable amount of help files added to the collection. Someone mentioned on the Qt Interest ML that this happens to him too on Linux, though with a much larger help collection. That's when using Qt Creator but since the issue is in QtHelp KDevelop should be equally "at risk".

And indeed, I have started to see KDevelop crash (on Mac) because of file description depletion that disappears when I deactivate the QtHelp plugin, fortunately under certain, evitable conditions (using the XCB QPA instead of the more usual Cocoa QPA).

There's a recent change (in Qt 5.12) that should address the issue: https://codereview.qt-project.org/#/c/203587/ . That version of the QtHelp library builds against my Qt 5.9 install and is backwards compatible so I tested it and can confirm that the Assistant can indeed open normally (on Mac) with a collection that would make it crash with the stock 5.9 QtHelp library. It does not however address the issue in KDevelop, which crashes just as readily with the new QtHelp library.

Given that I now have a reproducible context to trigger the problem I could try to look into what's going on, though until now post-mortem backtraces haven't told me much (the application goes down hard and usually not at a relevant location).
Suggestions welcome, and ideas why this would happen with the XCB QPA and not the Cocoa QPA. I'll start with the obvious mod: bail from QtHelpQtDoc::loadDocumentation() when an error occurs.

R.


More information about the KDevelop-devel mailing list