GNU bug report logs - #21020
24.4; `display-time-world' tampers with TZ

Previous Next

Package: emacs;

Reported by: William G. Gardella <wgg2 <at> member.fsf.org>

Date: Thu, 9 Jul 2015 19:41:02 UTC

Severity: normal

Tags: patch

Found in version 24.4

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21020 in the body.
You can then email your comments to 21020 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Thu, 09 Jul 2015 19:41:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to William G. Gardella <wgg2 <at> member.fsf.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 09 Jul 2015 19:41:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: William G. Gardella <wgg2 <at> member.fsf.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; `display-time-world' tampers with TZ
Date: Thu, 09 Jul 2015 19:39:51 +0000
I use `set-time-zone-rule' to run emacs with an altered time zone for
the sake of having a local clock in the modeline via `display-time-mode'
on a system that overall uses UTC time.

However, `display-time-world' (in the `display-time-world-display' function,
and also the initialization for the variable `display-time-world-list')
resets the time zone using the TZ environment variable,
and attempts to restore the time zone from there, while ignoring
any value that might have been set by the user using `set-time-zone-rule'.

Recipe:

(display-time-mode 1)
(set-time-zone-rule "some tz string different than system's TZ")
(display-time-event-handler) ;; Time should now be localized to the TZ passed to`set-time-zone-rule'
(display-time-world)
(display-time-event-handler) ;; We're in a different TZ now!

To make matters worse, if one attempts to manually correct Emacs's displayed
time to the desired TZ after invoking (display-time-world),
display-time-world-timer continually overwrites it
until canceled.


In GNU Emacs 24.4.1 (x86_64-slackware-linux-gnu)
 of 2015-03-06 on aporia
Windowing system distributor `The X.Org Foundation', version 11.0.11403000
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
 --program-prefix= --program-suffix= --mandir=/usr/man
 --infodir=/usr/info --without-gconf --without-gsettings --with-x
 --with-x-toolkit=no --with-m17n-flt --build=x86_64-slackware-linux
 'CFLAGS=-O2 -fPIC''

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ERC

Minor modes in effect:
  semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode semantic-idle-scheduler-mode)  S)))
  pdf-occur-global-minor-mode: t
  erc-services-mode: t
  erc-autoaway-mode: t
  erc-dcc-mode: t
  global-rainbow-delimiters-mode: t
  rainbow-delimiters-mode: t
  show-paren-mode: t
  electric-pair-mode: t
  winner-mode: t
  display-time-mode: t
  recentf-mode: t
  savehist-mode: t
  xterm-mouse-mode: t
  global-magit-wip-save-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-match-mode: t
  erc-netsplit-mode: t
  erc-hl-nicks-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-keep-place-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  transient-mark-mode: t

Recent input:
y SPC u s e c a s e SPC i f SPC y o u ' r e SPC i n 
t e r e s t e d SPC i s SPC t h a t SPC I SPC p r e 
f e r SPC t h e SPC o v e r a l l SPC s y s t e m SPC 
( <backspace> <backspace> SPC <backspace> SPC ( b r 
o w s s <backspace> e r s , SPC s t u f f SPC l i k 
SPC <backspace> e SPC w g e t , SPC o u t g o i n g 
SPC m a i l , SPC e t c . C-a C-e C-a C-e SPC t o SPC 
u s e SPC U T C S-SPC f o r SPC p r i v a c y SPC r 
e a s o n s C-a <return> b u t SPC I SPC u s e SPC 
e m a c s ' s SPC m o d e l i n e SPC a s SPC a SPC 
c l o c k <return> s-f C-s b a u d C-s C-s C-g C-g 
C-h v b a u d <tab> <return> s-b q e h e h s-b e h 
e h e <return> C-h v b a u d - r <tab> <return> s-f 
q <select-window> <select-window> <help-echo> <help-echo> 
<select-window> <select-window> <help-echo> <select-window> 
M-< C-s d i s p l a y - t i m e - w o r l d - d i s 
p <return> C-v s-b C-x C-g M-x r e p o r t - e m a 
c s - b u f <backspace> g <return>

Recent messages:
Mark saved where search started
Mark set
delete-backward-char: Text is read-only
Quit [3 times]
Type "q" in help window to restore its previous buffer.
call-interactively: Buffer is read-only: #<buffer time.el.gz> [3 times]
Type "q" in help window to restore its previous buffer.
Mark set
Mark saved where search started
C-x C-g is undefined

Load-path shadows:
/usr/share/emacs/site-lisp/t-mouse hides /usr/share/emacs/24.4/lisp/t-mouse
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-clojure hides /usr/share/emacs/24.4/lisp/org/ob-clojure
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-asymptote hides /usr/share/emacs/24.4/lisp/org/ob-asymptote
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-lisp hides /usr/share/emacs/24.4/lisp/org/ob-lisp
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-lob hides /usr/share/emacs/24.4/lisp/org/ob-lob
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-gnuplot hides /usr/share/emacs/24.4/lisp/org/ob-gnuplot
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-bibtex hides /usr/share/emacs/24.4/lisp/org/org-bibtex
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-haskell hides /usr/share/emacs/24.4/lisp/org/ob-haskell
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-C hides /usr/share/emacs/24.4/lisp/org/ob-C
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-js hides /usr/share/emacs/24.4/lisp/org/ob-js
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-mhe hides /usr/share/emacs/24.4/lisp/org/org-mhe
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-html hides /usr/share/emacs/24.4/lisp/org/ox-html
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-icalendar hides /usr/share/emacs/24.4/lisp/org/ox-icalendar
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-matlab hides /usr/share/emacs/24.4/lisp/org/ob-matlab
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-fortran hides /usr/share/emacs/24.4/lisp/org/ob-fortran
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-protocol hides /usr/share/emacs/24.4/lisp/org/org-protocol
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-ctags hides /usr/share/emacs/24.4/lisp/org/org-ctags
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-scala hides /usr/share/emacs/24.4/lisp/org/ob-scala
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-picolisp hides /usr/share/emacs/24.4/lisp/org/ob-picolisp
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-entities hides /usr/share/emacs/24.4/lisp/org/org-entities
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-md hides /usr/share/emacs/24.4/lisp/org/ox-md
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-eshell hides /usr/share/emacs/24.4/lisp/org/org-eshell
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-clock hides /usr/share/emacs/24.4/lisp/org/org-clock
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-w3m hides /usr/share/emacs/24.4/lisp/org/org-w3m
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-src hides /usr/share/emacs/24.4/lisp/org/org-src
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-crypt hides /usr/share/emacs/24.4/lisp/org/org-crypt
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-ditaa hides /usr/share/emacs/24.4/lisp/org/ob-ditaa
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-css hides /usr/share/emacs/24.4/lisp/org/ob-css
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-ocaml hides /usr/share/emacs/24.4/lisp/org/ob-ocaml
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-compat hides /usr/share/emacs/24.4/lisp/org/org-compat
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-exp hides /usr/share/emacs/24.4/lisp/org/ob-exp
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-attach hides /usr/share/emacs/24.4/lisp/org/org-attach
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-agenda hides /usr/share/emacs/24.4/lisp/org/org-agenda
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-timer hides /usr/share/emacs/24.4/lisp/org/org-timer
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-screen hides /usr/share/emacs/24.4/lisp/org/ob-screen
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-table hides /usr/share/emacs/24.4/lisp/org/ob-table
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-octave hides /usr/share/emacs/24.4/lisp/org/ob-octave
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob hides /usr/share/emacs/24.4/lisp/org/ob
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-macro hides /usr/share/emacs/24.4/lisp/org/org-macro
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-footnote hides /usr/share/emacs/24.4/lisp/org/org-footnote
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-capture hides /usr/share/emacs/24.4/lisp/org/org-capture
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-makefile hides /usr/share/emacs/24.4/lisp/org/ob-makefile
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-man hides /usr/share/emacs/24.4/lisp/org/ox-man
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-mscgen hides /usr/share/emacs/24.4/lisp/org/ob-mscgen
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-feed hides /usr/share/emacs/24.4/lisp/org/org-feed
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-plantuml hides /usr/share/emacs/24.4/lisp/org/ob-plantuml
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-inlinetask hides /usr/share/emacs/24.4/lisp/org/org-inlinetask
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-latex hides /usr/share/emacs/24.4/lisp/org/ob-latex
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-scheme hides /usr/share/emacs/24.4/lisp/org/ob-scheme
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-mobile hides /usr/share/emacs/24.4/lisp/org/org-mobile
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-comint hides /usr/share/emacs/24.4/lisp/org/ob-comint
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-sh hides /usr/share/emacs/24.4/lisp/org/ob-sh
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-ledger hides /usr/share/emacs/24.4/lisp/org/ob-ledger
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-plot hides /usr/share/emacs/24.4/lisp/org/org-plot
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-sql hides /usr/share/emacs/24.4/lisp/org/ob-sql
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-beamer hides /usr/share/emacs/24.4/lisp/org/ox-beamer
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-id hides /usr/share/emacs/24.4/lisp/org/org-id
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-sqlite hides /usr/share/emacs/24.4/lisp/org/ob-sqlite
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-element hides /usr/share/emacs/24.4/lisp/org/org-element
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-R hides /usr/share/emacs/24.4/lisp/org/ob-R
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-mouse hides /usr/share/emacs/24.4/lisp/org/org-mouse
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-io hides /usr/share/emacs/24.4/lisp/org/ob-io
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-colview hides /usr/share/emacs/24.4/lisp/org/org-colview
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-indent hides /usr/share/emacs/24.4/lisp/org/org-indent
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-eval hides /usr/share/emacs/24.4/lisp/org/ob-eval
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-emacs-lisp hides /usr/share/emacs/24.4/lisp/org/ob-emacs-lisp
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox hides /usr/share/emacs/24.4/lisp/org/ox
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-macs hides /usr/share/emacs/24.4/lisp/org/org-macs
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-calc hides /usr/share/emacs/24.4/lisp/org/ob-calc
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-core hides /usr/share/emacs/24.4/lisp/org/ob-core
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-docview hides /usr/share/emacs/24.4/lisp/org/org-docview
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-ruby hides /usr/share/emacs/24.4/lisp/org/ob-ruby
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-lilypond hides /usr/share/emacs/24.4/lisp/org/ob-lilypond
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-org hides /usr/share/emacs/24.4/lisp/org/ob-org
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-rmail hides /usr/share/emacs/24.4/lisp/org/org-rmail
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-info hides /usr/share/emacs/24.4/lisp/org/org-info
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-list hides /usr/share/emacs/24.4/lisp/org/org-list
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-ascii hides /usr/share/emacs/24.4/lisp/org/ox-ascii
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-datetree hides /usr/share/emacs/24.4/lisp/org/org-datetree
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-maxima hides /usr/share/emacs/24.4/lisp/org/ob-maxima
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-org hides /usr/share/emacs/24.4/lisp/org/ox-org
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org hides /usr/share/emacs/24.4/lisp/org/org
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-java hides /usr/share/emacs/24.4/lisp/org/ob-java
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-bbdb hides /usr/share/emacs/24.4/lisp/org/org-bbdb
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-tangle hides /usr/share/emacs/24.4/lisp/org/ob-tangle
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-odt hides /usr/share/emacs/24.4/lisp/org/ox-odt
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-awk hides /usr/share/emacs/24.4/lisp/org/ob-awk
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-sass hides /usr/share/emacs/24.4/lisp/org/ob-sass
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-archive hides /usr/share/emacs/24.4/lisp/org/org-archive
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-shen hides /usr/share/emacs/24.4/lisp/org/ob-shen
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-dot hides /usr/share/emacs/24.4/lisp/org/ob-dot
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-gnus hides /usr/share/emacs/24.4/lisp/org/org-gnus
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-texinfo hides /usr/share/emacs/24.4/lisp/org/ox-texinfo
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-pcomplete hides /usr/share/emacs/24.4/lisp/org/org-pcomplete
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-python hides /usr/share/emacs/24.4/lisp/org/ob-python
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-ref hides /usr/share/emacs/24.4/lisp/org/ob-ref
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-publish hides /usr/share/emacs/24.4/lisp/org/ox-publish
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-keys hides /usr/share/emacs/24.4/lisp/org/ob-keys
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-faces hides /usr/share/emacs/24.4/lisp/org/org-faces
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ox-latex hides /usr/share/emacs/24.4/lisp/org/ox-latex
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-habit hides /usr/share/emacs/24.4/lisp/org/org-habit
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-irc hides /usr/share/emacs/24.4/lisp/org/org-irc
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-table hides /usr/share/emacs/24.4/lisp/org/org-table
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/ob-perl hides /usr/share/emacs/24.4/lisp/org/ob-perl
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-version hides /usr/share/emacs/24.4/lisp/org/org-version
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-install hides /usr/share/emacs/24.4/lisp/org/org-install
/home/wgg/.emacs.d/elpa/org-plus-contrib-20150629/org-loaddefs hides /usr/share/emacs/24.4/lisp/org/org-loaddefs

Features:
(shadow bbdb-message emacsbug sendmail debug hippie-exp vc-rcs
pdf-sync pdf-annot pdf-outline pdf-links pdf-history pcmpl-unix
find-dired dired-aux ispell man w3m-form w3m-filter w3m-cookie
w3m-bookmark w3m-tabmenu w3m-session ffap w3m w3m-hist w3m-fb
bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc
w3m-util nnir qp xterm gnus-cite gnus-html url-cache mm-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse url-vars mm-archive mail-extr gnus-bcklg
misearch multi-isearch vc-git sh-script smie executable eieio-opt
speedbar sb-image dframe rx re-builder sgml-mode ox-koma-letter
ox-texinfo ox-org ox-icalendar ox-html ox-beamer ox-latex ox-ascii
ox-publish ox tabify org-table image-file org-element org-rmail
org-mhe org-irc org-info org-gnus org-docview doc-view org-bibtex
bibtex org-bbdb org-w3m org org-macro org-footnote org-pcomplete
org-list org-faces org-entities org-version ob-emacs-lisp ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core
ob-eval org-compat org-macs org-loaddefs find-func em-unix em-term
term ehelp em-smart em-script em-prompt em-ls em-hist em-pred em-glob
em-dirs em-cmpl em-basic em-banner em-alias esh-var esh-io esh-cmd
esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode
esh-util gnus-async sort gnus-ml disp-table windmove gnus-topic
parse-time netrc nnfolder bbdb-gnus nnmaildir network-stream starttls
tls elisp-slime-nav pdf-occur ibuf-ext ibuffer tablist tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent dired-x
dired pdf-isearch pdf-misc imenu pdf-tools cus-edit pdf-view jka-compr
pdf-cache pdf-info tq pdf-util image-mode mule-util sauron-identica
sauron-jabber sauron-twittering sauron-notifications notifications
sauron-org appt diary-lib diary-loaddefs cal-menu calendar
cal-loaddefs sauron-dbus dbus xml sauron-erc sauron erc-services
erc-autoaway erc-dcc erc-sasl gnus-delay gnus-draft gnus-agent
gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache gnus-msg
gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum
nndraft nnmh nnoo gnus-group gnus-undo gnus-start gnus-spec gnus-win
nnmail gnus-int gnus-range mail-source gnus gnus-ems nnheader bbdb-mua
bbdb-com crm bbdb bbdb-site timezone bbdb-loaddefs slime-fancy
slime-trace-dialog slime-fontifying-fu slime-package-fu
slime-references slime-compiler-notes-tree slime-scratch
slime-presentations bridge slime-fuzzy slime-fancy-trace
slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc
eldoc slime-repl elp slime-parse slime gud apropos etags arc-mode
archive-mode noutline outline hyperspec browse-url slime-autoloads
rainbow-delimiters paren elec-pair winner time saveplace tramp-cache
tramp-sh recentf tree-widget savehist semantic/idle semantic/format
ezimage semantic/tag-ls semantic/find semantic/ctxt
tomorrow-night-bright-theme color-theme-tomorrow xt-mouse
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet whitespace magit-wip magit-key-mode magit
view tramp tramp-compat tramp-loaddefs trampver shell advice help-mode
grep compile diff-mode autorevert filenotify git-rebase-mode
git-commit-mode server log-edit easy-mmode message idna cl-macs rfc822
mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log company edmacro kmacro erc-list erc-menu erc-join
erc-ring erc-networks erc-pcomplete pcomplete comint ansi-color ring
erc-track erc-match erc-netsplit erc-hl-nicks color cl gv erc-button
erc-fill erc-stamp wid-edit cl-loaddefs cl-lib erc-goodies erc
erc-backend erc-compat format-spec auth-source eieio byte-opt bytecomp
byte-compile cconv eieio-core gnus-util time-date mm-util help-fns
mail-prsvr password-cache thingatpt pp cus-start cus-load epa-file epa
derived epg tex-site darkroom-autoloads dash-autoloads
erc-hl-nicks-autoloads esxml-autoloads db-autoloads
gratuitous-dark-theme-autoloads kv-autoloads
late-night-theme-autoloads finder-inf info easymenu
rainbow-delimiters-autoloads tron-theme-autoloads package epg-config
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode prog-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button
faces cus-face macroexp files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind gfilenotify dynamic-setting
font-render-setting x multi-tty emacs)

Memory information:
((conses 16 2371792 287587)
 (symbols 48 172482 17)
 (miscs 40 3807 12000)
 (strings 32 527198 47542)
 (string-bytes 1 28336991)
 (vectors 16 187907)
 (vector-slots 8 2963927 182255)
 (floats 8 3416 26348)
 (intervals 56 106399 3626)
 (buffers 960 140)
 (heap 1024 154824 12981))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Sun, 26 Jul 2015 07:10:03 GMT) Full text and rfc822 format available.

Message #8 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "William G. Gardella" <wgg2 <at> member.fsf.org>
Cc: 21020 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 00:09:40 -0700
[Message part 1 (text/plain, inline)]
Thanks for the bug report.  Improving Emacs time zones has been on my TODO list 
for ages, and the report prompted me to do that.  Attached is a patch which 
works for me on GNU/Linux.  I'm CC'ing this to Eli to give him a heads-up in 
case it has implications on MS-Windows.
[0001-New-optional-ZONE-arg-for-format-time-string-etc.txt (text/plain, attachment)]

Added tag(s) patch. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sun, 26 Jul 2015 07:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Sun, 26 Jul 2015 14:49:02 GMT) Full text and rfc822 format available.

Message #13 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 17:48:30 +0300
> Date: Sun, 26 Jul 2015 00:09:40 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: 21020 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
> 
> Thanks for the bug report.  Improving Emacs time zones has been on my TODO list 
> for ages, and the report prompted me to do that.  Attached is a patch which 
> works for me on GNU/Linux.  I'm CC'ing this to Eli to give him a heads-up in 
> case it has implications on MS-Windows.

This is a large patch, touching a lot of code.  I hope we have some
tests to make sure this doesn't cause any regressions.

Other than that, please make in nt/gnulib.mk the same changes you did
in lib/gnulib.mk, otherwise I think the changes will not compile on
Windows.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Sun, 26 Jul 2015 17:07:02 GMT) Full text and rfc822 format available.

Message #16 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 10:05:38 -0700
[Message part 1 (text/plain, inline)]
Eli Zaretskii wrote:

> I hope we have some
> tests to make sure this doesn't cause any regressions.

test/automated/icalender-tests.el exercises the new code.

> Other than that, please make in nt/gnulib.mk the same changes you did
> in lib/gnulib.mk, otherwise I think the changes will not compile on
> Windows.

OK, done in the revised patch (attached).  Also, the MS-Windows port can't 
entirely skip the time module any more, as that module arranges for time.h to 
declare localtime_rz and friends.  I guess one possibility is to have 
nt/gnulib.mk mimic lib/gnulib.mk as far as the time module goes; this is also 
done in the revised patch.
[0001-New-optional-ZONE-arg-for-format-time-string-etc.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Sun, 26 Jul 2015 17:36:01 GMT) Full text and rfc822 format available.

Message #19 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 20:34:22 +0300
> Date: Sun, 26 Jul 2015 10:05:38 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: wgg2 <at> member.fsf.org, 21020 <at> debbugs.gnu.org
> 
> > I hope we have some
> > tests to make sure this doesn't cause any regressions.
> 
> test/automated/icalender-tests.el exercises the new code.

But the tests there that play with TZ are all expected failures on
MS-Windows, because they use Posix format of time-zone definition that
Windows runtime doesn't support.  So that probably means there are no
tests that could be used on Windows.

> Also, the MS-Windows port can't entirely skip the time module any
> more, as that module arranges for time.h to declare localtime_rz and
> friends.

This could conflict with time.h in nt/inc/sys/, no?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Sun, 26 Jul 2015 17:39:01 GMT) Full text and rfc822 format available.

Message #22 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: eggert <at> cs.ucla.edu
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: bug#21020: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 20:37:51 +0300
> Date: Sun, 26 Jul 2015 20:34:22 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
> 
> > Also, the MS-Windows port can't entirely skip the time module any
> > more, as that module arranges for time.h to declare localtime_rz and
> > friends.
> 
> This could conflict with time.h in nt/inc/sys/, no?

Also, lib/time.h seems to want to replace 'localtime', which might
clash with 'sys_localtime' we currently use as replacement on w32.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Sun, 26 Jul 2015 17:56:02 GMT) Full text and rfc822 format available.

