2009-06-07, 04:00 PM
Environment:
CentOS 5.3 X86_64
To reproduce:
1. add a non-empty stopwords list and make sure the filename matches the rules like 'stops.utf8.txt' or 'stops.txt' so it can be loaded by the plugin.
2. start mysql server by 'service mysql start'
3. stop mysql server by 'service mysql stop'
you will see it crashes for trying to free memory at an incorrect address.
Reason:
the crash is because the pointer passed to function stop_word_free is not the one allocated at function stop_tree_load. For some reason, the one assumed to be freed still points to a valid and correct string. :-)
Solution:
Use mysql tree to manage the allocation / free of tree elements.
Attached is the result of 'diff -EbBu' for plugin_scws.c:
Discussion is welcomed.
CentOS 5.3 X86_64
To reproduce:
1. add a non-empty stopwords list and make sure the filename matches the rules like 'stops.utf8.txt' or 'stops.txt' so it can be loaded by the plugin.
2. start mysql server by 'service mysql start'
3. stop mysql server by 'service mysql stop'
you will see it crashes for trying to free memory at an incorrect address.
Reason:
the crash is because the pointer passed to function stop_word_free is not the one allocated at function stop_tree_load. For some reason, the one assumed to be freed still points to a valid and correct string. :-)
Solution:
Use mysql tree to manage the allocation / free of tree elements.
Attached is the result of 'diff -EbBu' for plugin_scws.c:
Discussion is welcomed.
