<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:05:41 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-4334] _DEBUG Windows version of mongod.exe crashes on ctrl-C on Windows XP and Server 2003</title>
                <link>https://jira.mongodb.org/browse/SERVER-4334</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If I build a 32-bit debug version of mongod.exe for Windows and run it on 32-bit Windows XP and then press ctrl-C, the ctrl-C is reported and immediately followed by an &quot;unhandled windows exception&quot; with reported value &quot;ec=0xc00000fd&quot;.  This turns out to be &quot;stack overflow&quot;.  I put breakpoints in the code and stepped through it in assembly language (required in this case) and I think I&apos;ve got a decent handle on the problem now.&lt;/p&gt;

&lt;p&gt;We start out on-track to do our normal cleanup-and-exit on ctrl-C, but we blow up instantly when db/db.cpp routine ctrlCTerminate() calls Client::initThread( &quot;ctrlCTerminate&quot; ) in db/client.cpp.  It really is a stack overflow, but it is debug-only diagnostic code that doesn&apos;t even get used in this build that is killing us.&lt;/p&gt;

&lt;p&gt;On Windows, the ctrl-C handler function we register by calling SetConsoleCtrlHandler() gets called on a new thread.  Before I hit ctrl-C, I can see that we have 6 threads running.  When we hit the breakpoint I set in the code after hitting ctrl-C, we are running on a new 7th thread.  In order for exitCleanly( EXIT_KILL ) to work correctly, the new thread has to be set up as a &quot;client&quot; thread, hence the call to Client::initThread().  But we never get to execute the first source code line in initThread(), because the 256K buffer we allocate for StackChecker is too big and the _chkstk() (aka _alloca_probe()) routine that tests for stack overflow triggers.  Apparently, the designers of Windows XP figured that the default Windows thread size of 1MB was excessive for a simple ctrl-C handler thread, so they picked 256K as the reserved stack size.  _alloca_probe() touches memory every 4K (page size) until it either gets to the end of the requested allocation (you win) or gets an &quot;unable to expand the stack&quot; exception (you lose).&lt;/p&gt;

&lt;p&gt;The somewhat ironic part is that the 256K allocated by the StackChecker object is only used if ( sizeof(void*) == 8 ) and so no stack checking takes place in this build but we overflow the stack anyway.&lt;/p&gt;

&lt;p&gt;I don&apos;t know how much value this stack checking (when used) is providing, but I can stop the crashing by changing &apos;enum &lt;/p&gt;
{ SZ = 256 * 1024 }
&lt;p&gt;;&apos; to &apos;enum &lt;/p&gt;
{ SZ = 192 * 1024 }
&lt;p&gt;;&apos;.  I am not sure why we only test and report on stack usage in 64-bit builds but consume stack space (forcing memory to be allocated) in both 32-bit and 64-bit builds.  If limiting ourselves to checking for up to 192K of usage instead of 256K of usage is acceptable, this is a one line fix.  And no actual customer is running a 32-bit debug version on Windows XP, it&apos;s just developers (like me) who will hit this bug.&lt;/p&gt;</description>
                <environment>32-bit debug version of mongod on 32-bit Windows XP</environment>
        <key id="25167">SERVER-4334</key>
            <summary>_DEBUG Windows version of mongod.exe crashes on ctrl-C on Windows XP and Server 2003</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="tad">Tad Marshall</reporter>
                        <labels>
                            <label>Windows</label>
                            <label>crash</label>
                    </labels>
                <created>Sun, 20 Nov 2011 23:30:10 +0000</created>
                <updated>Mon, 11 Jul 2016 18:35:41 +0000</updated>
                            <resolved>Wed, 28 Mar 2012 09:27:55 +0000</resolved>
                                                    <fixVersion>2.1.1</fixVersion>
                                    <component>Stability</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="104228" author="auto" created="Wed, 28 Mar 2012 09:14:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;tadmarshall&apos;, u&apos;name&apos;: u&apos;Tad Marshall&apos;, u&apos;email&apos;: u&apos;tad@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4334&quot; title=&quot;_DEBUG Windows version of mongod.exe crashes on ctrl-C on Windows XP and Server 2003&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4334&quot;&gt;&lt;del&gt;SERVER-4334&lt;/del&gt;&lt;/a&gt; Change StackChecker size from 256 KB to 192 KB&lt;/p&gt;

&lt;p&gt;The stack size in Windows XP and Windows Server 2003 R2 for the thread&lt;br/&gt;
that is created to handle a ctrl-C is 256 KB, so we overflow the stack&lt;br/&gt;
when we pad it with 256 KB of dummy values to track stack usage.  Drop&lt;br/&gt;
the padding to 192 KB.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/38aaee4cd3ad67aa963eedf01297319dd4b18546&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/38aaee4cd3ad67aa963eedf01297319dd4b18546&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="104226" author="tad" created="Wed, 28 Mar 2012 09:08:44 +0000"  >&lt;p&gt;Now that I&apos;m testing 64-bit debug builds on 64-bit Windows Server 2003 R2, I can see the extent of this issue.  We get the same stack overflow in 64-bit builds of mongod.exe on a 64-bit OS if the Windows OS is pre-Vista.  This needs to be fixed to make debugging work right.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 28 Mar 2012 09:14:39 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 47 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 47 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[Windows]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrol1z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgevb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9318</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10153"><![CDATA[Unneeded]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht08xb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>