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

Preload libjemalloc.so for long-running Ruby #16462

Merged
merged 1 commit into from Jul 5, 2021
Merged

Conversation

akihikodaki
Copy link
Contributor

Always mark jemalloc needed if jemalloc is enabled by akihikodaki · Pull Request #4627 · ruby/ruby
ruby/ruby#4627

Symbols exported by jemalloc is referred by the shared library but not by the executables when building Ruby as a shared library with jemalloc. It causes shared libraries such as the GNU C++ library occasionally rely on the memory allocator provided by the standard C library. Worse, the resolved symbols can later be replaced with jemalloc, and jemalloc may see pointers from the standard C library, which results in various failures. e.g. #15751

As a workaround, do not rely on jemalloc enablement of Ruby, and preload libjemalloc.so instead.

Always mark jemalloc needed if jemalloc is enabled by akihikodaki · Pull Request mastodon#4627 · ruby/ruby
ruby/ruby#4627
> Symbols exported by jemalloc is referred by the shared library but not
> by the executables when building Ruby as a shared library with
> jemalloc. It causes shared libraries such as the GNU C++ library
> occasionally rely on the memory allocator provided by the standard C
> library. Worse, the resolved symbols can later be replaced with
> jemalloc, and jemalloc may see pointers from the standard C library,
> which results in various failures.
> e.g. mastodon#15751

As a workaround, do not rely on jemalloc enablement of Ruby, and
preload libjemalloc.so instead.
@akihikodaki akihikodaki added bug Something isn't working deployment Related to runtime configuration, production setups ruby Pull requests that update Ruby code labels Jul 4, 2021
@Gargron Gargron merged commit 8af7f3b into mastodon:main Jul 5, 2021
jesseplusplus pushed a commit to jesseplusplus/decodon that referenced this pull request Feb 10, 2022
Always mark jemalloc needed if jemalloc is enabled by akihikodaki · Pull Request mastodon#4627 · ruby/ruby
ruby/ruby#4627
> Symbols exported by jemalloc is referred by the shared library but not
> by the executables when building Ruby as a shared library with
> jemalloc. It causes shared libraries such as the GNU C++ library
> occasionally rely on the memory allocator provided by the standard C
> library. Worse, the resolved symbols can later be replaced with
> jemalloc, and jemalloc may see pointers from the standard C library,
> which results in various failures.
> e.g. mastodon#15751

As a workaround, do not rely on jemalloc enablement of Ruby, and
preload libjemalloc.so instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working deployment Related to runtime configuration, production setups ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants