Repository navigation
master: keep MaybeTrimHeap buildable on glibc 2.28 (manylinux2_28) - #10
Merged
Merged
Conversation
mallinfo2() is glibc >= 2.33. The store's own toolchain (ubuntu 24.04, glibc 2.39) has it; the manylinux2_28 image that builds the python wheel is glibc 2.28 and does not, so naming it unconditionally compiles on one real build target and fails on the other: master_service.cpp:9215:25: error: 'mallinfo2' was not declared in this scope; did you mean 'mallinfo'? Select the call behind __GLIBC_PREREQ(2, 33) and widen the four fields to size_t in one helper. These numbers are logged and never decided on -- the trim trigger reads /proc via ReadResidentBytes() -- so the pre-2.33 path costs only precision, and the comment says where: mallinfo()'s fields are int and wrap above 2 GiB, which is the range this code exists for.
Juhyun-Kim-Memphis
marked this pull request as ready for review
August 20, 2026 16:57
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mallinfo2()는 glibc 2.33부터 있다. store 자신의 툴체인(ubuntu 24.04, glibc 2.39)에는 있지만, python wheel을 빌드하는 manylinux2_28 이미지는 glibc 2.28이라 없다. 그래서 이 심볼을 조건 없이 쓰면 실제 빌드 타깃 두 개 중 하나만 컴파일된다.wheel carrier 빌드에서 실제로 터진 것이고,
our_main현재 상태로는 carrier를 만들 수 없다. 마지막으로 성공한 carrier(a96c1cd5)는 이 코드가 들어오기 전이다.unittest 게이트가 왜 이걸 못 잡았나
게이트 레시피(
Dockerfile.unittest)는 의도적으로 ubuntu:24.04에서 돌고, manylinux 베이스를 공유하지 않는다(gtest 링크 함정 때문). 그래서 게이트는 glibc 2.39 경로만 검증하고, glibc 버전에 의존하는 변경은 게이트를 통과한 뒤 carrier에서 터진다. 이번이 그 사례다. carrier 빌드 자체가 glibc 2.28 컴파일 게이트라는 뜻이기도 하다.고친 방법
__GLIBC_PREREQ(2, 33)로 호출을 고르고, 네 필드를size_t로 넓히는 헬퍼 하나(ReadHeapInfo)로 모았다.이 숫자들은 로그 전용이고 판단에 쓰이지 않는다 — trim 트리거는
/proc을 읽는ReadResidentBytes()다. 그래서 2.33 미만 경로에서 잃는 것은 정밀도뿐이고, 어디서 잃는지는 주석에 적었다:mallinfo()의 필드는int라서 힙이 2 GiB를 넘으면 wrap하는데, 그게 바로 이 코드가 존재하는 크기 영역이다.검증