Skip to content

localtime_r shim uses TZ variable from the host, not the interpreted program #3522

Closed
@saethlin

Description

@saethlin

Currently the test suite may fail to pass, unless you run it with TZ=UTC ./miri test. This is because the localtime_r shim reads the TZ variable from the host on this line:

miri/src/shims/time.rs

Lines 139 to 140 in f26bd28

// Convert that to local time, then return the broken-down time value.
let dt: DateTime<Local> = DateTime::from(dt_utc);

In other words, this test code is ineffective:

// Set timezone to GMT.
let key = "TZ";
env::set_var(key, "GMT");

I'm going to look into this.

cc @tiif @eduardosm

Metadata

Metadata

Assignees

Labels

A-shimsArea: This affects the external function shimsC-bugCategory: This is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions