[CDRIVER-647] DUMP_IOVEC(): Use of uninitialised value of size 8 Created: 13/May/15  Updated: 19/Oct/16  Resolved: 25/Sep/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.2.0
Fix Version/s: 1.2-rc0

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-228 Memory leaks in socketTimeoutMS test Closed

 Description   

==5959== Use of uninitialised value of size 8
==5959==    at 0x6166AF1: _itoa_word (_itoa.c:180)
==5959==    by 0x616A7E6: vfprintf (vfprintf.c:1641)
==5959==    by 0x61941C8: vsnprintf (vsnprintf.c:119)
==5959==    by 0x70C0493: bson_vsnprintf (bson-string.c:620)
==5959==    by 0x70C017A: bson_strdupv_printf (bson-string.c:390)
==5959==    by 0x70BFF18: bson_string_append_printf (bson-string.c:267)
==5959==    by 0x70ED582: mongoc_stream_readv (mongoc-stream.c:203)
==5959==    by 0x70ED845: mongoc_stream_read (mongoc-stream.c:244)
==5959==    by 0x70C50CD: _mongoc_buffer_append_from_stream (mongoc-buffer.c:175)
==5959==    by 0x70D00DF: mongoc_cluster_try_recv (mongoc-cluster.c:2234)
==5959==    by 0x70C871B: _mongoc_client_recv (mongoc-client.c:486)
==5959==    by 0x70D6D70: _mongoc_cursor_query (mongoc-cursor.c:511)
==5959==  Uninitialised value was created by a heap allocation
==5959==    at 0x4C2ABA0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5959==    by 0x4C2CF4F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5959==    by 0x8183AF: _erealloc (zend_alloc.c:2448)
==5959==    by 0x71054FF: php_phongo_realloc (php_phongo.c:1721)
==5959==    by 0x70BDE78: bson_realloc (bson-memory.c:148)
==5959==    by 0x70BDEBE: bson_realloc_ctx (bson-memory.c:187)
==5959==    by 0x70C4C77: _mongoc_buffer_init (mongoc-buffer.c:70)
==5959==    by 0x70D624A: _mongoc_cursor_new (mongoc-cursor.c:308)
==5959==    by 0x70C99F8: mongoc_client_command (mongoc-client.c:1222)
==5959==    by 0x71009C4: phongo_execute_command (php_phongo.c:601)
==5959==    by 0x70997DE: zim_Manager_executeCommand (Manager.c:105)
==5959==    by 0x89ABA4: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==5959== 



 Comments   
Comment by Githook User [ 25/Sep/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-647: Fix invalid read in tracing on read failure
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/21c0ea4e02056ac20117e9901995c4ec17e839aa

Comment by Hannes Magnusson [ 23/Sep/15 ]

When a read fails, we still try to dump the reads, which are uninitialized

Generated at Wed Feb 07 21:10:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.