Memory leak after 'tokudb.parts.upgrade_from_prev_ver' - in `fast_alter_partition_table()`
General
Escalation
General
Escalation
Description
Environment
None
Smart Checklist
Activity
Show:
Julia Vural March 4, 2025 at 9:09 PM
It appears that this issue is no longer being worked on, so we are closing it for housekeeping purposes. If you believe the issue still exists, please open a new ticket after confirming it's present in the latest release.
Marcelo Altmann October 22, 2019 at 7:54 PM
I'm not been able to reproduce it yet. Getting a crash instead of memory leak:
Version: '5.7.26-29-debug-log-asan' socket: '/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/mysql-test/var/tmp/mysqld.1.sock' port: 13001 Percona Server (GPL), Release 29, Revision cfe4a4b-debug
mysqld: /tmp/ps/storage/tokudb/PerconaFT/portability/file.cc:137: void try_again_after_handling_write_error(int, size_t, ssize_t): Assertion `try_again' failed.
18:35:36 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
Please help us make Percona Server better by reporting any
bugs at https://bugs.percona.com/key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=152
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61255 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
/usr/lib/x86_64-linux-gnu/libasan.so.4(+0x558c0)[0x7f57b608e8c0]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/bin/mysqld(my_print_stacktrace+0x99)[0x56010daa44d6]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/bin/mysqld(handle_fatal_signal+0xdc5)[0x56010d3c361a]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f57b5e2c890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f57b3dd8e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f57b3dda801]
/lib/x86_64-linux-gnu/libc.so.6(+0x3039a)[0x7f57b3dca39a]
/lib/x86_64-linux-gnu/libc.so.6(+0x30412)[0x7f57b3dca412]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/lib/mysql/plugin/ha_tokudb.so(+0x3e1dc4)[0x7f579e345dc4]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/lib/mysql/plugin/ha_tokudb.so(_Z40toku_os_full_pwrite_with_source_locationiPKvmlPKcj+0x218)[0x7f579e346b31]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/lib/mysql/plugin/ha_tokudb.so(_Z24toku_serialize_ftnode_toi10blocknum_sP6ftnodePP16ftnode_disk_databP2ftb+0x2ec)[0x7f579e20d305]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/lib/mysql/plugin/ha_tokudb.so(_Z26toku_ftnode_flush_callbackP9cachefilei10blocknum_sPvPS2_S2_11pair_attr_sPS4_bbbb+0x2e2)[0x7f579e1b5ea3]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/lib/mysql/plugin/ha_tokudb.so(+0x21885f)[0x7f579e17c85f]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/lib/mysql/plugin/ha_tokudb.so(+0x218cf7)[0x7f579e17ccf7]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/lib/mysql/plugin/ha_tokudb.so(+0x371cd3)[0x7f579e2d5cd3]
/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/bin/mysqld(pfs_spawn_thread+0x254)[0x56010daf01c8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f57b5e216db]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f57b3ebb88f]
You may download the Percona Server operations manual by visiting
http://www.percona.com/software/percona-server/. You may find information
in the manual which will help you identify the cause of the crash.
Writing a core file
safe_process[17210]: Child process: 17211, killed by signal: 6
----------SERVER LOG END-------------
- the logfile can be found in '/tmp/ps/bld/usr/local/Percona-Server-5.7.26-29-debug-Linux.x86_64/mysql-test/var/log/tokudb.parts.upgrade_from_prev_ver-native-partitioning/upgrade_from_prev_ver.log'
[100%] sanitize_report [ pass ]
--------------------------------------------------------------------------
The servers were restarted 1 times
Spent 0.000 of 28 seconds executing testcasesCompleted: Failed 1/2 tests, 50.00% were successful.Failing test(s): tokudb.parts.upgrade_from_prev_verThe log files in var/log may give you some hint of what went wrong.If you want to report this error, please read first the documentation
at http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html1 tests were skipped, 1 by the test itself.mysql-test-run: *** ERROR: there were failing test cases
Won't Do
Details
Details
Assignee
Unassigned
UnassignedReporter
Yura Sorokin
Yura SorokinTime tracking
1d 5h 30m logged
Affects versions
Priority
Smart Checklist
Open Smart Checklist
Smart Checklist

Open Smart Checklist
Created August 8, 2019 at 12:39 PM
Updated March 4, 2025 at 9:09 PM
Resolved March 4, 2025 at 9:09 PM
Run the following command under Address Sanitizer
./mysql-test/mtr --big-test --debug-server --sanitize upgrade_from_prev_ver
[ 66%] tokudb.parts.upgrade_from_prev_ver 'native-partitioning' [ pass ] 17527 worker[1] Sanitizer report from /home/yura/addon/local/percona-build-5.7-asan_gcc8/mysql-test/var/log/mysqld.1.err after tests: tokudb.parts.upgrade_from_prev_ver tokudb.parts.upgrade_from_prev_ver -------------------------------------------------------------------------- ==90870==ERROR: LeakSanitizer: detected memory leaks Direct leak of 3120 byte(s) in 130 object(s) allocated from: #0 0x7f5e1affff00 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf00) #1 0x7f5e04135568 (<unknown module>) #2 0x7f5e04134ca2 (<unknown module>) #3 0x7f5e040be4ae (<unknown module>) #4 0x7f5e03e5a48b (<unknown module>) #5 0x7f5e03e5adbd (<unknown module>) #6 0x55f95e4edbe5 in get_new_handler(TABLE_SHARE*, st_mem_root*, handlerton*) /home/yura/addon/local/percona-server/sql/handler.cc:688 #7 0x55f95f99ee19 in mysql_write_frm(st_lock_param_type*, unsigned int) /home/yura/addon/local/percona-server/sql/sql_table.cc:1873 #8 0x55f95f84ea2a in fast_alter_partition_table(THD*, TABLE*, Alter_info*, st_ha_create_information*, TABLE_LIST*, char*, char const*, partition_info*) /home/yura/addon/local/percona-server/sql/sql_partition.cc:7070 #9 0x55f95f9bb733 in mysql_alter_table(THD*, char const*, char const*, st_ha_create_information*, TABLE_LIST*, Alter_info*) /home/yura/addon/local/percona-server/sql/sql_table.cc:9984 #10 0x55f95ff03809 in Sql_cmd_alter_table::execute(THD*) /home/yura/addon/local/percona-server/sql/sql_alter.cc:348 #11 0x55f95f8155d3 in mysql_execute_command(THD*, bool) /home/yura/addon/local/percona-server/sql/sql_parse.cc:5136 #12 0x55f95f81d535 in mysql_parse(THD*, Parser_state*, bool) /home/yura/addon/local/percona-server/sql/sql_parse.cc:5905 #13 0x55f95f8227d2 in dispatch_command(THD*, COM_DATA const*, enum_server_command) /home/yura/addon/local/percona-server/sql/sql_parse.cc:1532 #14 0x55f95f828bd0 in do_command(THD*) /home/yura/addon/local/percona-server/sql/sql_parse.cc:1053 #15 0x55f95fb28a44 in handle_connection /home/yura/addon/local/percona-server/sql/conn_handler/connection_handler_per_thread.cc:318 #16 0x55f9602bc607 in pfs_spawn_thread /home/yura/addon/local/percona-server/storage/perfschema/pfs.cc:2190 #17 0x7f5e1acfa6da in start_thread /build/glibc-OTsEL5/glibc-2.27/nptl/pthread_create.c:463