Skip to content

Panic in SystemTime::now() when clock_gettime() fails #115482

Open
@pitdicker

Description

@pitdicker

We got a report in chronotope/chrono#634 that I don't know what to do with.

Apparently it is possible for clock_gettime() to fail on Unix with EPERM, maybe when running inside a container or sandbox (?).

Relevant code:
https://github.com/rust-lang/rust/blob/1.72.0/library/std/src/sys/unix/time.rs#L272

Should this just remain a panic, or should something like UNIX_EPOCH be returned instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-timeArea: TimeC-bugCategory: This is a bug.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions