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

Disable jemalloc on macos due to potential UDF FFI allocation inconsistencies #750

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

mwylde
Copy link
Member

@mwylde mwylde commented Sep 26, 2024

In the UDF FFI pathway, we rely on allocating memory in the host which is freed in the plugin and vice-versa. This is reliable on Linux with both the standard allocator and jemalloc (which we introduced in #719 for its improved performance and profiling capabilities). However, on MacOS this approach has the potential to segfault with jemalloc:

arroyo(46639,0x16bec3000) malloc: *** error for object 0x110768140: pointer being realloc'd was not allocated
arroyo(46639,0x16bec3000) malloc: *** set a breakpoint in malloc_error_break to debug

This occurs when accessing the plugin-allocated memory on the host. On Linux the same allocator will be used in FFI code and in the host code, but that does not appear to be the case for darwin; I believe that on macos the UDF is using the system allocator while the host is using jemalloc.

There may be a path forward for jemalloc on macos, but since most of the benefits will be in production on linux the fastest path here seems to be to disable it on mac.

@mwylde mwylde enabled auto-merge (squash) September 26, 2024 16:40
@mwylde mwylde merged commit 06e7122 into master Sep 26, 2024
6 checks passed
mwylde added a commit that referenced this pull request Sep 26, 2024
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

Successfully merging this pull request may close these issues.

1 participant