Message #25 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 10:55:38 -0700
Eli Zaretskii wrote:

>> test/automated/icalender-tests.el exercises the new code.
>
> But the tests there that play with TZ are all expected failures on
> MS-Windows, because they use Posix format of time-zone definition that
> Windows runtime doesn't support.  So that probably means there are no
> tests that could be used on Windows.

OK, didn't know that.  Presumably this could be addressed by adding tests for 
MS-Windows TZ settings, if somebody has the time for this (pun intended...).

>> Also, the MS-Windows port can't entirely skip the time module any
>> more, as that module arranges for time.h to declare localtime_rz and
>> friends.
>
> This could conflict with time.h in nt/inc/sys/, no?

I don't see why.  <sys/time.h> is a different API.  This patch affects only 
<time.h>.

>lib/time.h seems to want to replace 'localtime', which might
> clash with 'sys_localtime' we currently use as replacement on w32.

The replacement is conditional, and the condition should be false on w32.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Sun, 26 Jul 2015 18:22:01 GMT) Full text and rfc822 format available.

Message #28 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 21:21:36 +0300
> Date: Sun, 26 Jul 2015 10:55:38 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: wgg2 <at> member.fsf.org, 21020 <at> debbugs.gnu.org
> 
> Eli Zaretskii wrote:
> 
> >> test/automated/icalender-tests.el exercises the new code.
> >
> > But the tests there that play with TZ are all expected failures on
> > MS-Windows, because they use Posix format of time-zone definition that
> > Windows runtime doesn't support.  So that probably means there are no
> > tests that could be used on Windows.
> 
> OK, didn't know that.  Presumably this could be addressed by adding tests for 
> MS-Windows TZ settings, if somebody has the time for this (pun intended...).

MS-Windows supports only the simplest TZ format, as in EST-5EDT, you
cannot tell it when the DST rules begin and end.  And those test
exercise precisely those begin/end rules that cannot work.

> >> Also, the MS-Windows port can't entirely skip the time module any
> >> more, as that module arranges for time.h to declare localtime_rz and
> >> friends.
> >
> > This could conflict with time.h in nt/inc/sys/, no?
> 
> I don't see why.  <sys/time.h> is a different API.  This patch affects only 
> <time.h>.
> 
> >lib/time.h seems to want to replace 'localtime', which might
> > clash with 'sys_localtime' we currently use as replacement on w32.
> 
> The replacement is conditional, and the condition should be false on w32.

Then I guess we are lucky, and nothing could possibly become broken.

Thanks.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 26 Jul 2015 19:49:02 GMT) Full text and rfc822 format available.

Notification sent to William G. Gardella <wgg2 <at> member.fsf.org>:
bug acknowledged by developer. (Sun, 26 Jul 2015 19:49:03 GMT) Full text and rfc822 format available.

Message #33 received at 21020-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21020-done <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Sun, 26 Jul 2015 12:48:44 -0700
Eli Zaretskii wrote:
> Then I guess we are lucky, and nothing could possibly become broken.

Ha!  Fat chance.  But I gave it a shot by installing the patch as master 
commit 	af32fa956267af40db61051c248597144d41521c and I'm marking this bug as done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Mon, 27 Jul 2015 12:30:05 GMT) Full text and rfc822 format available.

