Skip to content

test_diag_update_manager: wrong datatype is set with -fdefault-real-8 #1805

@foxtran

Description

@foxtran

Describe the bug

Here,


missvalue gets FP value of default real kind. missvalue has a constrain on type which can be only integer(8) or real(4). So, once one uses default real kind as real(8), the data with wrong length (8 bytes) is copied into missvalue which is 4 bytes long (once it is real), and, then, extra 4 bytes are written out of bounds.

Such errors can be easily detected with AddressSanitizer (ASan) and, actually, detected in this way.

To Reproduce
Enable ASan in CI.

Expected behavior
No ASan error

System Environment
CI of libFMS; FFLAGS="-fsanitize=address", LDFLAGS="-fsanitize=address"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions