[MDEV-6091] mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server Created: 2014-04-14  Updated: 2014-05-06  Resolved: 2014-05-06

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.36, 10.0.10
Fix Version/s: 5.5.38, 10.0.11

Type: Bug Priority: Major
Reporter: Jean Weisbuch Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: dump-slave, mysqldump
Environment:

Debian Wheezy AMD64



 Description   

To reproduce the bug, launch a mysqldump with the --dump-slave option on a server it cannot connect or execute a "SHOW SLAVE STATUS" :

# mysqldump -hunknownhost --dump-slave nulldb
mysqldump: Got error: 2005: "Unknown MySQL server host 'unknownhost' (0)" when trying to connect
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
[...]
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
mysqldump: Couldn't execute 'SHOW SLAVE STATUS': MySQL server has gone away (2006)
Segmentation fault

Expected result: It shouldnt try to execute the "SHOW SLAVE STATUS" query as it cannot connect to the server and definitely not go on a loop and segfault.


Note: The bug might have appeared since MDEV-5624 has been fixed, i don't recall seeing that issue before 5.5.36 but I might be wrong about that.



 Comments   
Comment by Elena Stepanova [ 2014-04-14 ]

The error is the typo:

err:
  /* if --dump-slave , start the slave sql thread */
  if (opt_slave_data && do_start_slave_sql(mysql))
    goto err;

But I don't know what was meant to be done under if, so I'll leave it to serg to fix as initially intended.

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