-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tcmalloc crash when /sys/devices/system/cpu/possible is sandboxed away #245
Comments
TCMalloc needs In the past, we've run into issues where If you know where |
I think we need the |
To confirm, are you okay with Note, I'm happy to send you a change if you're okay with one of:
|
Let me clarify:
I'm not sure if there is an alternative to reading |
We're going to see if we can get an exception in the compiler-explorer side, since it's not readily apparent whether the /proc fallback done by glibc provides a compatible alternative for |
This returns std::nullopt when /sys cannot be read to determine the number of CPUs. In a subsequent change, we can check this first and turn off per-CPU caches when we cannot accurately determine the maximum possible CPU ID we will see. See issue #245. PiperOrigin-RevId: 667653028 Change-Id: I70e8126cb71b82d94bcd7da90e15ee16b0b69a8a
We use /sys to determine the number of CPUs we might see from restartable sequences. When this is not available, gracefully degrade rather than check-failing. Fixes #245. PiperOrigin-RevId: 667702663 Change-Id: Id78f557913f5936f7c4515dcbc2d445e162f68e3
We're trying to use tcmalloc in a sandboxed environment that hides /sys. This causes a crash in
NumPossibleCPUsNoCache
when trying to read"/sys/devices/system/cpu/possible"
.It looks like tcmalloc used to use absl's implementation, which I think was calling
std::thread::hardware_concurrency
(here). What do you think of adding that as a fallback when the /sys info is unavailable?For context, the specific crash is:
The specific environment is compiler-explorer, so you can look at what's available pretty easily, e.g. here's some relevant Python queries:
https://python.compiler-explorer.com/z/jT6baYxba
std::thread::hardware_concurrency
returns 2 in this environment (https://cpp.compiler-explorer.com/z/r4dfbxxMs)The issue reported to us is carbon-language/carbon-lang#4176. It's temporarily reproducible at https://carbon.compiler-explorer.com/z/Ecfjh7bhs, but we'll be trying to fix that promptly and then I think the Python check above is the better reference.
The text was updated successfully, but these errors were encountered: