Bug #106672 | Build with -DWITH_VALGRIND=1 allocates way too much due to "x1.5" MEMROOT growth | ||
---|---|---|---|
Submitted: | 8 Mar 2022 14:11 | Modified: | 1 Apr 2022 19:41 |
Reporter: | Guilhem Bichot | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S6 (Debug Builds) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[8 Mar 2022 14:11]
Guilhem Bichot
[8 Mar 2022 14:34]
MySQL Verification Team
Salut Guilhem, mon ami, Thank you for your bug report. We have analysed your report and indeed concluded that this is an error that would lead to memory fragmentation. In short, we agree with your analysis. Verified as reported.
[8 Mar 2022 14:35]
MySQL Verification Team
This affects only debug builds.
[9 Mar 2022 9:31]
Tor Didriksen
Posted by developer: Note that the cmake option WITH_VALGRIND is mostly obsolete. It was used earlier to enable or disable code of the sort: "I am smarter than the compiler, or smarter than purify/valgrind" That code was remove some eight years ago. The only thing WITH_VALGRIND does these days is to enable some VALGRIND_MAKE_MEM_DEFINED etc. in InnoDB. I recommend running valgrind with your normal Debug or RelWithDebInfo builds.
[1 Apr 2022 9:42]
Tor Didriksen
Posted by developer: 5.7 code is completely different.
[1 Apr 2022 10:06]
Tor Didriksen
Posted by developer: For normal allocation, we will never call ForceNewBlock. This code however, may do so: sql/iterators/hash_join_buffer.cc: m_mem_root.ForceNewBlock(required_value_bytes); sql/iterators/hash_join_buffer.cc: m_mem_root.ForceNewBlock(required_key_bytes);
[1 Apr 2022 19:41]
Jon Stephens
Fixed in MySQL 8.0.30. Debugging only, no user-facing changes to document. Closed.
[4 Apr 2022 12:16]
MySQL Verification Team
Thank you, Jon.