Bug #102587 mysqlpump crashes with --default-parallelism=0 --single-transaction
Submitted: 12 Feb 18:53 Modified: 13 Feb 6:17
Reporter: Sveta Smirnova (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqlpump Command-line Client Severity:S3 (Non-critical)
Version:8.0.23, 5.7.33 OS:Any
Assigned to: CPU Architecture:Any

[12 Feb 18:53] Sveta Smirnova
Description:
mysqlpump crashes with options --default-parallelism=0 --single-transaction

stack trace:

Core was generated by `../bin/mysqlpump --host=127.0.0.1 -P13000 -uroot --default-parallelism=0 --sing'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000000042c431 in Mysql::Tools::Dump::Single_transaction_connection_provider::Single_transaction_connection_provider(Mysql::Tools::Base::I_connection_factory*, unsigned int, std::function<bool (Mysql::Tools::Base::Message_data const&)>*) (this=0x2a5ea40, connection_factory=<optimized out>, connections=<optimized out>, message_handler=0x2a616c0)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_vector.h:930
930	/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_vector.h: No such file or directory.
(gdb) bt
#0  0x000000000042c431 in Mysql::Tools::Dump::Single_transaction_connection_provider::Single_transaction_connection_provider(Mysql::Tools::Base::I_connection_factory*, unsigned int, std::function<bool (Mysql::Tools::Base::Message_data const&)>*) (this=0x2a5ea40, connection_factory=<optimized out>, connections=<optimized out>, message_handler=0x2a616c0)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_vector.h:930
#1  0x00000000004123d8 in Mysql::Tools::Dump::Program::execute (this=0x7ffca345e570, positional_options=std::vector of length 0, capacity 0) at ../../../mysql-8.0.23/client/dump/program.cc:152
#2  0x000000000044850e in Mysql::Tools::Base::Abstract_program::run (this=0x7ffca345e570, argc=<optimized out>, argv=<optimized out>) at ../../../mysql-8.0.23/client/base/abstract_program.cc:88
#3  0x00000000004104c3 in main (argc=6, argv=0x7ffca345eb68) at ../../../mysql-8.0.23/client/dump/program.cc:275

How to repeat:
./mtr --start innodb &

Then

$ ../bin/mysqlpump --host=127.0.0.1 -P13000 -uroot --default-parallelism=0 --single-transaction
Segmentation fault (core dumped)

Suggested fix:
Workaround: either set --default-parallelism to a value >= 1 or don't use --single-transaction
[13 Feb 6:17] MySQL Verification Team
Hello Sveta,

Thank you for the report and feedback.
Verified as described.

regards,
Umesh
[13 Feb 6:19] MySQL Verification Team
- 8.0.23

(gdb) bt
#0  0x000000000042c431 in Mysql::Tools::Dump::Single_transaction_connection_provider::Single_transaction_connection_provider(Mysql::Tools::Base::I_connection_factory*, unsigned int, std::function<bool (Mysql::Tools::Base::Message_data const&)>*) ()
#1  0x00000000004123d8 in Mysql::Tools::Dump::Program::execute(std::vector<std::string, std::allocator<std::string> > const&) ()
#2  0x000000000044850e in Mysql::Tools::Base::Abstract_program::run(int, char**) ()
#3  0x00000000004104c3 in main ()
(gdb)

- 5.7.33

(gdb) bt
#0  0x000000000043505c in Mysql::Tools::Dump::Single_transaction_connection_provider::Single_transaction_connection_provider (this=0x14a8fa0, connection_factory=<optimized out>, connections=<optimized out>, message_handler=0x14a9520)
    at /var/lib/pb2/sb_1-1352104-1607570233.72/mysql-5.7.33/client/dump/single_transaction_connection_provider.cc:77
#1  0x000000000041cf11 in Mysql::Tools::Dump::Program::execute (this=0xc2ff40 <program>, positional_options=std::vector of length 0, capacity 0) at /var/lib/pb2/sb_1-1352104-1607570233.72/mysql-5.7.33/client/dump/program.cc:158
#2  0x0000000000456b67 in Mysql::Tools::Base::Abstract_program::run (this=0xc2ff40 <program>, argc=0, argv=0x14a93e8) at /var/lib/pb2/sb_1-1352104-1607570233.72/mysql-5.7.33/client/base/abstract_program.cc:105
#3  0x000000000041c055 in main (argc=<optimized out>, argv=<optimized out>) at /var/lib/pb2/sb_1-1352104-1607570233.72/mysql-5.7.33/client/dump/program.cc:292
(gdb)