<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sat Jan 11 07:54:12 UTC 2025

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>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[BDS-11039] Server Crashed on Village::getBedPOICount[]</title>
                <link>https://bugs.mojang.com/browse/BDS-11039</link>
                <project id="11700" key="BDS">Bedrock Dedicated Server</project>
                    <description>&lt;p&gt;To reproduce:&lt;br/&gt;
 1. Stand at the position 1695 36 -953 and wait (in the world &lt;a href=&quot;https://www.dropbox.com/s/vzvf9ag35gt0p87/buggy_world.zip?dl=1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;2. Game Crashes.&lt;/p&gt;

&lt;p&gt;The following crash log was produced on the server:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Crash
[INFO] at std::__shared_count&amp;lt;[__gnu_cxx::_Lock_policy]2&amp;gt;::__shared_count[std::__weak_count&amp;lt;[__gnu_cxx::_Lock_policy]2&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt;&amp;amp;, std::nothrow_t] (UnknownFile:?)
 at std::__shared_ptr&amp;lt;POIInstance, [__gnu_cxx::_Lock_policy]2&amp;gt;::__shared_ptr[std::__weak_ptr&amp;lt;POIInstance, [__gnu_cxx::_Lock_policy]2&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt;&amp;amp;, std::nothrow_t] (UnknownFile:?)
 at std::shared_ptr&amp;lt;POIInstance&amp;gt;::shared_ptr[std::weak_ptr&amp;lt;POIInstance&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt;&amp;amp;, std::nothrow_t] (UnknownFile:?)
 at std::weak_ptr&amp;lt;POIInstance&amp;gt;::lock[] &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; (UnknownFile:?)
 at Village::getBedPOICount[] &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; (UnknownFile:?)
 at Village::tick[Tick, BlockSource&amp;amp;] (UnknownFile:?)
 at VillageManager::tickVillages[Tick &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt;&amp;amp;, Vec3 &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt;&amp;amp;, BlockSource&amp;amp;] (UnknownFile:?)
 at ServerPlayer::tickWorld[Tick &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt;&amp;amp;] (UnknownFile:?)
 at std::function&amp;lt;bool [Player&amp;amp;]&amp;gt;::&lt;span class=&quot;code-keyword&quot;&gt;operator&lt;/span&gt;[][Player&amp;amp;] &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; (UnknownFile:?)
 at Level::forEachPlayer[std::function&amp;lt;bool [Player&amp;amp;]&amp;gt;] (UnknownFile:?)
 at Level::tick[] (UnknownFile:?)
 at ServerLevel::tick[] (UnknownFile:?)
 at GameSession::tick[] (UnknownFile:?)
 at Minecraft::tickSimtime[&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;] (UnknownFile:?)
 at Minecraft::update[] (UnknownFile:?)
 at ServerInstance::_update[] (UnknownFile:?)
 at clone (UnknownFile:?)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;From what I have discovered, this bug is caused by locking a weak_ptr from the POIInstance list (std::vector&amp;lt;std::weak_ptr&amp;lt;POIInstance&amp;gt;&amp;gt;). When reading from the vector using [], a null value is returned, which ultimately gets dereferenced and causes a crash. To be exact, the address+8 is dereferenced, which to my knowledge is the offset for the reference count of a smart pointer. &lt;/p&gt;

&lt;p&gt;I can also see that right after locking the weak_ptr, there is some kind of null check (not sure if its for the same pointer though, I think not).&lt;/p&gt;

&lt;p&gt;I propose the following: before locking the weak_ptr, check if it is nullptr. If not, then you can lock it. I don&apos;t know why any of the POIInstances should ever be nullpointers, but simply checking for this could solve the issue.&lt;/p&gt;</description>
                <environment>Debian GNU/Linux 10 (buster), glibc version 2.28-10, Linux kernel 4.19.0-13-amd64</environment>
        <key id="402918">BDS-11039</key>
            <summary>Server Crashed on Village::getBedPOICount[]</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="deerangle">Ian Rehwinkel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 Jan 2021 20:04:07 +0100</created>
                <updated>Wed, 20 Jan 2021 12:34:45 +0100</updated>
                            <resolved>Wed, 20 Jan 2021 12:34:45 +0100</resolved>
                                    <version>1.16.201 Hotfix</version>
                                                            <votes>5</votes>
                                    <watches>7</watches>
                                                                            <comments>
                            <comment id="899968" author="mega_spud" created="Wed, 20 Jan 2021 12:34:45 +0100"  >&lt;p&gt;&lt;b&gt;Thank you for your report!&lt;/b&gt;&lt;br/&gt;
We&apos;re actually already tracking this issue at &lt;b&gt;&lt;ins&gt;&lt;a href=&quot;https://bugs.mojang.com/browse/BDS-10666&quot; title=&quot;Server bedrock crash during the game&quot; class=&quot;issue-link&quot; data-issue-key=&quot;BDS-10666&quot;&gt;&lt;del&gt;BDS-10666&lt;/del&gt;&lt;/a&gt;&lt;/ins&gt;&lt;/b&gt;, so we will resolve and link this ticket as a duplicate. &lt;/p&gt;

&lt;p&gt;If you would like to add a vote and any extra information to the main ticket it would be appreciated.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Quick Links&lt;/b&gt;:&lt;br/&gt;
&#128211; &lt;a href=&quot;https://aka.ms/MCBugTrackerHelp&quot; title=&quot;How To Write Awesome Tickets! &#128175;&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Issue Guidelines&lt;/a&gt; &amp;#8211; &#128172; &lt;a href=&quot;https://help.minecraft.net/hc/en-us/requests/new&quot; title=&quot;Account Support &#128377;&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Mojang Support&lt;/a&gt; &amp;#8211; &#128231; &lt;a href=&quot;https://feedback.minecraft.net/&quot; title=&quot;Feedback and Suggestions &#9997;&#65039;&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Suggestions&lt;/a&gt; &amp;#8211; &#128214; &lt;a href=&quot;http://minecraft.gamepedia.com/Minecraft_Wiki&quot; title=&quot;Minecraft Wiki &#127891;&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Minecraft Wiki&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="893044" author="JIRAUSER591766" created="Sun, 10 Jan 2021 11:54:04 +0100"  >&lt;p&gt;Thanks for confirming. I&apos;ve put some more detail on&#160;&lt;a href=&quot;https://bugs.mojang.com/browse/BDS-10666&quot; title=&quot;Server bedrock crash during the game&quot; class=&quot;issue-link&quot; data-issue-key=&quot;BDS-10666&quot;&gt;&lt;del&gt;BDS-10666&lt;/del&gt;&lt;/a&gt; with .so versions from my working install - can you compare these against your system?&lt;/p&gt;</comment>
                            <comment id="892989" author="JIRAUSER595019" created="Sun, 10 Jan 2021 06:38:23 +0100"  >&lt;p&gt;Same here - Ubuntu 20.04&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;INFO&amp;#93;&lt;/span&gt; Package: com.mojang.minecraft.dedicatedserver&lt;br/&gt;
Version: 1.16.201.2&lt;br/&gt;
OS: Linux&lt;br/&gt;
Server start: 2021-01-09 17:06:40 UTC&lt;br/&gt;
Dmp timestamp: 2021-01-09 17:29:28 UTC&lt;br/&gt;
Upload Date: 2021-01-09 17:29:28 UTC&lt;br/&gt;
Session ID: 629e8872-5ead-4c07-a0af-0146148018e5&lt;br/&gt;
Commit hash: &lt;br/&gt;
Build id: development&lt;br/&gt;
CrashReporter Key: 2d02d684-d26e-3ee0-b5cd-52ae42c374db&lt;/p&gt;

&lt;p&gt;Crash&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;INFO&amp;#93;&lt;/span&gt;  at std::_&lt;em&gt;shared_count&amp;lt;&lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt;::&lt;/em&gt;&lt;em&gt;shared_count[std::&lt;/em&gt;_weak_count&amp;lt;&lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt; const&amp;amp;, std::nothrow_t] (UnknownFile:?)&lt;br/&gt;
        at std::_&lt;em&gt;shared_ptr&amp;lt;POIInstance, &lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt;::&lt;/em&gt;&lt;em&gt;shared_ptr[std::&lt;/em&gt;_weak_ptr&amp;lt;POIInstance, &lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt; const&amp;amp;, std::nothrow_t] (UnknownFile:?)&lt;br/&gt;
        at std::shared_ptr&amp;lt;POIInstance&amp;gt;::shared_ptr&lt;span class=&quot;error&quot;&gt;&amp;#91;std::weak_ptr&amp;lt;POIInstance&amp;gt; const&amp;amp;, std::nothrow_t&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
        at std::weak_ptr&amp;lt;POIInstance&amp;gt;::lock[] const (UnknownFile:?)&lt;br/&gt;
        at Village::getBedPOICount[] const (UnknownFile:?)&lt;br/&gt;
        at Village::tick&lt;span class=&quot;error&quot;&gt;&amp;#91;Tick, BlockSource&amp;amp;&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
        at VillageManager::tickVillages&lt;span class=&quot;error&quot;&gt;&amp;#91;Tick const&amp;amp;, Vec3 const&amp;amp;, BlockSource&amp;amp;&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
        at ServerPlayer::tickWorld&lt;span class=&quot;error&quot;&gt;&amp;#91;Tick const&amp;amp;&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
        at std::function&amp;lt;bool &lt;span class=&quot;error&quot;&gt;&amp;#91;Player&amp;amp;&amp;#93;&lt;/span&gt;&amp;gt;::operator[]&lt;span class=&quot;error&quot;&gt;&amp;#91;Player&amp;amp;&amp;#93;&lt;/span&gt; const (UnknownFile:?)&lt;br/&gt;
        at Level::forEachPlayer[std::function&amp;lt;bool &lt;span class=&quot;error&quot;&gt;&amp;#91;Player&amp;amp;&amp;#93;&lt;/span&gt;&amp;gt;] (UnknownFile:?)&lt;br/&gt;
        at Level::tick[] (UnknownFile:?)&lt;br/&gt;
        at ServerLevel::tick[] (UnknownFile:?)&lt;br/&gt;
        at GameSession::tick[] (UnknownFile:?)&lt;br/&gt;
        at Minecraft::tickSimtime&lt;span class=&quot;error&quot;&gt;&amp;#91;int, int&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
        at Minecraft::update[] (UnknownFile:?)&lt;br/&gt;
        at ServerInstance::_update[] (UnknownFile:?)&lt;br/&gt;
        at clone (UnknownFile:?)&lt;/p&gt;</comment>
                            <comment id="892657" author="JIRAUSER593813" created="Sat, 9 Jan 2021 14:36:42 +0100"  >&lt;p&gt;@Tom Gray my debian install where the crash occured is on libstdc+&lt;ins&gt;6.0.25. My personal computer, which has libstdc&lt;/ins&gt;&lt;ins&gt;6.0.28 also crashes. I don&apos;t think this is an issue with any specific libstdc&lt;/ins&gt;+ version.&lt;/p&gt;</comment>
                            <comment id="892479" author="JIRAUSER591766" created="Sat, 9 Jan 2021 08:54:13 +0100"  >&lt;p&gt;Added some comments in &lt;a href=&quot;https://bugs.mojang.com/browse/BDS-10666&quot; title=&quot;Server bedrock crash during the game&quot; class=&quot;issue-link&quot; data-issue-key=&quot;BDS-10666&quot;&gt;&lt;del&gt;BDS-10666&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;tl;dr: using the test world attached to this bug, I can reliably reproduce the crash under Ubuntu 20.04 but have not been able to reproduce under Ubuntu 18.04. I believe the difference is the version of libstdc++ (6.0.25 on Ubuntu 18.04; 6.0.28 on Ubuntu 20.04).&lt;/p&gt;

&lt;p&gt;I&apos;m testing using a Docker container and the standard Ubuntu provided images (ubuntu:18.04 and ubuntu:20.04).&lt;/p&gt;

&lt;p&gt;Can you try this and see if it fixes the crash for you?&lt;/p&gt;</comment>
                            <comment id="891684" author="JIRAUSER594056" created="Fri, 8 Jan 2021 12:21:29 +0100"  >&lt;p&gt;Same problem, position [ 219 69 -688 ]&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;INFO&amp;#93;&lt;/span&gt; Package: com.mojang.minecraft.dedicatedserver&lt;br/&gt;
Version: 1.16.201.2&lt;br/&gt;
OS: Linux&lt;br/&gt;
Server start: 2021-01-08 14:15:13 UTC&lt;br/&gt;
Dmp timestamp: 2021-01-08 14:17:05 UTC&lt;br/&gt;
Upload Date: 2021-01-08 14:17:05 UTC&lt;br/&gt;
Session ID: 86854841-37a9-422e-a10d-246184401b39&lt;br/&gt;
Commit hash:&lt;br/&gt;
Build id: development&lt;br/&gt;
CrashReporter Key: ce158104-660f-3b4f-9fe4-b690c05910a6&lt;/p&gt;

&lt;p&gt;Crash&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;INFO&amp;#93;&lt;/span&gt; at std::_&lt;em&gt;shared_count&amp;lt;&lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt;::&lt;/em&gt;&lt;em&gt;shared_count[std::&lt;/em&gt;_weak_count&amp;lt;&lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt; const&amp;amp;, std::nothrow_t] (UnknownFile:?)&lt;br/&gt;
 at std::_&lt;em&gt;shared_ptr&amp;lt;POIInstance, &lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt;::&lt;/em&gt;&lt;em&gt;shared_ptr[std::&lt;/em&gt;_weak_ptr&amp;lt;POIInstance, &lt;span class=&quot;error&quot;&gt;&amp;#91;__gnu_cxx::_Lock_policy&amp;#93;&lt;/span&gt;2&amp;gt; const&amp;amp;, std::nothrow_t] (UnknownFile:?)&lt;br/&gt;
 at std::shared_ptr&amp;lt;POIInstance&amp;gt;::shared_ptr&lt;span class=&quot;error&quot;&gt;&amp;#91;std::weak_ptr&amp;lt;POIInstance&amp;gt; const&amp;amp;, std::nothrow_t&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
 at std::weak_ptr&amp;lt;POIInstance&amp;gt;::lock[] const (UnknownFile:?)&lt;br/&gt;
 at Village::getBedPOICount[] const (UnknownFile:?)&lt;br/&gt;
 at Village::tick&lt;span class=&quot;error&quot;&gt;&amp;#91;Tick, BlockSource&amp;amp;&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
 at VillageManager::tickVillages&lt;span class=&quot;error&quot;&gt;&amp;#91;Tick const&amp;amp;, Vec3 const&amp;amp;, BlockSource&amp;amp;&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
 at ServerPlayer::tickWorld&lt;span class=&quot;error&quot;&gt;&amp;#91;Tick const&amp;amp;&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
 at std::function&amp;lt;bool &lt;span class=&quot;error&quot;&gt;&amp;#91;Player&amp;amp;&amp;#93;&lt;/span&gt;&amp;gt;::operator[]&lt;span class=&quot;error&quot;&gt;&amp;#91;Player&amp;amp;&amp;#93;&lt;/span&gt; const (UnknownFile:?)&lt;br/&gt;
 at Level::forEachPlayer[std::function&amp;lt;bool &lt;span class=&quot;error&quot;&gt;&amp;#91;Player&amp;amp;&amp;#93;&lt;/span&gt;&amp;gt;] (UnknownFile:?)&lt;br/&gt;
 at Level::tick[] (UnknownFile:?)&lt;br/&gt;
 at ServerLevel::tick[] (UnknownFile:?)&lt;br/&gt;
 at GameSession::tick[] (UnknownFile:?)&lt;br/&gt;
 at Minecraft::tickSimtime&lt;span class=&quot;error&quot;&gt;&amp;#91;int, int&amp;#93;&lt;/span&gt; (UnknownFile:?)&lt;br/&gt;
 at Minecraft::update[] (UnknownFile:?)&lt;br/&gt;
 at ServerInstance::_update[] (UnknownFile:?)&lt;br/&gt;
 at clone (UnknownFile:?)&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10102">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="397357">BDS-10666</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_11500" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>ADO</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>457993</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Unconfirmed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i1r75z:</customfieldvalue>

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