You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
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().
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.
We'd consider accepting this patch after Qt has done so. I'd personally recommend submitting this to their Gerrit rather than Jira (as they actually look at their Gerrit).
In the mean time, the following addition to the recipe works.
Execute brew edit qt4 and add this before the line that starts with head:
patch :p0 do
url "https://bugreports.qt.io/secure/attachment/52520/patch-qthread-stacksize.diff"
sha256 "477630235eb5ee34ed04e33f156625d1724da290e7a66b745611fb49d17f1347"
end
(bug submitted upstream, https://bugreports.qt.io/browse/QTBUG-49607)
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 https://bugreports.qt.io/browse/QTBUG-2568.
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 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.
patch is for Qt 4.8.7, but very easy to adapt for Qt 5.5.1 (apply to qtbase/src/corelib/thread/qthread_unix.cpp)
patch file: https://bugreports.qt.io/secure/attachment/52514/patch-qthread-stacksize.diff
The text was updated successfully, but these errors were encountered: