On architectures where the stack grows upwards (i.e. HP PA-RISC) the
stack limit calculation fails because the variables used to check the
offset are usually close to the bottom of the stack, which is in this
case the origin of the stack grows. Since these machines are a rare
obscurity simply assume that everything is fine on these machines. The
few people that are indeed running QML on such machines will probably
be able configure their stack size properly by default.
Task-number: QTBUG-44268
Change-Id: Ia83a39179a0f6e0602ba7a5032d386e12d8d1ba3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
} else
size = pthread_get_stacksize_np(thread_self);
stackLimit -= size;
+# elif defined(__hppa)
+ // On some architectures the stack grows upwards. All of these are rather exotic, so simply assume
+ // everything is fine there.
+ // Known examples:
+ // -HP PA-RISC
+ stackLimit = 0;
+
# else
- void* stackBottom = 0;
pthread_attr_t attr;
#if HAVE(PTHREAD_NP_H) && OS(FREEBSD)
// on FreeBSD pthread_attr_init() must be called otherwise getting the attrs crashes
#else
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
#endif
+ void *stackBottom = Q_NULLPTR;
size_t stackSize = 0;
+
pthread_attr_getstack(&attr, &stackBottom, &stackSize);
pthread_attr_destroy(&attr);