Bug #52622 valgrind warnings from rtree_page_mgr
Submitted: 6 Apr 2010 16:15 Modified: 23 Jun 2010 12:41
Reporter: Mark Callaghan Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.1.45, 5.1 bzr OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: gis, mtr, valgrind

[6 Apr 2010 16:15] Mark Callaghan
Description:
I get intermittent valgrind warnings from main.gis when running mtr

==19729== Invalid write of size 8
==19729==    at 0x8782F6: rtree_page_mbr (rt_mbr.c:739)
==19729==    by 0x875014: rtree_set_key_mbr (rt_key.c:103)
==19729==    by 0x873E14: rtree_insert_level (rt_index.c:667)
==19729==    by 0x874549: rtree_insert (rt_index.c:712)
==19729==    by 0x85E18A: mi_write (mi_write.c:125)
==19729==    by 0x842862: ha_myisam::write_row(unsigned char*) (ha_myisam.cc:780)
==19729==    by 0x6AB19E: handler::ha_write_row(unsigned char*) (handler.cc:4748)
==19729==    by 0x62F33C: write_record(THD*, st_table*, st_copy_info*) (sql_insert.cc:1606)
==19729==    by 0x632B97: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:835)
==19729==    by 0x5AF5D4: mysql_execute_command(THD*, unsigned long long*) (sql_parse.cc:3357)
==19729==    by 0x5B3820: mysql_parse(THD*, char const*, unsigned, char const**, unsigned long long*) (sql_parse.cc:6256)
==19729==    by 0x5B4CC7: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1259)
==19729==    by 0x5B58CD: do_command(THD*) (sql_parse.cc:895)
==19729==    by 0x5A43B9: handle_one_connection (sql_connect.cc:1131)
==19729==    by 0x328F8062F6: start_thread (in /lib64/libpthread-2.5.so)
==19729==    by 0x328ECD1E3C: clone (in /lib64/libc-2.5.so)
==19729==  Address 0x58A2EC0 is just below the stack ptr.  To suppress, use: --workaround-gcc296-bugs=yes

==19729== Invalid write of size 4
==19729==    at 0x8782FD: rtree_page_mbr (rt_mbr.c:739)
==19729==    by 0x875014: rtree_set_key_mbr (rt_key.c:103)
==19729==    by 0x873E14: rtree_insert_level (rt_index.c:667)
==19729==    by 0x874549: rtree_insert (rt_index.c:712)
==19729==    by 0x85E18A: mi_write (mi_write.c:125)
==19729==    by 0x842862: ha_myisam::write_row(unsigned char*) (ha_myisam.cc:780)
==19729==    by 0x6AB19E: handler::ha_write_row(unsigned char*) (handler.cc:4748)
==19729==    by 0x62F33C: write_record(THD*, st_table*, st_copy_info*) (sql_insert.cc:1606)
==19729==    by 0x632B97: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:835)
==19729==    by 0x5AF5D4: mysql_execute_command(THD*, unsigned long long*) (sql_parse.cc:3357)
==19729==    by 0x5B3820: mysql_parse(THD*, char const*, unsigned, char const**, unsigned long long*) (sql_parse.cc:6256)
==19729==    by 0x5B4CC7: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1259)
==19729==    by 0x5B58CD: do_command(THD*) (sql_parse.cc:895)
==19729==    by 0x5A43B9: handle_one_connection (sql_connect.cc:1131)
==19729==    by 0x328F8062F6: start_thread (in /lib64/libpthread-2.5.so)
==19729==    by 0x328ECD1E3C: clone (in /lib64/libc-2.5.so)
==19729==  Address 0x58A2EBC is just below the stack ptr.  To suppress, use: --workaround-gcc296-bugs=yes

How to repeat:
Build mysql 5.1.45 with the facebook patch and 

./configure --enable-thread-safe-client --with-plugins=csv,blackhole,myisam,heap,innodb_plugin --without-plugin-innobase --with-fast-mutexes --with-extra-charsets=all --with-debug C_EXTRA_FLAGS="-fno-omit-frame-pointer -DHAVE_purify -DNO_ALARM -DSIGNAL_WITH_VIO_CLOSE"

centos 5.2

gcc-4.1.2

valgrind-3.2.1
[7 Apr 2010 7:49] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior with current BZR sources. Does it fail without Facebook patch?
[7 Apr 2010 14:07] Mark Callaghan
It reproduces with unmodified 5.1.45
[7 Apr 2010 20:03] Sveta Smirnova
Thank you for the feedback.

Verified as described. Problem only repeatable with gcc 4.1.2
[15 Apr 2010 9:23] Georgi Kodinov
Tried with the latest mysql-5.1-bugteam. Not able to reproduce on the following platforms:
 - sles10 32 bit gcc 4.1.2 + valgrind-3.5
 - fedora 12 64 bit gcc 4.4.3 + valgrind-3.5
 
Installing mysql sources on a fresh centos-5.2 virtual machine to try with this one as well
[15 Apr 2010 11:11] Georgi Kodinov
Wasn't able to repeat the valgrind warnings on fully yum-udated CentOS 5.2 with gcc 4.1.2 and valgrind 3.2.1 (both from the centos repositories) on the latest mysql-5.1-bugteam.
[15 Apr 2010 11:12] Georgi Kodinov
Sveta,

Can you please provide concise steps to reproduce these warnings ?
[15 Apr 2010 12:48] Sveta Smirnova
On blade12 with mysql-5.1 bzr tree:

./configure --prefix=/users/ssmirnova/blade12/build/mysql-5.1 --enable-thread-safe-client --with-plugins=csv,blackhole,myisam,heap,innodb_plugin --without-plugin-innobase --with-fast-mutexes --with-extra-charsets=all --with-debug C_EXTRA_FLAGS="-fno-omit-frame-pointer -DHAVE_purify -DNO_ALARM -DSIGNAL_WITH_VIO_CLOSE" CC=/usr/bin/gcc CXX=/usr/bin/g++

cd mysql-test

./mtr --valgrind gis

$valgrind --version
valgrind-3.2.1
[15 Apr 2010 17:59] Sveta Smirnova
Repeatable with mysql-5.1-bugteam in same environment too.
[23 Jun 2010 12:41] Georgi Kodinov
This is not repeatable in the latest pushbuild valgrind runs. I must conclude it's some oddity of the platform under test.