Bug #46034 valgrind warning in setup_wild()
Submitted: 8 Jul 2009 8:39 Modified: 7 Aug 2009 20:29
Reporter: Georgi Kodinov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:5.1, 5.0 OS:Linux (Fedora 10 x86_64)
Assigned to: Georgi Kodinov CPU Architecture:Any

[8 Jul 2009 8:39] Georgi Kodinov
Description:
I get the following valgrind warning running group_by.test (and almost all the other tests) :
==18483== Source and destination overlap in memcpy(0x4E461A8, 0x4E461A8, 28)
==18483==    at 0x4A0827A: memcpy (mc_replace_strmem.c:402)
==18483==    by 0x6E74EB: setup_wild(THD*, TABLE_LIST*, List<Item>&, List<Item>*, unsigned int) (sql_base.cc:7378)
==18483==    by 0x72B224: JOIN::prepare(Item***, TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) (sql_select.cc:494)==18483==    by 0x72C267: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:2367)
==18483==    by 0x73185C: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:268)==18483==    by 0x69C454: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5012)==18483==    by 0x69E345: mysql_execute_command(THD*) (sql_parse.cc:2207)
==18483==    by 0x85E0D4: sp_instr_stmt::exec_core(THD*, unsigned int*) (sp_head.cc:2907) 
==18483==    by 0x85E30C: sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) (sp_head.cc:2735)
==18483==    by 0x86448E: sp_instr_stmt::execute(THD*, unsigned int*) (sp_head.cc:2849)
==18483==    by 0x86060D: sp_head::execute(THD*) (sp_head.cc:1253)
==18483==    by 0x86139C: sp_head::execute_procedure(THD*, List<Item>*) (sp_head.cc:1983)
==18483==    by 0x6A4EC7: mysql_execute_command(THD*) (sql_parse.cc:4353)
==18483==    by 0x6A7211: mysql_parse(THD*, char const*, unsigned int, char const**) (sql_parse.cc:5932)
==18483==    by 0x6A8004: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1213)
==18483==    by 0x6A936C: do_command(THD*) (sql_parse.cc:854)

How to repeat:
run group_by.test (or any other test that has a select command) through valgrind on a fully updated F10 with valgrind-3.4.0.SVN

Suggested fix:
not sure : probably it has something to do with reference assignment
[8 Jul 2009 14:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/78222

2801 Georgi Kodinov	2009-07-08
      Bug #46003 and bug #46034: backported the fixes from azalea.
[16 Jul 2009 12:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/78836

2801 Georgi Kodinov	2009-07-16
      Bug #46003 and bug #46034: backported the fixes from azalea.
      
      ******
      Bug #46042: backported the fix for the valgrind warning from 5.1
[16 Jul 2009 13:19] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/78847

2785 Georgi Kodinov	2009-07-16
      Bug #46003 and bug #46034: backported the fixes from azalea.
[16 Jul 2009 15:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/78867

2801 Georgi Kodinov	2009-07-16
      Bug #46003 and bug #46034: backported the fixes from azalea.
[4 Aug 2009 13:57] Bugs System
Pushed into 5.0.85 (revid:davi.arnaut@sun.com-20090804135315-6lfdnk4zjwk7kn7r) (version source revid:davi.arnaut@sun.com-20090804135315-6lfdnk4zjwk7kn7r) (merge vers: 5.0.85) (pib:11)
[4 Aug 2009 19:51] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090804194615-h40sa098mx4z49qg) (version source revid:dao-gang.qu@sun.com-20090717025250-n2lq5mqibjfdpigu) (merge vers: 5.4.4-alpha) (pib:11)
[4 Aug 2009 20:45] Bugs System
Pushed into 5.1.38 (revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (version source revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (merge vers: 5.1.38) (pib:11)
[7 Aug 2009 20:29] Paul DuBois
Noted in 5.0.85, 5.1.38, 5.4.4 changelogs.

Several Valgrind warnings were corrected.
[12 Aug 2009 22:11] Paul DuBois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[14 Aug 2009 23:01] Paul DuBois
Ignore previous comment about 5.4.2.
[1 Oct 2009 5:58] Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (version source revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[1 Oct 2009 7:25] Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:jonas@mysql.com-20091001072547-kv17uu06hfjhgjay) (version source revid:jonas@mysql.com-20091001071652-irejtnumzbpsbgk2) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[1 Oct 2009 13:25] Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (version source revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[5 Oct 2009 10:50] Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:jonas@mysql.com-20091005103850-dwij2dojwpvf5hi6) (version source revid:jonas@mysql.com-20090930185117-bhud4ek1y0hsj1nv) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)
[7 Oct 2009 16:23] Paul DuBois
The 5.4 fix has been pushed to 5.4.2.