TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Portal 2 crashes if you have 128 cores, due to 15 year old assumptions

63 pointsby notpopcornover 3 years ago

4 comments

notpopcornover 3 years ago
MAX_THREAD_IDS is defined as 128 in a file with a copyright notice of 2005, which was when the very first consumer dual core processors started getting released:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;perilouswithadollarsign&#x2F;cstrike15_src&#x2F;blob&#x2F;master&#x2F;tier0&#x2F;threadtools.cpp#L99" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;perilouswithadollarsign&#x2F;cstrike15_src&#x2F;blo...</a><p>Entirely reasonable that no one in 2005 would even consider the possibility of 128 core processors. I bet nobody reconsidered or even looked at that code ever since, until it started breaking because of today&#x27;s extremely parallel cpus starting to get somewhat affordable for consumers.
评论 #29745486 未加载
perihelionsover 3 years ago
&gt;<i>&quot;The solution?&quot;</i><p><pre><code> # echo 0 &gt; &#x2F;sys&#x2F;devices&#x2F;system&#x2F;cpu&#x2F;cpu{121..127}&#x2F;online </code></pre> &gt;<i>&quot;Disabling just one core makes the game start, but then it segfaults when the menu opens. Disabling six cores makes the menu work. Disabling seven makes the rest of the game work too.</i>&quot;<p>What path do you walk to be able to figure out this kind of black magic by yourself?
评论 #29744959 未加载
评论 #29745204 未加载
评论 #29746199 未加载
laserbeamover 3 years ago
To be fair, the issue is not that there are too many physical cores, or that someone set that constant to 128. The issue is the code that spawns 1 thread per core doesn&#x27;t check that constant to limit how many threads it spawns.
评论 #29750786 未加载
kralljaover 3 years ago
I’m not super familiar with cgroups, but I have to assume there’s a parameter for limiting the number of cores available to a process, rather than doing it at the kernel level in &#x2F;sys