mecab plugin を使用しています。
全文検索を行う対象のテーブルに対して、全文検索を行っている最中にINSERTなどの処理が行われるとmysqldがcrashしてまいます。
クラッシュ時のログとしては、下記のようになっています。
*** glibc detected *** /usr/sbin/mysqld: corrupted double-linked list: 0x000000002f49c240 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3f53c7175c]
/lib64/libc.so.6(cfree+0x8c)[0x3f53c74e7c]
/usr/lib/libmecab.so.1(_ZNSt6vectorIP12mecab_node_tSaIS1_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS1_S3_EEmRKS1_+0x179)[0x2aaad430de89]
/usr/lib/libmecab.so.1(_ZN5MeCab7Viterbi7analyzeEPKcm+0x15c)[0x2aaad430d25c]
/usr/lib/libmecab.so.1(_ZN5MeCab10TaggerImpl11parseToNodeEPKcm+0x21)[0x2aaad4325181]
/usr/lib64/mysql/plugin/libftmecab.so[0x2aaad40cb023]
/usr/lib64/mysql/plugin/libftmecab.so[0x2aaad40cbd1d]
/usr/sbin/mysqld(ft_boolean_find_relevance+0x158)[0x7eeb78]
/usr/sbin/mysqld(ft_boolean_read_next+0x1da)[0x7ef34a]
/usr/sbin/mysqld(_ZN9ha_myisam7ft_readEPh+0x4e)[0x7f0a3e]
:
:(添付しました)
:
core.dumpより、下記のような状況になっていますので、MecabのViterbi::analyzeの呼び出しがうまくいかないようです
#0 0x000000393ac0b142 in pthread_kill () from /lib64/libpthread.so.0
#1 0x00000000005d6ad3 in handle_segfault (sig=6) at mysqld.cc:2508
#2 <signal handler called>
#3 0x000000393a030155 in raise () from /lib64/libc.so.6
#4 0x000000393a031bf0 in abort () from /lib64/libc.so.6
#5 0x000000393a06a3db in __libc_message () from /lib64/libc.so.6
#6 0x000000393a0715ac in _int_free () from /lib64/libc.so.6
#7 0x000000393a074ccc in free () from /lib64/libc.so.6
#8 0x00002aaaabd69e89 in std::vector<mecab_node_t*, std::allocator<mecab_node_t*> >::_M_fill_insert ()
from /usr/lib/libmecab.so.1
#9 0x00002aaaabd6925c in MeCab::Viterbi::analyze () from /usr/lib/libmecab.so.1
#10 0x00002aaaabd81181 in MeCab::TaggerImpl::parseToNode () from /usr/lib/libmecab.so.1
#11 0x00002aaaabb27023 in mecabize_add () from /usr/lib64/mysql/plugin/libftmecab.so
#12 0x00002aaaabb27d1d in mecab_parser_parse () from /usr/lib64/mysql/plugin/libftmecab.so
show index >>
mysql> show index from text_schema.MecabText;
+------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| MecabText | 0 | PRIMARY | 1 | id | A | NULL | NULL | NULL | | BTREE | |
| MecabText | 0 | PRIMARY | 2 | id | A | 33801 | NULL | NULL | | BTREE | |
| MecabText | 1 | ftxt_t | 1 | t | NULL | 8450 | NULL | NULL | | FULLTEXT | |
| MecabText | 1 | ftxt_d | 1 | d | NULL | 33801 | NULL | NULL | | FULLTEXT | |
| MecabText | 1 | ftxt_k | 1 | k | NULL | 11267 | NULL | NULL | | FULLTEXT | |
| MecabText | 1 | ftxt_c | 1 | c | NULL | 786 | NULL | NULL | | FULLTEXT | |
| MecabText | 1 | ftxt_all | 1 | t | NULL | 33801 | NULL | NULL | | FULLTEXT | |
| MecabText | 1 | ftxt_all | 2 | d | NULL | 33801 | NULL | NULL | | FULLTEXT | |
| MecabText | 1 | ftxt_all | 3 | k | NULL | 33801 | NULL | NULL | | FULLTEXT | |
| MecabText | 1 | ftxt_all | 4 | c | NULL | 33801 | NULL | NULL | | FULLTEXT | |
+------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
create table >>
create table `text_schema`.`MecabText`(
`id` mediumint(8) unsigned NOT NULL,
`uid` mediumint(8) unsigned not null,
`t` varchar(50) not null,
`d` varchar(2000) not null,
`k` varchar(10000) not null,
`c` varchar(5000) not null,
`last_updated_at` datetime not null,
primary key(`id`, `uid`),
fulltext `ftxt_t`(`t`) WITH PARSER mecab,
fulltext `ftxt_d`(`d`) WITH PARSER mecab,
fulltext `ftxt_k`(`k`) WITH PARSER mecab,
fulltext `ftxt_c`(`c`) WITH PARSER mecab,
fulltext `ftxt_all`(`t`, `d`, `k`, `c`) WITH PARSER mecab
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
以上、よろしくお願いします
crash log
mecab の辞書は UTF-8 でしょうか?それとも標準の EUC-JP でしょうか?
すみません、以下の点もお願いいたします。
・mecab のバージョン
・glibc のバージョン
こまんどでは:
$ mecab -v
$ /lib64/libc.so.6
すいません、遅くなってしまいました。
# uname -a
Linux dbs003 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64
x86_64 x86_64 GNU/Linux
# mecab -v
mecab of 0.97
# /lib64/libc.so.6
GNU C Library stable release version 2.5, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2 20071124 (Red Hat 4.1.2-42).
Compiled on a Linux 2.6.9 system on 2008-12-02.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
RT using linux kernel aio
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
mecabの辞書は UTF-8 を利用しております。(IPA辞書とユーザ辞書ともにUTF-8)
よろしくお願いします。
また、mecab plugin は mysqlftppc-mecab-1.6 を利用しています。
ICUは利用していません。
mysql> show status like '%mecab%';
+---------------+------------------------------+
| Variable_name | Value |
+---------------+------------------------------+
| Mecab_info | with mecab 0.97, without ICU |
+---------------+------------------------------+