[MDEV-9087] Assertion `(longlong) thd->status_var.memory_used >= 0' fails in my_malloc_size_cb_func on second post of feedback report Created: 2015-11-05  Updated: 2015-12-16  Resolved: 2015-12-15

Status: Closed
Project: MariaDB Server
Component/s: Plugins
Affects Version/s: 10.0, 10.1
Fix Version/s: 10.0.23, 10.1.10

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: feedback

Issue Links:
Relates
relates to MDEV-9051 mysqld got signal 11, after upgrade t... Closed
relates to MDEV-9088 Server crashes on shutdown after the ... Closed

 Description   

Note: I've modified time intervals to get the 2nd call in reasonable time, but it happens with real values as well – in a day after the server start.

2015-11-05 18:48:56 139805530781440 [Note] feedback plugin: report to 'https://mariadb.org/feedback_plugin/post' was sent
2015-11-05 18:48:56 139805530781440 [Note] feedback plugin: server replied 'ok'
2015-11-05 18:50:57 139805530781440 [Note] feedback plugin: report to 'https://mariadb.org/feedback_plugin/post' was sent
2015-11-05 18:51:02 139805530781440 [Note] feedback plugin: server replied 'ok'
mysqld: /home/elenst/git/10.1-bug/sql/mysqld.cc:4018: void my_malloc_size_cb_func(long long int, my_bool): Assertion `(longlong) thd->status_var.local_memory
_used >= 0' failed.
151105 18:51:02 [ERROR] mysqld got signal 6 ;

#7  0x00007f272ec25192 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x00007f27310d7064 in my_malloc_size_cb_func (size=-256, is_thread_specific=1 '\001') at sql/mysqld.cc:4018
#9  0x00007f2731a2516f in update_malloc_size (size=-256, is_thread_specific=1 '\001') at mysys/my_malloc.c:67
#10 0x00007f2731a25687 in my_free (ptr=0x7f270200e970) at mysys/my_malloc.c:215
#11 0x00007f27319fd4d7 in delete_dynamic (array=0x7f27020fa6a0) at mysys/array.c:302
#12 0x00007f2731a02c2d in my_hash_free (hash=0x7f27020fa678) at mysys/hash.c:146
#13 0x00007f27311601b4 in THD::cleanup (this=0x7f27020fa070) at sql/sql_class.cc:1612
#14 0x00007f2731160433 in THD::~THD (this=0x7f27020fa070, __in_chrg=<optimised out>) at sql/sql_class.cc:1656
#15 0x00007f2731160892 in THD::~THD (this=0x7f27020fa070, __in_chrg=<optimised out>) at sql/sql_class.cc:1708
#16 0x00007f27319e5ff0 in feedback::send_report (when=0x0) at plugin/feedback/sender_thread.cc:268
#17 0x00007f27319e6108 in feedback::background_thread (arg=0x0) at plugin/feedback/sender_thread.cc:291
#18 0x00007f272f5bce9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#19 0x00007f272ece9cbd in clone () from /lib/x86_64-linux-gnu/libc.so.6

Happens with -DCMAKE_BUILD_TYPE=Debug, both static and dynamic FEEDBACK plugin.



 Comments   
Comment by Elena Stepanova [ 2015-12-16 ]

The bug was fixed by the following commit:

commit 2553f143fdeb9068eb02a8fda58750c24071f5ef ab476a8d107b3e5b591944b2b5eb3a21d6d003a1
Author: Sergei Golubchik <serg@mariadb.org>
Date:   Thu Nov 19 10:17:40 2015 +0100
 
    fix feedback plugin not to crash in debug builds
    
    feedback was bzero-ing thd->status_vars.memory_used,
    but server was asserting the correct value of it

Generated at Thu Feb 08 07:32:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.