Skip to content

Random behavior when converting uninitialized Array{Bool} entries #20065

@nalimilan

Description

@nalimilan

This issue has been reported against DataArrays (JuliaStats/DataArrays.jl#233). A short reproducer without using any package can be found in this gist: running the last line multiple times gives different results for several entries which should be defined.

Basically, it appears that leaving some entries in a BitArray undefined iterating over a BitArray can lead to an unexpected behaviour when using the BitArray entries in a condition to decide whether to initialize another array's entries or not. Initializing the array fixes the randomness, as does changing the na::BitArray{N} field to an Array{Bool,N}.

This happens on both 0.5 and master, but not on 0.4.7.

Cc: @carlobaldassi

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions