Kazuhiro Osawa
ko****@yappo*****
2005年 10月 29日 (土) 13:31:34 JST
大沢です。
下記の環境、下記の条件でalter tableでのfulltextインデックス作成時に
Segmentation fault.がでました。
OS: CentOS 4.2
MySQL: 4.0.26
Senna: Revision: 54
/etc/my.cnf: ft_min_word_len=2
etc: バインディングパッチを改変することなく、素直にセットアップした
------------------------------------------mysqlコマンド側の挙動
mysql> alter table SEARCH_DATA add fulltext SEARCH_TEXT(SEARCH_TEXT);
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
------------------------------------------
------------------------------------------gdbの結果
bash-3.00$ gdb ./libexec/mysqld
(gdb) run
Starting program: /home/mysql/libexec/mysqld
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1208097088 (LWP 26106)]
(no debugging symbols found)
051029 12:46:11 Warning: setrlimit couldn't increase number of open files to more than 1024 (request: 2510)
051029 12:46:11 Warning: Changed limits: max_connections: 500 table_cache: 257
[New Thread -1292682320 (LWP 26109)]
[New Thread -1303172176 (LWP 26110)]
[New Thread -1313662032 (LWP 26111)]
[New Thread -1324151888 (LWP 26112)]
[New Thread -1339421776 (LWP 26113)]
[New Thread -1349911632 (LWP 26114)]
[New Thread -1360401488 (LWP 26115)]
051029 12:46:11 InnoDB: Started
[New Thread -1505113168 (LWP 26116)]
/home/mysql/libexec/mysqld: ready for connections.
Version: '4.0.26' socket: '/tmp/mysql.sock' port: 3306 Source distribution
[New Thread -1505317968 (LWP 26117)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1505317968 (LWP 26117)]
0x001246a5 in sen_lex_open (sym=0x90a27d0,
str=0x94c5a008 "http://site-s.com/kosaka/ ミスマガ!小阪由佳! ミスマガジン小阪由佳の待ち受けサイト 小阪由佳 ミスマガジン 壁紙 待ち受け グラビア ", '?' <repeats 12 times>, "\217・????\217・??????歹\001\0043??\016??\217妃攀??\001????\b", '?' <repeats 20 times>..., addp=Variable "addp" is not available.
) at lex.c:225
225 for (p = s + strlen(s) - 1; *p == '\n' || isspace(*p); p--) { *p = '\0'; }
------------------------------------------
------------------------------------------bt
(gdb) bt
#0 0x001246a5 in sen_lex_open (sym=0x90a27d0,
str=0x94c5a008 "http://site-s.com/kosaka/ ミスマガ!小阪由佳! ミスマガジン小阪由佳の待ち受けサイト 小阪由佳 ミスマガジン 壁紙 待ち受け グラビア ", '?' <repeats 12 times>, "\217・????\217・??????歹\001\0043??\016??\217妃攀??\001????\b", '?' <repeats 20 times>..., addp=Variable "addp" is not available.
) at lex.c:225
#1 0x00126ac4 in sen_index_add (i=0x9070c40, key=0xa6466b8c,
value=0x94c5a008 "http://site-s.com/kosaka/ ミスマガ!小阪由佳! ミスマガジン小阪由佳の待ち受けサイト 小阪由佳 ミスマガジン 壁紙 待ち受け グラビア ", '?' <repeats 12 times>, "\217・????\217・??????歹\001\0043??\016??\217妃攀??\001????\b", '?' <repeats 20 times>...) at index.c:731
#2 0x00126d9b in sen_index_upd (i=0x9070c40, key=0xa6466b8c, oldvalue=0x0,
newvalue=0x94c5a008 "http://site-s.com/kosaka/ ミスマガ!小阪由佳! ミスマガジン小阪由佳の待ち受けサイト 小阪由佳 ミスマガジン 壁紙 待ち受け グラビア ", '?' <repeats 12 times>, "\217・????\217 ・??????歹\001\0043??\016??\217妃攀??\001????\b", '?' <repeats 20 times>...) at index.c:806
#3 0x082d734f in ft_sen_index_add ()
#4 0x082d2055 in sort_ft_key_read ()
#5 0x082dacdb in _create_index_by_sort ()
#6 0x082d551e in mi_repair_by_sort ()
#7 0x0816c85e in ha_myisam::repair ()
#8 0x0816cd41 in ha_myisam::activate_all_index ()
#9 0x0817ea70 in mysql_alter_table ()
#10 0x08112b25 in mysql_execute_command ()
#11 0x0811608c in mysql_parse ()
#12 0x08116b94 in dispatch_command ()
#13 0x0811788c in handle_one_connection ()
#14 0x00c9a341 in start_thread () from /lib/tls/libpthread.so.0
#15 0x00b1a6fe in clone () from /lib/tls/libc.so.6
------------------------------------------
基本的にデータはEUCなのですが、落ちたデータが入っている行の内容は
文字コードがぐちゃぐちゃに存在しているようでした。
#もちろん、該当サイトが汚いわけでなくこちら側のクロウラのbugです
ちなみにN-gramを使うようにコードを変更
http://blog.nomadscafe.jp/archives/000408.html
したところ再現せずに、indexの作成を完了しました。
---
osawa