From: Ian Jackson Subject: Re: [xen-4.4-testing test] 66583: regressions - FAIL Date: Wed, 6 Jan 2016 11:41:03 +0000 Message-ID: <22156.64847.849022.761752@mariner.uk.xensource.com> References: <5677F60D02000078000C1D5E@prv-mh.provo.novell.com> <56796B1602000078000C246F@prv-mh.provo.novell.com> <1451902198.13361.13.camel@citrix.com> <22154.34745.850928.432704@mariner.uk.xensource.com> <1451919810.13361.146.camel@citrix.com> <1451920514.13361.153.camel@citrix.com> <1451920937.13361.157.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aGmSn-00063K-SZ for xen-devel@lists.xenproject.org; Wed, 06 Jan 2016 11:41:13 +0000 In-Reply-To: <1451920937.13361.157.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel , osstest-admin@xenproject.org, Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [xen-4.4-testing test] 66583: regress= ions - FAIL"): > Aha, this failure is in tools/blktap/drivers/block-qcow.c and not > tools/blktap2/drivers/block-qcow.c.=A0 Well spotted. > 345e44a85d71 was writing after blktap1 was remove from the tree so > backporting it wouldn't have helped. Right. > $ git show 345e44a85d71a | patch tools/blktap/drivers/block-qcow.c > patching file tools/blktap/drivers/block-qcow.c > Hunk #1 succeeded at 440 (offset 13 lines). > Hunk #2 succeeded at 614 (offset 13 lines). > $=A0 > = > Seems like the way to go for all branches which still have blktap1 (4.5 a= nd > back, although it was disabled by default in 76c66c689b85 which was in > 4.4.0-rc1. I have done roughly this, to 4.3-4.5 inclusive. Ian. commit a64bfae49ae845ba4cb8cb6923fa08c41439872a Author: Dario Faggioli Date: Fri Jun 20 16:09:00 2014 +0200 blktap: Fix two 'maybe uninitialized' variables = [ Cross-ported to blktap1 from 345e44a85d71a "blktap2: Fix two 'maybe uninitialized' variables" -iwj; Remainder of commit message is from blktap2's version. ] = for which gcc 4.9.0 complains about, like this: = block-qcow.c: In function `get_cluster_offset': block-qcow.c:431:3: error: `tmp_ptr' may be used uninitialized in this = function [-Werror=3Dmaybe-uninitialized] memcpy(tmp_ptr, l1_ptr, 4096); ^ block-qcow.c:606:7: error: `tmp_ptr2' may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] if (write(s->fd, tmp_ptr2, 4096) !=3D 4096) { ^ cc1: all warnings being treated as errors /home/dario/Sources/xen/xen/xen.git/tools/blktap2/drivers/../../../tool= s/Rules.mk:89: recipe for target 'block-qcow.o' failed make[5]: *** [block-qcow.o] Error 1 = The proper behavior is to return upon allocation failure. About what to return, 0 seems the best option, looking at both the function and the call sites. = Signed-off-by: Dario Faggioli Acked-by: Ian Jackson = Backport-requested-by: Ian Campbell Signed-off-by: Ian Jackson (cherry picked from commit 845e8c1653242bbd9b9de5a081182db0f3f39054) (cherry picked from commit e003d429d8c63523df40663b4586c572ce796659) diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block= -qcow.c index 0e4e9cf..8fb6023 100644 --- a/tools/blktap/drivers/block-qcow.c +++ b/tools/blktap/drivers/block-qcow.c @@ -440,6 +440,7 @@ static uint64_t get_cluster_offset(struct tdqcow_state = *s, = if (posix_memalign((void **)&tmp_ptr, 4096, 4096) !=3D 0) { DPRINTF("ERROR allocating memory for L1 table\n"); + return 0; } memcpy(tmp_ptr, l1_ptr, 4096); = @@ -613,6 +614,7 @@ found: = if (posix_memalign((void **)&tmp_ptr2, 4096, 4096) !=3D 0) { DPRINTF("ERROR allocating memory for L1 table\n"); + return 0; } memcpy(tmp_ptr2, l2_ptr, 4096); lseek(s->fd, l2_offset + (l2_sector << 12), SEEK_SET);