Message #36 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Mon, 27 Jul 2015 15:29:33 +0300
> Date: Sun, 26 Jul 2015 12:48:44 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: wgg2 <at> member.fsf.org, 21020-done <at> debbugs.gnu.org
> 
> Eli Zaretskii wrote:
> > Then I guess we are lucky, and nothing could possibly become broken.
> 
> Ha!  Fat chance.  But I gave it a shot by installing the patch as master 
> commit 	af32fa956267af40db61051c248597144d41521c and I'm marking this bug as done.

I needed the changes in 7009674 to get this to build cleanly on
MinGW.  One of the changes in that commit is in lib/time.in.h.  This
is the same problem already reported for another Gnulib header:

  http://lists.gnu.org/archive/html/bug-gnulib/2015-06/msg00035.html

It sounds like similar changes are needed in other Gnulib headers,
lest they produce similar problems at some point.  I can provide a
list of all the __need_SOMETHING symbols used by the MinGW headers, if
that will help.

After the above commit, Emacs builds and generally seems to work, but
crashes inside icalendar tests.  Seems like something with heap
corruption.  I'm looking into that now.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Mon, 27 Jul 2015 15:04:01 GMT) Full text and rfc822 format available.

Message #39 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Mon, 27 Jul 2015 08:02:53 -0700
Eli Zaretskii wrote:
> I needed the changes in 7009674 to get this to build cleanly on
> MinGW.  One of the changes in that commit is in lib/time.in.h.

Thanks, I ported that code fix back to gnulib, as gnulib master commit 
b18e6d98e211be6bb0e720952a9baef7da1d27cb.

> It sounds like similar changes are needed in other Gnulib headers,
> lest they produce similar problems at some point.  I can provide a
> list of all the __need_SOMETHING symbols used by the MinGW headers, if
> that will help.

I looked into that and came up with the following list:

__need_NULL
__need_ptrdiff_t
__need_size_t
__need_struct_timespec
__need_time_t
__need___va_list
__need_wchar_t
__need_wint_t

The only other Gnulib header that refers to any of these symbols is stddef.in.h 
and if it's not used in MinGW then I expect we don't need to worry about it. 
Though there may be issues in MinGW itself, if it's using these symbols 
incompatibly with what GCC expects (stddef.h is a GCC header).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Mon, 27 Jul 2015 15:23:02 GMT) Full text and rfc822 format available.

Message #42 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: 24.4; `display-time-world' tampers with TZ
Date: Mon, 27 Jul 2015 18:22:14 +0300
> Date: Mon, 27 Jul 2015 08:02:53 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: wgg2 <at> member.fsf.org, 21020 <at> debbugs.gnu.org
> 
> > It sounds like similar changes are needed in other Gnulib headers,
> > lest they produce similar problems at some point.  I can provide a
> > list of all the __need_SOMETHING symbols used by the MinGW headers, if
> > that will help.
> 
> I looked into that and came up with the following list:
> 
> __need_NULL
> __need_ptrdiff_t
> __need_size_t
> __need_struct_timespec
> __need_time_t
> __need___va_list
> __need_wchar_t
> __need_wint_t

I think this is about right.

> The only other Gnulib header that refers to any of these symbols is stddef.in.h 
> and if it's not used in MinGW then I expect we don't need to worry about it. 

It's your call.

> Though there may be issues in MinGW itself, if it's using these symbols 
> incompatibly with what GCC expects (stddef.h is a GCC header).

And MinGW comes with it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Mon, 27 Jul 2015 15:39:02 GMT) Full text and rfc822 format available.

Message #45 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: eggert <at> cs.ucla.edu
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: bug#21020: 24.4; `display-time-world' tampers with TZ
Date: Mon, 27 Jul 2015 18:38:02 +0300
> Date: Mon, 27 Jul 2015 18:22:14 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
> 
> > The only other Gnulib header that refers to any of these symbols is stddef.in.h 
> > and if it's not used in MinGW then I expect we don't need to worry about it. 
> 
> It's your call.

Btw, I didn't mean only headers used by Emacs, I meant all the Gnulib
headers that reference those symbols in a similar manner (i.e. to
exclude certain parts of the header).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Mon, 27 Jul 2015 17:30:06 GMT) Full text and rfc822 format available.

