[MacPorts] #49793: qt4/5: set default QThread thread stack size to a reasonable value

MacPorts noreply at macports.org
Tue Nov 24 01:02:34 PST 2015


#49793: qt4/5: set default QThread thread stack size to a reasonable value
---------------------------------+--------------------------------
 Reporter:  frederic.devernay@…  |      Owner:  macports-tickets@…
     Type:  defect               |     Status:  new
 Priority:  Normal               |  Milestone:
Component:  ports                |    Version:  2.3.4
 Keywords:                       |       Port:  qt4-mac qt5-mac
---------------------------------+--------------------------------
 OS X provides no way to set the default stack size for threads (it is
 always 512k), whereas the main thread stack size (default is 8M) can be
 set by setrlimit().

 QThreadPool provides no way to change the stack size from the default.
 This, and the fact that clang does not optimize stack usage as well as gcc
 does, may cause stack overflow in programs that would run very well on
 linux or windows. Computation-intensive applications are affected by this
 problem.

 This patch (also proposed upstream
 [https://bugreports.qt.io/browse/QTBUG-2568]) does the same fix as in
 Chromium
 [https://chromium.googlesource.com/chromium/src.git/+/master/base/threading/platform_thread_mac.mm#186],
 and gives the same behaviour as on Linux:

 If the thread stack size is not set explicitely, it is set to at least the
 same value as the main thread.

 This patch is for Qt 4.8, but Qt 5 is easy to fix the same way.

-- 
Ticket URL: <https://trac.macports.org/ticket/49793>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list