Bug#848249: diffoscope: set_locale needs to call tzset

Brett Smith debbug at brettcsmith.org
Thu Dec 15 17:20:03 UTC 2016


Source: diffoscope
Severity: minor
Tags: patch

diffoscope sets the timezone to UTC to ensure that timezones are consistent
from diff output tools.  However, it does not call tzset after it does this.
Because of this, C code running in the same process may continue to see and
use the user's original timezone.  In particular, the python-magic module
that wraps libmagic is susceptible to this.

I believe this is the source of test_gzip.metadata test failures that have
been reported in, e.g., #817193.  Test failures look inconsistent because
you'll only see it if (a) you're using the python-magic wrapper module, and
(b) your current timezone does not align with UTC.

A patch is attached.

-- System Information:
Debian Release: 8.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-rc6+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-diffoscope-set_locale-calls-tzset.patch
Type: text/x-diff
Size: 1735 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20161215/417b6050/attachment.patch>


More information about the Reproducible-builds mailing list