Skip to content

The call to localtime_r may be unsound #293

Closed
@quininer

Description

@quininer

because getenv and setenv are not thread-safe, localtime_r in time may data race with std::env::set_var in libstd.

I described this problem in chrono issue, and time is also affected.


Edit from @jhpratt:

Chrono users please see this comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coreArea: anything not otherwise coveredC-bugCategory: bug in current codeC-unsound 🚨Category: unsound behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions