Thread (8 messages) 8 messages, 3 authors, 2014-08-22

Re: [PATCH] btrfs-progs: init uninitialized output buf for btrfs-restore

From: Marc Dietrich <marvin24@gmx.de>
Date: 2014-08-22 07:35:57

Hi Eric,

Am Donnerstag, 21. August 2014, 13:56:49 schrieb Eric Sandeen:
On 8/21/14, 1:42 PM, Eric Sandeen wrote:
quoted
On 8/20/14, 10:35 PM, Gui Hecheng wrote:
quoted
A memory problem reported by valgrind as follows:
	=== Syscall param pwrite64(buf) points to uninitialised byte(s)

When running:
	# valgrind --leak-check=yes btrfs restore /dev/sda9 /mnt/backup

Because the output buf size is alloced with malloc, but the length of
output data is shorter than the sizeof(buf), so valgrind report
uninitialised byte(s).
We could use calloc to repalce malloc and clear this WARNING away.
It clears the valgrind error away, but does it hide a real bug?
Maybe the relevant question for Marc is - did you get decompression
errors during restore?  if so then I guess it all makes sense, and
the proposed patch seems sane after all, sorry.
I use lzo and yes, I got decompression errors.

Marc

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help