Skip to contentSkip to conversation

fix build failure in nbd_read_reply_entry()

PATCH Applied Igor Mammedov 4 participants 8 messages Aug 17, 2017 – Aug 23, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix build failure in nbd_read_reply_entry()

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

fix it by initializing 'ret' to 0

---
 block/nbd-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/nbd-client.c +1 -1
index 422ecb4..02c8e20 100644
@@ -70,7 +70,7 @@ static coroutine_fn void nbd_read_reply_entry(void *opaque)
 {
     NBDClientSession *s = opaque;
     uint64_t i;
-    int ret;
+    int ret = 0;
     Error *local_err = NULL;
 
     while (!s->quit) {
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Igor Mammedov

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

fix it by initializing 'ret' to 0

This is a false positive, but it's understandably impossible for the compiler to figure it out.

Even though we disable -Werror on release builds, it may be worth fixing this in 2.10 if it doesn't delay the release. Peter, what do you think about applying this on top of -rc3 without doing a fourth candidate?

Paolo

Quoted 19 lines
---
 block/nbd-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/nbd-client.c +1 -1
index 422ecb4..02c8e20 100644
@@ -70,7 +70,7 @@ static coroutine_fn void nbd_read_reply_entry(void *opaque)
 {
     NBDClientSession *s = opaque;
     uint64_t i;
-    int ret;
+    int ret = 0;
     Error *local_err = NULL;
 
     while (!s->quit) {
#2 lore raw
Quoted 6 lines · Paolo Bonzini
Quoted 5 lines · Igor Mammedov

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

Quoted 8 lines
Quoted 1 line

fix it by initializing 'ret' to 0

This is a false positive, but it's understandably impossible for the compiler to figure it out.

Even though we disable -Werror on release builds, it may be worth fixing this in 2.10 if it doesn't delay the release. Peter, what do you think about applying this on top of -rc3 without doing a fourth candidate?

I don't like doing releases which haven't had an rc, but we've had abbreviated "just a couple of days" rc-to-final cycles before.

thanks
-- PMM

#3 lore raw
Quoted 12 lines · Peter Maydell
Quoted 11 lines · Paolo Bonzini
Quoted 6 lines · Igor Mammedov

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

fix it by initializing 'ret' to 0

This is a false positive, but it's understandably impossible for the compiler to figure it out.

Quoted 7 lines
Quoted 3 lines

Even though we disable -Werror on release builds, it may be worth fixing this in 2.10 if it doesn't delay the release. Peter, what do you think about applying this on top of -rc3 without doing a fourth candidate?

I don't like doing releases which haven't had an rc, but we've had abbreviated "just a couple of days" rc-to-final cycles before.

It's just a matter of "looking unpolished". It doesn't deserve -rc4, not even for just a couple of days.

Paolo

#4 lore raw
Quoted 17 lines · Paolo Bonzini
Quoted 16 lines · Peter Maydell
Quoted 14 lines · Paolo Bonzini
Quoted 6 lines · Igor Mammedov

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

fix it by initializing 'ret' to 0

This is a false positive, but it's understandably impossible for the compiler to figure it out.

Even though we disable -Werror on release builds, it may be worth fixing this in 2.10 if it doesn't delay the release. Peter, what do you think about applying this on top of -rc3 without doing a fourth candidate?

Quoted 6 lines
Quoted 3 lines

I don't like doing releases which haven't had an rc, but we've had abbreviated "just a couple of days" rc-to-final cycles before.

It's just a matter of "looking unpolished". It doesn't deserve -rc4, not even for just a couple of days.

The purpose of having an rc4 is to avoid the chance of messing up the change (which is possible, even if it's a pretty remote chance). Having an rc4 gives us a window to catch and fix that kind of error -- once we've tagged something as the final release we don't get to do it over.

thanks
-- PMM

#5 lore raw
Quoted 22 lines · Peter Maydell
Quoted 21 lines · Paolo Bonzini
Quoted 19 lines · Peter Maydell
Quoted 6 lines · Paolo Bonzini
Quoted 5 lines · Igor Mammedov

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

Quoted 8 lines
Quoted 1 line

fix it by initializing 'ret' to 0

This is a false positive, but it's understandably impossible for the compiler to figure it out.

Even though we disable -Werror on release builds, it may be worth fixing this in 2.10 if it doesn't delay the release. Peter, what do you think about applying this on top of -rc3 without doing a fourth candidate?

I don't like doing releases which haven't had an rc, but we've had abbreviated "just a couple of days" rc-to-final cycles before.

Quoted 8 lines
Quoted 2 lines

It's just a matter of "looking unpolished". It doesn't deserve -rc4, not even for just a couple of days.

The purpose of having an rc4 is to avoid the chance of messing up the change (which is possible, even if it's a pretty remote chance). Having an rc4 gives us a window to catch and fix that kind of error -- once we've tagged something as the final release we don't get to do it over.

Understood, I meant we can release with the issue unfixed.

Paolo

Reviewed-by on v1 1/1
#6 lore raw
In reply to Igor Mammedov
Quoted 11 lines · Igor Mammedov

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

fix it by initializing 'ret' to 0

---
 block/nbd-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I concur that it is a false positive, introduced by commit 72b6ffc7; and that it should not affect tarball builds where we do not default to turning on -Werror (other than an annoying warning). This feels to me to be in the same category as a couple other patches we have already identified, where it doesn't deserve spinning up -rc4 by itself, but if we do have a major bug to fix, then including this one at the same time is fine.

I'll defer to Peter's judgment on whether to apply it for 2.10; meanwhile, I'll stick it on my NBD tree for 2.11 if it does not get applied for 2.10.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#7 lore raw
In reply to Igor Mammedov
Quoted 9 lines · Igor Mammedov

travis builds fail at HEAD at rc3 master with

block/nbd-client.c: In function ‘nbd_read_reply_entry’:
block/nbd-client.c:110:8: error: ‘ret’ may be used uninitialized in this function [-Werror=uninitialized]

fix it by initializing 'ret' to 0

--

Applied to master for 2.10, since we needed to run an rc4 anyway.

thanks
-- PMM