android: make CrRendererMain's stack bigger.
On Android we create the renderer main thread from Java instead of using the process's actual main thread (which is functioning as the Android looper). This means that rather than the stack size being determined by the kernel's defaults, it's determined by the JVM's defaults, which are considerably smaller, and we overflow the stack in rare cases that work on other platforms. Use the stackSize parameter to the Java Thread constructor to request a larger stack: 4MB in 32-bit processes and 8MB in 64-bit processes (to match crrev.com/c/2490667 which set this for Windows). This parameter is not required to be honoured by the JVM but ART on Android does use this as a lower bound on the thread's stack size on all the Android versions we care about. Verified that this works by inspection of /proc/$pid/maps on ToT Android, which gives names to the thread stack mappings that include the tid (earlier versions of Android do not do this and there's no easy way to tell how big non-main-thread stacks are). Fixed: 1151869 Change-Id: I42e0bd987abc4f57a65e1c25436568eb51d8ac02 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625887 Auto-Submit: Richard Coles <torne@chromium.org> Reviewed-by:Andrew Grieve <agrieve@chromium.org> Commit-Queue: Andrew Grieve <agrieve@chromium.org> Cr-Commit-Position: refs/heads/master@{#845378}
Showing
Please register or sign in to comment