[MDEV-13700] Assertion `global_status_var.global_memory_used == 0' or warnings "bytes lost" upon failure to start with non-existing init file Created: 2017-09-01  Updated: 2018-06-19

Status: Confirmed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: 10.2

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I'm not sure it's worth fixing, but I'll file it so that I don't need to think next time whether it's worth filing.

Start debug server with --init-file=non-existing-file, otherwise defaults

10.2+

2017-09-01 15:45:32 140103756365888 [ERROR] mysqld: Can't create/write to file 'non-existing-file' (Errcode: 2 "No such file or directory")
2017-09-01 15:45:32 140103756365888 [ERROR] Aborting
 
mysqld: /data/src/10.2/sql/mysqld.cc:2166: void mysqld_exit(int): Assertion `global_status_var.global_memory_used == 0' failed.
170901 15:45:34 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f41d30d2ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x0000564c4cbd4f48 in mysqld_exit (exit_code=1) at /data/src/10.2/sql/mysqld.cc:2166
#9  0x0000564c4cbd4e41 in unireg_abort (exit_code=1) at /data/src/10.2/sql/mysqld.cc:2134
#10 0x0000564c4cbdcab0 in mysqld_main (argc=12, argv=0x564c4f1cc7e8) at /data/src/10.2/sql/mysqld.cc:5996
#11 0x0000564c4cbd1540 in main (argc=12, argv=0x7ffc32c19498) at /data/src/10.2/sql/main.cc:25

5.5-10.1

170901 15:44:23 [ERROR] mysqld: File 'non-existing-file' not found (Errcode: 2)
170901 15:44:23 [ERROR] Aborting
 
170901 15:44:23  InnoDB: Starting shutdown...
170901 15:44:28  InnoDB: Shutdown completed; log sequence number 1621368
170901 15:44:28 [Note] /data/bld/5.5/bin/mysqld: Shutdown complete
 
Warning:  248 bytes lost, allocated at mysys/queues.c:79, sql/event_queue.cc:143, sql/events.cc:874, sql/mysqld.cc:4980, sql/main.cc:26, 0x7f7cca3592b1, 0x5509fa
Warning: 2048 bytes lost, allocated at mysys/array.c:65, mysys/hash.c:92, mysys/thr_mutex.c:178, mysys/thr_mutex.c:320, psi/mysql_thread.h:618, sql/event_queue.cc:714, sql/event_queue.cc:143, sql/events.cc:874
Warning: 2048 bytes lost, allocated at mysys/array.c:65, mysys/hash.c:92, mysys/thr_mutex.c:173, mysys/thr_mutex.c:320, psi/mysql_thread.h:618, sql/event_queue.cc:714, sql/event_queue.cc:143, sql/events.cc:874
Warning:  176 bytes lost, allocated at mysys/mulalloc.c:51, mysys/thr_mutex.c:160, mysys/thr_mutex.c:320, psi/mysql_thread.h:618, sql/event_queue.cc:714, sql/event_queue.cc:143, sql/events.cc:874, sql/mysqld.cc:4980
Warning: 2048 bytes lost, allocated at mysys/array.c:65, mysys/hash.c:92, mysys/thr_mutex.c:178, mysys/thr_mutex.c:320, psi/mysql_thread.h:618, sql/event_scheduler.cc:350, sql/events.cc:867, sql/mysqld.cc:4980
Warning: 2048 bytes lost, allocated at mysys/array.c:65, mysys/hash.c:92, mysys/thr_mutex.c:173, mysys/thr_mutex.c:320, psi/mysql_thread.h:618, sql/event_scheduler.cc:350, sql/events.cc:867, sql/mysqld.cc:4980
Warning:  176 bytes lost, allocated at mysys/mulalloc.c:51, mysys/thr_mutex.c:160, mysys/thr_mutex.c:320, psi/mysql_thread.h:618, sql/event_scheduler.cc:350, sql/events.cc:867, sql/mysqld.cc:4980, sql/main.cc:26
Warning:  288 bytes lost, allocated at mysys/my_new.cc:33, sql/events.cc:868, sql/mysqld.cc:4980, sql/main.cc:26, 0x7f7cca3592b1, 0x5509fa
Warning:  328 bytes lost, allocated at mysys/my_new.cc:33, sql/events.cc:867, sql/mysqld.cc:4980, sql/main.cc:26, 0x7f7cca3592b1, 0x5509fa
Warning:    1 bytes lost, allocated at mysys/my_new.cc:33, sql/events.cc:826, sql/mysqld.cc:4980, sql/main.cc:26, 0x7f7cca3592b1, 0x5509fa
Memory lost: 9409 bytes in 10 chunks



 Comments   
Comment by Michael Widenius [ 2018-06-19 ]

I was not able to repeat this in 10.2 and I agree this is not critical.

However in 10.3 we have a larger problem:

mysqld --init-file=non-existing-file
hangs the server at /my/maria-10.3/storage/innobase/handler/ha_innodb.cc:4299
pthread_join(thd_destructor_thread, NULL);

Some variables:
(gdb) p thd_destructor_thread
$1 = 139928952366848
(gdb) p abort_loop
$2 = false
(gdb) p running
$3 = (st_my_thread_var *) 0x7f43a40008c0

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