Segmentation fault when using --rows

Bug #1568855 reported by georgi iovchev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Data Dumper
Fix Committed
High
Max Bubenick

Bug Description

mydumper 0.9.1, centos 7.2, mysql 5.6.28

when using --rows option mydumper crashes with segmentation fault error.

Here is some info from gdb:

# gdb mydumper
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/bin/mydumper...done.
(gdb) run --rows=10000 -o /srv/ggg/dmp
Starting program: /usr/local/bin/mydumper --rows=10000 -o /srv/ggg/dmp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff5e52700 (LWP 20047)]
[New Thread 0x7ffff5651700 (LWP 20048)]
[New Thread 0x7ffff4e50700 (LWP 20049)]
[New Thread 0x7fffe7fff700 (LWP 20050)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff63ab167 in ____strtoll_l_internal () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glib2-2.42.2-5.el7.x86_64 glibc-2.17-106.el7_2.4.x86_64 libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 pcre-8.32-15.el7.x86_64 zlib-1.2.7-15.el7.x86_64
(gdb) bt
#0 0x00007ffff63ab167 in ____strtoll_l_internal () from /lib64/libc.so.6
#1 0x00000000004060ec in get_chunks_for_table (conn=<optimized out>, database=<optimized out>, table=<optimized out>, conf=<optimized out>) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:1623
#2 0x0000000000406a8d in dump_table (conn=<optimized out>, database=0x658620 "ppp_v3", table=0x658640 "WithdrawalRequestHistory", conf=0x7fffffffde80, is_innodb=1) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:2554
#3 0x0000000000408a07 in start_dump (conn=0x615980) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:1385
#4 0x0000000000404b82 in main (argc=1, argv=0x7fffffffe048) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:919
(gdb) bt full
#0 0x00007ffff63ab167 in ____strtoll_l_internal () from /lib64/libc.so.6
No symbol table info available.
#1 0x00000000004060ec in get_chunks_for_table (conn=<optimized out>, database=<optimized out>, table=<optimized out>, conf=<optimized out>) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:1623
        chunks = 0x0
        indexes = 0x2baf400
        minmax = 0x6b66c0
        row = <optimized out>
        field = 0x2bb34b9 "customFeeId"
        showed_nulls = 0
        query = <optimized out>
        fields = <optimized out>
        min = <optimized out>
        max = <optimized out>
        rows = 294262
        estimated_chunks = 29
        estimated_step = <optimized out>
        nmin = <optimized out>
        nmax = <optimized out>
        cutoff = <optimized out>
#2 0x0000000000406a8d in dump_table (conn=<optimized out>, database=0x658620 "ppp_v3", table=0x658640 "WithdrawalRequestHistory", conf=0x7fffffffde80, is_innodb=1) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:2554
        chunks = 0x0
#3 0x0000000000408a07 in start_dump (conn=0x615980) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:1385
        conf = {use_any_index = 1 '\001', queue = 0x631400, queue_less_locking = 0x0, ready = 0x631450, ready_less_locking = 0x0, unlock_tables = 0x6314a0, mutex = 0x0, done = 0}
        p = 0x631100 "/srv/ggg/dmp/metadata.partial"
        p2 = 0x631150 "/srv/ggg/dmp/metadata"
        p3 = <optimized out>
        u = <optimized out>
        nits = 0x7fffffffddc8
        nitl = 0x7fffffffdd98
        tn = <optimized out>
        min = <optimized out>
        t = 1460379926
        dbt = <optimized out>
        sp = <optimized out>
        n = <optimized out>
        nufile = 0x0
        mdfile = 0x631170
        rest = <optimized out>
        threads = <optimized out>
        td = 0x6313b0
#4 0x0000000000404b82 in main (argc=1, argv=0x7fffffffe048) at /tmp/mydumper/mydumper-0.9.1/mydumper.c:919
        conn = <optimized out>
        error = 0x0
        context = <optimized out>
        main_group = <optimized out>
        t = 1460379926
(gdb)

georgi iovchev (geo-pro)
description: updated
Revision history for this message
Max Bubenick (max-bubenick) wrote :

Hi, thanks for the report this seems to be a duplicate of lp:1525216

Please try compiling from this code where the fix was merged

https://github.com/maxbube/mydumper

Revision history for this message
georgi iovchev (geo-pro) wrote :

The table on which mydumper failed does NOT have any index, it does not have primary key too.
I think that mydumper should not try to split "unsplittable" tables

Changed in mydumper:
assignee: nobody → Max Bubenick (max-bubenick)
status: New → Incomplete
importance: Undecided → High
Revision history for this message
Max Bubenick (max-bubenick) wrote :

Are you sure is crashing on that table? If that were the case, no indexes at all, mydumper should not be executing the code where is crashing.

Could you please add hare reproducible case?

Revision history for this message
georgi iovchev (geo-pro) wrote :

It had a foreign key index, but all values were null.
Here is reproducible case:

$ mysql testdb -e"create table t0 (id int not null primary key)"
$ mysql testdb -e"create table t1 (a int, b varchar(50),c int null default null, constraint fk_t0 foreign key (c) references t0(id))"
$ mysql testdb -e"show create table t1\G"
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL,
  `b` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `c` int(11) DEFAULT NULL,
  KEY `fk_t0` (`c`),
  CONSTRAINT `fk_t0` FOREIGN KEY (`c`) REFERENCES `t0` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin

## insert 2000 rows with NULL value for the foreign key column
$ for i in {1..2000}; do mysql testdb -e"insert into t0(id) values($i); insert into t1 (a,b,c) values($RANDOM,$RANDOM,NULL)"; done

## dump t1 table
$ mydumper --rows=1000 --regex='^testdb\.t1$' --outputdir=dump
Segmentation fault

Revision history for this message
Max Bubenick (max-bubenick) wrote :

Thanks for looking at it, so yes, its a duplicate of lp:1525216 and the fix was already committed in the link I sent in my previous message and will be in the next release.

Changed in mydumper:
milestone: none → 0.9.3
Revision history for this message
Max Bubenick (max-bubenick) wrote :
Changed in mydumper:
status: Incomplete → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.