Bug #12974 mysqld --no-defaults --sql-bin-update-same crashes with a segfault
Submitted: 4 Sep 2005 0:00 Modified: 31 Oct 2005 19:37
Reporter: Alexander Pachev Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.0.13-BK OS:Linux (Linux)
Assigned to: Bugs System CPU Architecture:Any

[4 Sep 2005 0:00] Alexander Pachev
Tried this on the 5.0.12 binary as well as the latest bk tree:

sh$/usr/sbin/mysqld --no-defaults --sql-bin-update-same
Segmentation fault (core dumped)

How to repeat:
See description

Suggested fix:
The crash happens right here:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 17228)]
0x085a3705 in handle_options (argc=0xbffff130, argv=0xbffff134,
    longopts=0x86e0800, get_one_option=0x81dbe68 <get_one_option>)
    at my_getopt.c:346
346                 *((my_bool*) value)= tmp;

(gdb) bt
#0  0x085a3705 in handle_options (argc=0xbffff130, argv=0xbffff134,
    longopts=0x86e0800, get_one_option=0x81dbe68 <get_one_option>)
    at my_getopt.c:346
#1  0x081dcf20 in get_options (argc=1, argv=0x88050e4) at mysqld.cc:6831
#2  0x081d9375 in init_common_variables (conf_file_name=0x860a1ca "my",
    argc=2, argv=0x88050e0, groups=0x86e07dc) at mysqld.cc:2549
#3  0x081da4f5 in main (argc=3, argv=0xbffff254) at mysqld.cc:3138
[4 Sep 2005 0:13] Alexander Pachev
The problem is right here:

{"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
   "The update log is deprecated since version 5.0, is replaced by the binary \
log and this option does nothing anymore.",
   0, 0, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},

We are telling handle_options() to store a value at the 0 address. We should have something like GET_DEPRECIATED instead of GET_BOOL, or find some other way to deal with depreciated options. Maybe add a blackhole variable bool opt_bool_depreciated ?
[4 Sep 2005 8:02] Valeriy Kravchuk
Repeated on 5.0.13-BK build of August 2nd also:

[openxs@Fedora 5.0]$ bin/mysqld_safe --no-defaults --sql-bin-update-same
Starting mysqld daemon with databases from /home/openxs/dbs/5.0/var
bin/mysqld_safe: line 1:  1691 Segmentation fault      nohup /home/openxs/dbs/5.
0/libexec/mysqld --no-defaults --basedir=/home/openxs/dbs/5.0 --datadir=/home/op
enxs/dbs/5.0/var --pid-file=/home/openxs/dbs/5.0/var/Fedora.pid --skip-locking -
-sql-bin-update-same >>/home/openxs/dbs/5.0/var/Fedora.err 2>&1
STOPPING server from pid file /home/openxs/dbs/5.0/var/Fedora.pid
050904 10:54:13  mysqld ended

Nothing special in the error log.
[23 Oct 2005 0:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

[29 Oct 2005 22:37] Alexander Pachev
fixed in 5.0.16
[31 Oct 2005 19:37] Paul Dubois
Noted in 5.0.16 changelog.