Message #48 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: eggert <at> cs.ucla.edu
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: bug#21020: 24.4; `display-time-world' tampers with TZ
Date: Mon, 27 Jul 2015 20:29:43 +0300
> Date: Mon, 27 Jul 2015 15:29:33 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
> 
> After the above commit, Emacs builds and generally seems to work, but
> crashes inside icalendar tests.  Seems like something with heap
> corruption.  I'm looking into that now.

The reason seems to be these assignments in time_rz.c:

  static bool
  revert_tz (timezone_t tz)
  {
    if (tz == local_tz)
      return true;
    else
      {
	int saved_errno = errno;
	bool ok = change_env (tz);
	if (!ok)
	  saved_errno = errno;
  #if HAVE_TZNAME
	if (!ok)
	  tzname_address = NULL;
	if (tzname_address)
	  {
	    char *old_value = *tzname_address;
	    *tzname_address = tzname_value;  <<<<<<<<<<<<<<<<<<<<<<<
	    tzname_value = old_value;
	  }
  #endif
	tzfree (tz);
	errno = saved_errno;
	return ok;
      }
  }

  static void
  restore_tzname (void)
  {
  #if HAVE_TZNAME
    if (tzname_address)
      {
	*tzname_address = tzname_value;    <<<<<<<<<<<<<<<<<<<<<<
	tzname_address = NULL;
      }
  #endif
  }

If I ifdef away the 2 marked lines, the test suite runs flawlessly to
completion.

tzname_address is the address of one of the members of the tzname[]
array, which holds pointers into the bowels of libc.  I don't know why
overwriting them with our values causes such trouble, but even if this
is supposed to work, it makes me nervous.  I'm not even sure I
understand completely why this trick is needed (can you explain?).  In
any case, can we please do this in some less intrusive way, e.g., by
copying the TZ names to our private storage?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Tue, 28 Jul 2015 01:10:03 GMT) Full text and rfc822 format available.

Message #51 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: bug#21020: 24.4; `display-time-world' tampers with TZ
Date: Mon, 27 Jul 2015 18:09:37 -0700
Eli Zaretskii wrote:
> I'm not even sure I
> understand completely why this trick is needed (can you explain?).

On many platforms, calling 'tzset' (either directly, or indirectly via localtime 
etc.) invalidates tzname[0] and tzname[1].  For example:

   time_t t = 0;
   char *p = tzname[0];
   localtime (&t);
   puts (p ? p : "(null)");

Here 'puts' has undefined behavior if tzname[0] has been updated and its old 
value (equal to P) is no longer a valid pointer.

lib/time_rz.c attempted to work around this problem by replacing tzname[0] and 
tzname[1] with pointers to more-stable copies.  Apparently this doesn't work 
under MinGW.

> can we please do this in some less intrusive way, e.g., by
> copying the TZ names to our private storage?

OK, I did that in master commit 2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21020; Package emacs. (Tue, 28 Jul 2015 10:38:02 GMT) Full text and rfc822 format available.

Message #54 received at 21020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
Subject: Re: bug#21020: 24.4; `display-time-world' tampers with TZ
Date: Tue, 28 Jul 2015 13:37:38 +0300
> Date: Mon, 27 Jul 2015 18:09:37 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: 21020 <at> debbugs.gnu.org, wgg2 <at> member.fsf.org
> 
> Eli Zaretskii wrote:
> > I'm not even sure I
> > understand completely why this trick is needed (can you explain?).
> 
> On many platforms, calling 'tzset' (either directly, or indirectly via localtime 
> etc.) invalidates tzname[0] and tzname[1].  For example:
> 
>     time_t t = 0;
>     char *p = tzname[0];
>     localtime (&t);
>     puts (p ? p : "(null)");
> 
> Here 'puts' has undefined behavior if tzname[0] has been updated and its old 
> value (equal to P) is no longer a valid pointer.
> 
> lib/time_rz.c attempted to work around this problem by replacing tzname[0] and 
> tzname[1] with pointers to more-stable copies.  Apparently this doesn't work 
> under MinGW.

I see, thanks for explaining.

>  > can we please do this in some less intrusive way, e.g., by
>  > copying the TZ names to our private storage?
> 
> OK, I did that in master commit 2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237.

Thanks, this solves the problem.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Aug 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.