Bug #33288 CTRL-R causes Segmentation fault
Submitted: 17 Dec 2007 11:19 Modified: 9 Apr 2008 16:18
Reporter: Susanne Ebrecht Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version: 5.0.54-debug (bk) OS:Any (FreeBSD Mac OS X 64-bit)
Assigned to: Daniel Fischer CPU Architecture:Any

[17 Dec 2007 11:19] Susanne Ebrecht
Description:
BK-tree from 2007-12-14

mysql> select version()\G
*************************** 1. row ***************************
version(): 5.0.54-debug

mysql> CTRL-r
mysql> Segmentation fault: 11 (core dumped)

This don't occur in 5.1.22 or 6.0 and also not in 5.0.51 released version. It only occurs on "BK" version.

How to repeat:
Type CTRL-r at the CLI for history search.
[17 Dec 2007 12:58] Susanne Ebrecht
I figured out:

The "config_readline.h" is missing in display.c

New workaround:

Edit mysql50bksrc/mysql-5.0/cmd-line-utils/readline/display.c

/* Add config_readline.h */
# include "config_readline.h"

Compile and install the source again ...

After this, CTRL-R works fine.

Problem without this header is using the wrong prototype (without VARARGS instead of with VARARGS).
[17 Dec 2007 13:20] Hartmut Holzgraefe
Looks as if on upgrading the bundled readline source
the previous changes to the bundled source to make
it work within the mysql code where not applied again,
see e.g. display.c revision 1.12 from 

ChangeSet 1.1860.88.2 2005/07/18 18:00:19 jimw@mysql.com
  Reimplement use of "config_readline.h" to get readline configuration.
cmd-line-utils/readline/display.c 1.12 2005/07/18 18:00:15 jimw@mysql.com
  Include local config_readline.h instead of config.h

suggested fix: reapply all needed changes from old bundled readline
code to new one
[17 Dec 2007 17:14] Daniel Fischer
Possibly related to bug#33057.
[11 Feb 2008 14:21] Daniel Fischer
Patch restoring previous modifications is queued in 5.0-build.
[15 Feb 2008 9:36] Mattias Jonsson
This was also found when testing 5.0.56 (before release) on mac (but only the 64-bit versions)
[17 Feb 2008 22:53] Kay Roepke
Is the patch included in 5.1.23rc2?

In the latest x86_64 build on Mac OS 10.5 this still crashes.
I can open a separate bug report if necessary.
[28 Mar 2008 9:35] Daniel Fischer
Queued is wrong; the patch is already in main.
[9 Apr 2008 16:18] Jon Stephens
1. Changed category from Compiling to Command-Line Clients.

2. Documented fix in the 5.1.24 changelog as follows:

        Using Control-R in the mysql client caused it to crash.