Skip to content

Rollback jemalloc upgrade - #102290

Closed
azat wants to merge 1 commit into
ClickHouse:masterfrom
azat:26.4-jemalloc-rollback
Closed

azat wants to merge 1 commit into
ClickHouse:masterfrom
azat:26.4-jemalloc-rollback

Conversation

@azat

@azat azat commented Apr 9, 2026 •

Copy link
Copy Markdown
Member

This reverts commit 4bb7431, reversing changes made to aef8cc3.

New version likely has some issues, I have a test that reproduce a crashes, but with this patch it happens in jemalloc, before (but after #99342) in random places.

Next step will be to try jemalloc debug mode, since likely when the crash happens inside jemalloc, it is less likely will help.

Crash before - https://pastila.nl/?006a02d6/57b9a64cc25f4332605954545d33c634#qCsfwZ9GTQPFW1PVN0H05Q==GCM (note, address is always different, not always -1)
Crash after - https://pastila.nl/?0031a630/c3b326fb6eaaba80a6e895d0cee0fffb#/JuQrwz0KQwCxKUFHNNLBg==GCM

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Rollback jemalloc upgrade

…emalloc-submodule-url"

This reverts commit 4bb7431, reversing
changes made to aef8cc3.

New version likely has some issues, I have a test that reproduce a
crashes, but with this patch it happens in jemalloc, before (but after ClickHouse#99342)
in random places.

Next step will be to try jemalloc debug mode, since likely when the
crash happens inside jemalloc, it is less likely will help.
@azat
azat requested a review from antonio2368 April 9, 2026 20:04
@clickhouse-gh

clickhouse-gh Bot commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [df99a0d]

Summary: ❌

job_name test_name status info comment
Stress test (arm_msan) failure
Server died FAIL cidb, issue
MemorySanitizer: use-of-uninitialized-value (STID: 1478-2063) FAIL cidb, issue
Finish Workflow failure
python3 ./ci/jobs/scripts/workflow_hooks/new_tests_check.py failure

AI Review

Summary

This PR rolls back the jemalloc upgrade by switching the submodule URL/commit and updating contrib/jemalloc-cmake/CMakeLists.txt source files. High-level verdict: there is one blocker — the source list now omits src/prof_stack_range.c, which still provides prof_thread_stack_range used by prof_sys.c, causing unresolved symbol/link failure in prof-enabled builds.

Findings

❌ Blockers

  • [contrib/jemalloc-cmake/CMakeLists.txt:120] src/prof_stack_range.c was removed from SRCS, but prof_sys.c still calls prof_thread_stack_range (declared in prof_sys.h) and in this submodule revision that symbol is defined only in src/prof_stack_range.c. With JEMALLOC_PROF=1 this leads to link failure.
    • Suggested fix: add "${LIBRARY_DIR}/src/prof_stack_range.c" back to SRCS.
Tests
  • ⚠️ No dedicated build/test evidence in this PR proving jemalloc linkage still succeeds after source-list changes.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ⚠️ Build is not safely rollable until missing source is restored and CI passes.
Compilation time ✅
No large/binary files ✅
Performance & Safety
  • Missing src/prof_stack_range.c is a safety/reliability issue because it breaks the prof-enabled allocator linkage path; this is a hard build-time failure, not a runtime degradation.
Final Verdict
  • Status: ❌ Block
  • Minimum required actions:
    • Re-add "${LIBRARY_DIR}/src/prof_stack_range.c" to SRCS in contrib/jemalloc-cmake/CMakeLists.txt.
    • Re-run CI build checks to confirm jemalloc links successfully.

@clickhouse-gh clickhouse-gh Bot added pr-bugfix Pull request with bugfix, not backported by default submodule changed At least one submodule changed in this PR. labels Apr 9, 2026
"${LIBRARY_DIR}/src/prof_stats.c"
"${LIBRARY_DIR}/src/prof_stack_range.c"
"${LIBRARY_DIR}/src/prof_sys.c"
"${LIBRARY_DIR}/src/prof_threshold.c"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prof_stack_range.c was removed from the _jemalloc source list, but prof_sys.c still calls prof_thread_stack_range declared in prof_sys.h.

In this submodule revision, prof_thread_stack_range is defined only in src/prof_stack_range.c, so omitting that file causes an unresolved symbol at link time when profiling is enabled (JEMALLOC_PROF=1).

Please add src/prof_stack_range.c back to SRCS.

@azat

azat commented Apr 9, 2026

Copy link
Copy Markdown
Member Author

UPD: I got crash in jemalloc even w/o upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant