[CONC-151] valgrind reports uninitialised value Created: 2015-11-16  Updated: 2015-11-17

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.2.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: chen yuanyuan Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

os:centos 6.7 64 bit



 Description   

I wrote a C program to query mariadb in a infinite loop.during it was running under valgrind,I restarted mariadb,then valgrind show the following error(I have hidden my prog's call stack):

[root@localhost mariadb-connector-c-master]# ==11514== Conditional jump or move depends on uninitialised value(s)
==11514== at 0x5076D4E: my_real_read (net.c:654)
==11514== by 0x5077084: my_net_read (net.c:723)
==11514== by 0x507C42C: net_safe_read (libmariadb.c:391)
==11514== by 0x507D7B9: mthd_my_real_connect (libmariadb.c:1781)
.....

I build connect/C from github master and tried again,it still had this problem



 Comments   
Comment by Georg Richter [ 2015-11-16 ]

Hi,

can you please rerun with valgriind option --track-origins=yes using branch connector_c_2.2 (git clone -b connector_c_2.2 .... ) and attach output?

Thanks!

Comment by chen yuanyuan [ 2015-11-17 ]

Hi,
According to your suggestion,I build with git branch connector_c_2.2 and ran with --track-origins=yes,then it showed the following report:
==2397== Conditional jump or move depends on uninitialised value(s)
==2397== at 0x5076D5E: my_real_read (net.c:654)
==2397== by 0x5077094: my_net_read (net.c:723)
==2397== by 0x507C3FC: net_safe_read (libmariadb.c:390)
==2397== by 0x507D7A5: mthd_my_real_connect (libmariadb.c:1782)
==2397== by 0x4E48343: mkc_connect_mysql (mkc_mysql.c:300)
==2397== by 0x4E48343: _mkc_exec_sql (mkc_mysql.c:717)
==2397== by 0x4E48F5E: mkc_query_sql_printf (mkc_mysql.c:869)
==2397== by 0x42B9CE: uis_main_proc (uis_send_sm_proc.c:273)
==2397== by 0x42B9CE: uis_fork_sm_send_proc (uis_send_sm_proc.c:122)
==2397== by 0x41D894: main (uis_server.c:239)
==2397== Uninitialised value was created by a heap allocation
==2397== at 0x4C2828A: malloc (vg_replace_malloc.c:299)
==2397== by 0x5081901: my_malloc (my_malloc.c:36)
==2397== by 0x5076BDC: vio_new (violite.c:168)
==2397== by 0x507DBE5: mthd_my_real_connect (libmariadb.c:1608)
==2397== by 0x4E48343: mkc_connect_mysql (mkc_mysql.c:300)
==2397== by 0x4E48343: _mkc_exec_sql (mkc_mysql.c:717)
==2397== by 0x4E48F5E: mkc_query_sql_printf (mkc_mysql.c:869)
==2397== by 0x42B9CE: uis_main_proc (uis_send_sm_proc.c:273)
==2397== by 0x42B9CE: uis_fork_sm_send_proc (uis_send_sm_proc.c:122)
==2397== by 0x41D894: main (uis_server.c:239)

PS:
The query was issueed in a muti-thread env.But I have already read the related document and use mysql_library_init before creating the threads.
The mysql_real_connect option is CLIENT_REMEMBER_OPTIONS|CLIENT_FOUND_ROWS|CLIENT_IGNORE_SIGPIPE|CLIENT_COMPRESS

Generated at Thu Feb 08 03:03:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.