After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587676 - Call tzset() before localtime_r(), in e.g. gst-plugins-base/ext/pango/gstclockoverlay.c
Call tzset() before localtime_r(), in e.g. gst-plugins-base/ext/pango/gstcloc...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.22
Other Linux
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-03 11:49 UTC by Hans-Peter Nilsson
Modified: 2009-07-05 16:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to call tzset before localtime_r in gst_clock_overlay_render_time (739 bytes, patch)
2009-07-03 11:53 UTC, Hans-Peter Nilsson
committed Details | Review

Description Hans-Peter Nilsson 2009-07-03 11:49:40 UTC
POSIX and your local friendly ctime(3) manual entry says that localtime_r isn't required to set the state variables that define the current timezone.  Indeed, glibc (at least 2.9) doesn't do this for subsequent calls.  The effect is that if the system timezone is changed for a running program between two calls to gst_clock_overlay_render_time, it won't be noticed.  For glibc, changing the timezone equals /etc/localtime being modified.

The patch does the obvious thing.  It is however untested, as the real culprit for the local scenario was not clockoverlay (not used) but other, local code at Axis Communications, but which had the same bug(!)  (And the real bug is of course that there's no tzset_r or similar, but that's another story.) The local code was an import of 0.10.22.

I have not searched for presence of this bug in any other related code in this or other GNOME components.
Comment 1 Hans-Peter Nilsson 2009-07-03 11:53:32 UTC
Created attachment 137782 [details] [review]
Patch to call tzset before localtime_r in gst_clock_overlay_render_time

I hope you don't mind me basing the patch on the local (unmodified) import of 0.10.22 (IIUC).
Comment 2 Sebastian Dröge (slomo) 2009-07-05 16:02:42 UTC
commit 04e23f2d6a3ca3b10e609e6084e52746c16e208a
Author: Hans-Peter Nilsson <hp@gcc.gnu.org>
Date:   Sun Jul 5 18:01:38 2009 +0200

    pango: Call tzset() before localtime_r()
    
    POSIX and your local friendly ctime(3) manual entry says that localtime_r isn't
    required to set the state variables that define the current timezone.  Indeed,
    glibc (at least 2.9) doesn't do this for subsequent calls.  The effect is that
    if the system timezone is changed for a running program between two calls to
    gst_clock_overlay_render_time, it won't be noticed.  For glibc, changing the
    timezone equals /etc/localtime being modified.
    
    Fixes bug #587676.