diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-10-03 15:17:41 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-03 15:35:43 +0200 |
commit | 2b01ffe5526ff90b3cad85b2430825f0a0733651 (patch) | |
tree | 0faa0e53485d27036c26afd2d115b50fe310c19e /src/plugins/platforms/ios/qioseventdispatcher.mm | |
parent | d920af378c9f705b1d5cb06a2e71e6155644e215 (diff) |
iOS: Use PROT_READ, not PROT_NONE, for custom stack memory guard
This allows V4 and other garbage collectors to pass through our
custom stack during the mark-phase without triggering access
violations.
Change-Id: Icafcf4df3537c628c641fe694bb9fe2016519a83
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qioseventdispatcher.mm')
-rw-r--r-- | src/plugins/platforms/ios/qioseventdispatcher.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm index 6148338000..3de7c996f5 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.mm +++ b/src/plugins/platforms/ios/qioseventdispatcher.mm @@ -148,8 +148,10 @@ namespace // Add memory guard at the end of the reserved stack, so that any stack // overflow during the user's main will trigger an exception at that point, // and not when we return and find that the current stack has been smashed. + // We allow read though, so that garbage-collection can pass through our + // stack in its mark phase without triggering access violations. uintptr_t memoryGuardStart = qAlignUp(memoryStart, kPageSize); - if (mprotect((void*)memoryGuardStart, kPageSize, PROT_NONE)) + if (mprotect((void*)memoryGuardStart, kPageSize, PROT_READ)) qWarning() << "Failed to add memory guard:" << strerror(errno); // We don't consider the memory guard part of the usable stack space |