<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div dir="ltr" ><div>Hello,<br><br>I am working on the implementation of the coldcc calling convention. I’ve written a functional testing patch which will aggressively mark functions with the coldcc attribute to test the handling of coldcc. My changes cause a function to have a larger stack frame and when I mark two recursive functions in c-index-test with coldcc, it will lead to increasing the stack size by a large amount. Due to this, I expose a failure in the following test case:<br>tools/clang/test/Index/annotate-deep-statements.cpp<br><br>This test tries to exhaust the stack through recursion and tests that a segmentation fault does not occur. When debugging this test case, I noticed there is a default 8 MB stack size assigned to the thread.<br>In tools/clang/tools/libclang/CIndex.cpp we have:<br>/// Default to using an 8 MB stack size on "safety" threads.<br>static unsigned SafetyStackThreadSize = 8 << 20;</div>
<div> </div>
<div>So even without my changes, if I increase the test case to add more of the () operations, I can create a segmentation fault when going past the 8 MB mark. I’m wondering how this test was created and whether it is too fragile due to the 8 MB limit.<br><br>Thanks,</div>
<div>Zaara Syeda</div></div></div><BR>