Skip to content
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

32bit arch must set /proc/sys/kernel/pid_max = 65535 #40

Closed
truboxl opened this issue Aug 20, 2022 · 1 comment
Closed

32bit arch must set /proc/sys/kernel/pid_max = 65535 #40

truboxl opened this issue Aug 20, 2022 · 1 comment

Comments

@truboxl
Copy link
Contributor

truboxl commented Aug 20, 2022

https://android.googlesource.com/platform/bionic/#host-tests
https://android.googlesource.com/platform/bionic/+/master/libc/bionic/libc_init_common.cpp

When running certain multi threaded program in 32bit containers, the PIDs can balloon and easily exceed libc's limit.
The following error will be shown:

Limited by the size of pthread_mutex_t, 32 bit bionic libc only accepts pid <= 65535, but current pid is 65969
libc: Limited by the size of pthread_mutex_t, 32 bit bionic libc only accepts pid <= 65535, but current pid is 65969
libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 65969 (emcc), pid 65969 (emcc)

This was spotted when running emscripten tests in i686 container on x86_64 host
which the pid_max value of both host and container is

$ cat /proc/sys/kernel/pid_max 
4194304

The only way to fix this is to set /proc/sys/kernel/pid_max to 65535 but setting this will affect both container and host globally at runtime. I think we can list this as a caveat.

EDIT: updated to 65535 in 6189bbd. Sorry for the confusion future readers.

@truboxl
Copy link
Contributor Author

truboxl commented May 26, 2023

Closing as I don't see any real solutions other than the workaround. The notice had been added in f153659. Thanks.

@truboxl truboxl closed this as completed May 26, 2023
@truboxl truboxl changed the title 32bit arch must set /proc/sys/kernel/pid_max = 65536 32bit arch must set /proc/sys/kernel/pid_max = 65535 Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant