-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Fix](jdk) Fix jdk17 crash on some envs. #32865
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
Conversation
This reverts commit 5c7964d.
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
clang-tidy review says "All clean, LGTM! 👍" |
92666da to
2444954
Compare
|
|
clang-tidy review says "All clean, LGTM! 👍" |
|
good fix!, jemalloc is used in JVM, use dlopen to dynamically load JVM has a problem, see: |
…#34578) Now in order to support malloc hook, compiling jemalloc will add tow compilation options --with-jemalloc-prefix=je and --disable-cxx, then overwrite malloc/free as follows to allow BE to use jemalloc: #define ALIAS(doris_fn) __attribute__((alias(#doris_fn), used)) void* malloc(size_t size) __THROW ALIAS(doris_malloc); void free(void* p) __THROW ALIAS(doris_free); void* realloc(void* p, size_t size) __THROW ALIAS(doris_realloc); void* calloc(size_t n, size_t size) __THROW ALIAS(doris_calloc); void cfree(void* ptr) __THROW ALIAS(doris_cfree); but after such overwrite like this, Doris BE on jdk17 cannot be started in some environments. there are three solutions: Modify overwrite malloc/free, fixed in Use jemalloc's experimental features to hook jemalloc #33897 Modify BE dynamically loads JVM, fixed in [Fix](jdk) Fix jdk17 crash on some envs. #32865 Commit of this PR, modify jemalloc compilation options, after remove --with-jemalloc-prefix=je, there is not need to overwrite malloc/free, BE will use Jemalloc by default. So, if need to use memory hook, this PR still cannot solve this problem. Looking forward to modify BE dynamically loads JVM, which will not only solve this problem, also fix other crashes caused by BE use JVM.
…apache#34578) Now in order to support malloc hook, compiling jemalloc will add tow compilation options --with-jemalloc-prefix=je and --disable-cxx, then overwrite malloc/free as follows to allow BE to use jemalloc: void* malloc(size_t size) __THROW ALIAS(doris_malloc); void free(void* p) __THROW ALIAS(doris_free); void* realloc(void* p, size_t size) __THROW ALIAS(doris_realloc); void* calloc(size_t n, size_t size) __THROW ALIAS(doris_calloc); void cfree(void* ptr) __THROW ALIAS(doris_cfree); but after such overwrite like this, Doris BE on jdk17 cannot be started in some environments. there are three solutions: Modify overwrite malloc/free, fixed in Use jemalloc's experimental features to hook jemalloc apache#33897 Modify BE dynamically loads JVM, fixed in [Fix](jdk) Fix jdk17 crash on some envs. apache#32865 Commit of this PR, modify jemalloc compilation options, after remove --with-jemalloc-prefix=je, there is not need to overwrite malloc/free, BE will use Jemalloc by default. So, if need to use memory hook, this PR still cannot solve this problem. Looking forward to modify BE dynamically loads JVM, which will not only solve this problem, also fix other crashes caused by BE use JVM.
…apache#34578) Now in order to support malloc hook, compiling jemalloc will add tow compilation options --with-jemalloc-prefix=je and --disable-cxx, then overwrite malloc/free as follows to allow BE to use jemalloc: #define ALIAS(doris_fn) __attribute__((alias(#doris_fn), used)) void* malloc(size_t size) __THROW ALIAS(doris_malloc); void free(void* p) __THROW ALIAS(doris_free); void* realloc(void* p, size_t size) __THROW ALIAS(doris_realloc); void* calloc(size_t n, size_t size) __THROW ALIAS(doris_calloc); void cfree(void* ptr) __THROW ALIAS(doris_cfree); but after such overwrite like this, Doris BE on jdk17 cannot be started in some environments. there are three solutions: Modify overwrite malloc/free, fixed in Use jemalloc's experimental features to hook jemalloc apache#33897 Modify BE dynamically loads JVM, fixed in [Fix](jdk) Fix jdk17 crash on some envs. apache#32865 Commit of this PR, modify jemalloc compilation options, after remove --with-jemalloc-prefix=je, there is not need to overwrite malloc/free, BE will use Jemalloc by default. So, if need to use memory hook, this PR still cannot solve this problem. Looking forward to modify BE dynamically loads JVM, which will not only solve this problem, also fix other crashes caused by BE use JVM.
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...