Skip to content

v4.0.x: libnbc uninitialized variable #8259

Closed
@jsquyres

Description

@jsquyres

While working on #8258, I found one more warning on the v4.0.x branch -- it happens many times:

./nbc_internal.h:538:60: warning: variable 'size' is uninitialized when used here [-Wuninitialized]
    res = ompi_datatype_unpack_external("external32", src, size, &pos, tgt, srccount, srctype);
                                                          ^~~~
./nbc_internal.h:515:16: note: initialize the variable 'size' to silence this warning
  MPI_Aint size, pos;
               ^

This warning does, indeed, show that there is a legit code path where size can be uninitialized. This should be fixed.

However, the code in nbc_internal.h appears to be different on v4.1.x. I'm not sure where the divergence happened, and I don't have time to track it down at the moment (there could be just another commit to cherry pick from v4.1.x->v4.0.x, or if that is too large, a smaller fix that could locally be applied directly to v4.0.x).

I'm therefore filing this issue so that someone fixes it before v4.0.6 is released. I'm tentatively marking this a "blocker" so that the RMs are definitely aware of it. They can choose to downgrade it if they wish.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions