From unknown Mon Jun 16 23:41:06 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#19874 <19874@debbugs.gnu.org> To: bug#19874 <19874@debbugs.gnu.org> Subject: Status: 25.0.50; encode-time not working as expected Reply-To: bug#19874 <19874@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:41:06 +0000 retitle 19874 25.0.50; encode-time not working as expected reassign 19874 emacs submitter 19874 ashish.is@lostca.se (Ashish SHUKLA) severity 19874 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 15 08:41:21 2015 Received: (at submit) by debbugs.gnu.org; 15 Feb 2015 13:41:21 +0000 Received: from localhost ([127.0.0.1]:44430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMzRo-0008GZ-6K for submit@debbugs.gnu.org; Sun, 15 Feb 2015 08:41:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57328) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMzRl-0008GM-WF for submit@debbugs.gnu.org; Sun, 15 Feb 2015 08:41:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMzRb-0001eN-Eb for submit@debbugs.gnu.org; Sun, 15 Feb 2015 08:41:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMzRb-0001eJ-CB for submit@debbugs.gnu.org; Sun, 15 Feb 2015 08:41:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMzRV-0008C4-M8 for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 08:41:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMzRQ-0001c7-0F for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 08:41:01 -0500 Received: from aloka.lostca.se ([178.63.46.202]:61128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMzRP-0001bu-Hv for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 08:40:55 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id 430CBE4E for ; Sun, 15 Feb 2015 13:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to :subject:date:message-id:mime-version:content-type; s=howrah; bh=Kdi+iir2pIwOulKHcGB2J6eW+bk=; b=K4yRTNQ5h1WsVSIGgrKunljO48sn jYJ4AcUdczy1xGtGcwgqS+tvsR1xcD5r0mZ+sBF+VCqgTbtxrkL2I3OLwFlxck66 1JrVJ3inHzsRQBwfgH2b/jApZtAbGbhiYZbfXNHm6DhcFxw/SopytvbIgw9EXSmr eqz+O4Mm3EkCDP0= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 95A51E4C for ; Sun, 15 Feb 2015 13:40:52 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 99afb81d for ; Sun, 15 Feb 2015 19:10:48 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: bug-gnu-emacs@gnu.org Subject: 25.0.50; encode-time not working as expected Organization: alt.religion.emacs X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 6:41PM up 1 day, 30 mins, 13 users, load averages: 0.19, 0.16, 0.13 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p5/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: alt.religion.emacs X-Hashcash: 1:20:150215:bug-gnu-emacs@gnu.org::IhI14+pAG82exPur:00000000000000000000000000000000000000003sTX Date: Sun, 15 Feb 2015 19:10:44 +0530 Message-ID: <86vbj35m3n.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I'm running FreeBSD 10.1 (amd64). My /etc/localtime points to "Asia/Kolkata" (Indian Standard Time, UTC+0530) timezone. For "Date: Sun, 15 Feb 2015 06:42:44 +0000 (UTC)": #v+ (encode-time 44 42 6 15 2 2015 0 nil 0) =3D> (21727 62092) =3D 1423962764 #v- #v+ >>> print gmtime(1423962764) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D1, tm_= min=3D12, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) >>> print localtime(1423962764) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D6, tm_= min=3D42, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) #v- If it was "Date: Sun, 15 Feb 2015 06:42:44 +0530": #v+ (encode-time 44 42 6 15 2 2015 0 nil 19800) =3D> (21727 62092) #v- The expected output for the time specified in UTC should be: (21728 16356) =3D 1423982564 #v+ >>> print gmtime(1423982564) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D6, tm_= min=3D42, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) >>> print localtime(1423982564) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D12, tm= _min=3D12, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) #v- I've come across while trying to figure out cause for a bug[1] report while ago. In GNU Emacs 25.0.50.1 (amd64-portbld-freebsd10.1, GTK+ Version 3.14.7) of 2015-02-06 on chateau.d.if Windowing system distributor `The X.Org Foundation', version 11.0.11407000 Configured using: `configure --localstatedir=3D/var --without-compress-install --with-dbus --with-file-notification=3Dgfile --with-gconf --with-gif --with-gnutls --with-gsettings --with-jpeg --with-m17n-flt --with-imagemagick --with-lib= otf --with-png --with-toolkit-scroll-bars --with-rsvg --with-tiff --with-x --with-xft --with-xim --with-xml2 --with-xpm --with-x-toolkit=3Dgtk3 --with-sound=3Dalsa --x-libraries=3D/usr/local/lib --x-includes=3D/usr/local/include --prefix=3D/usr/local --mandir=3D/usr/lo= cal/man --infodir=3D/usr/local/share/emacs/info/ --build=3Damd64-portbld-freebsd10= .1 'CFLAGS=3D-O2 -g -march=3Dcorei7 -fstack-protector -fno-strict-aliasing' CPPFLAGS=3D-I/usr/local/include 'LDFLAGS=3D -L/usr/local/lib -Wl,-rpath=3D/usr/local/lib -ltinfo -fstack-protector'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dscim locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: paredit-mode: t shell-dirtrack-mode: t global-auto-complete-mode: t auto-complete-mode: t delete-selection-mode: t display-time-mode: t show-paren-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t Recent messages: Mark set [4 times] (21727 62092) Mark saved where search started Quit Mark saved where search started [3 times] [2 times] Mark saved where search started [3 times] Mark set [3 times] delete-backward-char: Text is read-only Making completion list... Load-path shadows: /home/abbe/.emacs.d/elisp/sx.el/sx hides /home/abbe/.emacs.d/elisp/sx /home/abbe/.emacs.d/elisp/apel/env hides /usr/local/share/emacs/25.0.50/lis= p/env /home/abbe/.emacs.d/elisp/apel/timezone hides /usr/local/share/emacs/25.0.5= 0/lisp/timezone /home/abbe/.emacs.d/elisp/emms/lisp/tq hides /usr/local/share/emacs/25.0.50= /lisp/emacs-lisp/tq Features: (shadow flyspell ispell hashcash footnote nnir emacsbug sendmail quail debug edebug misearch multi-isearch eieio-opt help-mode compface gnus-fun mm-arch= ive qp sort smiley gnus-cite gnus-async gnus-bcklg gnus-ml disp-table gnus-topic utf-7 nndraft nnmh nnmaildir network-stream nsm starttls bbdb-gnus bbdb-sna= rf mail-extr nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache epa-file epa epg spam spam-stat bbdb-com warnings bbdb gnus-uu y= enc gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig mm-u= rl nnmairix nnml gnus-sum gnus-group gnus-undo supercite regi gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message idna rfc822 mml mml-sec mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader mail-utils server paredit sx-load sx-tab sx-switchto sx-search sx-notify sx-interaction sx-inbox sx-question-list sx-question-mode sx-question-print sx-user sx-favorites sx-networks sx-site sx-compose sx-tag markdown-mode sx-babel sx-button sx-question sx-method sx-filter sx-auth sx-cache sx-requ= est sx-encoding json sx-time sx let-alist helm-config helm-autoloads async-bytecomp async helm-aliases bison-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs gtags quack cmuscheme scheme tango-dark-theme caml tuareg_indent tuareg speedbar sb-ima= ge ezimage dframe smie coffee-mode cider tramp-sh cider-mode cider-repl cider-eldoc cider-interaction cider-doc org-table cider-test cider-stacktra= ce cider-client nrepl-client queue cider-util ewoc dash emms-player-mpd tq emms-cache emms-info-ogginfo emms-info-mp3info emms-info later-do emms-playlist-mode emms-player-vlc emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file emms-setup emms emms-compat tramp tramp-compat tramp-loaddefs trampver shell blog metaweblog xml-rpc timezone pym static apel-ver product url-http tls url url-proxy url-privacy url-expa= nd url-methods url-history mailcap url-auth mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-cookie url-domsuf url-util url-parse auth-source gnus-util mm-util mail-prsvr password-cache url-gw url-vars xml muse-html muse-xml-common cus-edit cus-start cus-load muse-publish muse-project muse-protocols info muse-regexps wid-edit muse muse-nested-tags muse-mode org-agenda org org-macro org-footnote org-pcomplete 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-ma= cs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs auto-complete-config auto-complete popup slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-fu= zzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-repl elp slime-parse slime gud apropos compile etags xr= ef eieio byte-opt bytecomp byte-compile cl-extra seq cconv eieio-core cl-gener= ic pcase arc-mode archive-mode noutline outline easy-mmode pp comint ansi-color ring hyperspec thingatpt browse-url slime-autoloads clojure-mode rx derived edmacro kmacro easymenu imenu scim-bridge mule-util elscreen advice help-fns dired iswitchb bbdb-autoloads w3m-load erlang-start boxquote cl-macs rect cl gv cl-loaddefs cl-lib delsel time paren time-date tooltip eldoc 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 elisp-mode lisp-m= ode 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 cl-preloaded 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 system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-= tty emacs) Memory information: ((conses 16 789746 115688) (symbols 48 110602 0) (miscs 40 1234 2274) (strings 32 284138 30822) (string-bytes 1 15430510) (vectors 16 99528) (vector-slots 8 1286063 42005) (floats 8 509 1071) (intervals 56 8699 446) (buffers 976 41)) References: [1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18899 Please let me know if you need more information. Thanks! =2D-=20 Ashish SHUKLA =E2=80=9CIt now costs more to amuse a child than it once did to educate his= father.=E2=80=9D Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU4KHdAAoJEMdGz6nnT6SwJ/MP/25qGew3oPQ7OB8bzmR7lW7A oFVE+RYRUaJRn9nkyQs/9KRNniKiUNYL5L6cju8SJCAzq7N/PyLfHuObjI15QZLa yva19cuRi0gWnGIWrap1FZnwsLzqb5p6Q1KNCYZbqzR303WTRFbfk/Bxcl9H9wDE BumW2xXMhtC1pcC8+c+NNsLkssjhQ9uLcPFaognbuS/FeBjXhbHF3FBV2Pk81G2X 3IJvcZOPxAdOlKm/3YJPyUAQKPf0QNwbzHMi0ypTguik30Y17hxAhxWC9EAXNprf a1yAkMXOtl8pQaEITaSMAlQ4R7g3TNoJxFpBBIq3KIsPivEFxsFAaRzokFKBIo7a VEDSHL1CxBd+ttYQ4nNQBYz2/Nppo1hHHX600kXHba5K139vhV0WP4gdOt/Iij+/ ANRaX54UcngU7FmgcRFuRxeAwpdqy+iKojb47H8qU/jq60EjuhmO7btKeaeLGf/P 4IG7Povxq5CdAVzd/hmTaYd7JcIEOF1qHF8MFn/wRMMV/wehY6nEkyKwCAn50EBg Rce4WY7FN8W6O7jJFSP3b5pIdjxle/hbakG6ULHxXmQYAtUVBsUbfUwq9fvMCDju ANPaZ8FQQhUwyHnlWsg9ZWrpOeYUThqireewlPMW7TxOJk6tdAxyrXFIDGZK5TaE /1BTv6paGF4rX5SI3xZA =ahL9 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 15 19:06:31 2015 Received: (at 19874) by debbugs.gnu.org; 16 Feb 2015 00:06:31 +0000 Received: from localhost ([127.0.0.1]:44979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YN9Co-0005eI-Ht for submit@debbugs.gnu.org; Sun, 15 Feb 2015 19:06:31 -0500 Received: from aloka.lostca.se ([178.63.46.202]:62423 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YN8hP-0004wL-U1 for 19874@debbugs.gnu.org; Sun, 15 Feb 2015 18:34:04 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id E662D61A for <19874@debbugs.gnu.org>; Sun, 15 Feb 2015 23:34:01 +0000 (UTC) Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 75A0E619 for <19874@debbugs.gnu.org>; Sun, 15 Feb 2015 23:34:01 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id ee5fe579 for <19874@debbugs.gnu.org>; Mon, 16 Feb 2015 05:03:57 +0530 (IST) X-Hashcash: 1:20:150215:19874@debbugs.gnu.org::ZfxEBKJMV7bLlOPY:00000000000000000000000000000000000000000Jco From: ashish@members.fsf.org (Ashish SHUKLA) To: 19874@debbugs.gnu.org Subject: Re: 25.0.50; encode-time not working as expected Organization: alt.religion.emacs X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 5:02AM up 4:53, 10 users, load averages: 0.45, 0.34, 0.23 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p5/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: alt.religion.emacs Date: Mon, 16 Feb 2015 05:03:53 +0530 Message-ID: <86vbj27nry.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 X-Mailman-Approved-At: Sun, 15 Feb 2015 19:06:29 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Forgot to mention, the revision I'm running. I'm running "5c9ad35f" of git master. Thanks! =2D-=20 Ashish SHUKLA =E2=80=9COnly one thing is impossible for God: To find any sense in any cop= yright law on the planet.=E2=80=9D (Mark Twain) Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU4SziAAoJEMdGz6nnT6SwvkwP/j8MWUg0TcwOK1wvsJvBm0kq o13QFx1/0W0j3d+YBdRtKAw/FlsfA+0kH29r8mcqgGtI6d+z+L33czq7efBmK33m LNbLnKtSnYiHgbcCfs1eDAbmkqEfEjzFZ86BS4ys3RRtZrdfmqfY4yb0Dio6QJpl 4HSw4FOJcqnUy9oiGPja02RYimWzgfqA1Yg+Z6Yy7F4xTP3js6uucO1C/FUcNilj OouOLsY40AV7AIXx8BtoyilgFwSa7NU+fkREd+oTkZ5Sxjeaw4F+z+8wwSpMoBRM R6zxuv8x6b0vEfSyNf/PP8ZtyzuJ6BYfYFdWHJDoXnArTER6NENOX4hxiaxdX6xP +/BGe/fttaB5lB4BHugXq03tlbl5nKC5nrzAOVYje/YJ3IJ736ebYUSjVg+wIlrz G7r77gk+YqkOeZGA+BH2Khd/0iwzI1xcMeOBcc73I47zw4XJExgw+HzFO+DEEf5f 7P//9fNROdgp3vvLIdv0yw0jX1I/D0y2OBa8pUID8WNRK4MNk1Kfat+nIvvEolFm BDcmlbRZQLCJOwCQ3Y4BUnf6LSe7XkqHxjgphqvd+BMmp6cousR9zb5hnXrX1K/o MUuEnjJOm0fwC4B/AfpZs7Mn9yw6tRmWfK5KBGXy/QJFHOUbrKW+PX2YO02bBZxy l8a+ss40h+pldmolkoqq =SVK+ -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 25 12:41:59 2015 Received: (at 19874) by debbugs.gnu.org; 25 Feb 2015 17:41:59 +0000 Received: from localhost ([127.0.0.1]:58029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQfyA-0007gc-Nt for submit@debbugs.gnu.org; Wed, 25 Feb 2015 12:41:59 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:60338) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQfy8-0007gL-3E for 19874@debbugs.gnu.org; Wed, 25 Feb 2015 12:41:56 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id D8F14A6000D; Wed, 25 Feb 2015 09:41:49 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IHYL4PHtDqGY; Wed, 25 Feb 2015 09:41:49 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 88903A6000C; Wed, 25 Feb 2015 09:41:49 -0800 (PST) Message-ID: <54EE0959.5080901@cs.ucla.edu> Date: Wed, 25 Feb 2015 09:41:45 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ashish SHUKLA Subject: Re: 25.0.50; encode-time not working as expected Content-Type: multipart/mixed; boundary="------------090106080907080609060307" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------090106080907080609060307 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the bug report. My guess is that there's an incompatibility with FreeBSD 10.1 amd64 mktime. I can't reproduce the problem on FreeBSD 9.1 x86. Please try the attached patch, just for debugging, and then run the following one-line shell command: src/emacs -Q -batch -eval '(progn (setenv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))' What output do you get? Here's what I get on Fedora 21 x86-64, which seems correct: oldtz=Asia/Kolkata tz=XXX-0:00:00 oldTZ=Asia/Kolkata TZ=XXX-0:00:00 2015-02-15 06:42:44 -1 -> 2015-02-15 06:42:44 0 = 1423982564 Assuming you get different output, can you debug Emacs with GDB to send us more details about what's going wrong? If not, can you give me access to a FreeBSD 10.1 amd64 machine like yours? --------------090106080907080609060307 Content-Type: text/x-patch; name="debug-encode-time.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="debug-encode-time.patch" diff --git a/src/editfns.c b/src/editfns.c index dbcb316..fca95d5 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1423,10 +1423,28 @@ mktime_z (timezone_t tz, struct tm *tm) oldtz = strcpy (oldtzcopy, oldtz); } block_input (); + char const *oldTZ = getenv ("TZ"); + if (oldTZ) + oldTZ = xstrdup (oldTZ); set_time_zone_rule (tz); + char const *TZ = getenv ("TZ"); + fprintf (stderr, + ("oldtz=%s tz=%s oldTZ=%s TZ=%s " + "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %d -> "), + oldtz ? oldtz : "(null)", + tz ? tz : "(null)", + oldTZ ? oldTZ : "(null)", + TZ ? TZ : "(null)", + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + tm->tm_isdst); time_t t = mktime (tm); set_time_zone_rule (oldtz); unblock_input (); + fprintf (stderr, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %d = %ld", + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + tm->tm_isdst, (long) t); SAFE_FREE (); return t; } --------------090106080907080609060307-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 25 19:24:35 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 00:24:35 +0000 Received: from localhost ([127.0.0.1]:58113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQmFm-0000M3-Gb for submit@debbugs.gnu.org; Wed, 25 Feb 2015 19:24:35 -0500 Received: from aloka.lostca.se ([178.63.46.202]:25046 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQmFj-0000Ls-DG for 19874@debbugs.gnu.org; Wed, 25 Feb 2015 19:24:32 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id 8E55057A; Thu, 26 Feb 2015 00:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=j6CNcYcAe4kipCD75XaR3B8Uh58=; b=LX8D 5hIFvUSOTHE3UHIiKyqb4AvvzIgXJs5Q9qKKc0uuq2q6iJUf05nLxOnmHNfMyFes BM99U7+gkqicljXg1gxO1faCZuA3EPK98UzRY8BoGe9PDPXO0vfw6qX1YA2dbC6l oZyLrWpBp2p4Y8juNROJkiWvNXwEFBjTZKQ0bXA= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 986B4579; Thu, 26 Feb 2015 00:24:28 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 52702f86; Thu, 26 Feb 2015 05:54:25 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Paul Eggert Subject: Re: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 5:29AM up 1:26, 8 users, load averages: 0.07, 0.24, 0.23 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150225:19874@debbugs.gnu.org::ReF0sZ39C32IFVqx:000000000000000000000000000000000000000008Q7 X-Hashcash: 1:20:150225:eggert@cs.ucla.edu::ghhytnJOusYstWMJ:00000000000000000000000000000000000000000001C78 Date: Thu, 26 Feb 2015 05:54:19 +0530 In-Reply-To: <54EE0959.5080901@cs.ucla.edu> (Paul Eggert's message of "Wed, 25 Feb 2015 09:41:45 -0800") Message-ID: <86sidta5ak.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, 25 Feb 2015 09:41:45 -0800, Paul Eggert said: | Thanks for the bug report. My guess is that there's an | incompatibility with FreeBSD 10.1 amd64 mktime. I can't reproduce the | problem on FreeBSD 9.1 x86. | Please try the attached patch, just for debugging, and then run the | following one-line shell command: | src/emacs -Q -batch -eval '(progn (setenv "TZ" "Asia/Kolkata") (print | (encode-time 44 42 6 15 2 2015 0 nil 0)))' | What output do you get? Here's what I get on Fedora 21 x86-64, which see= ms correct: | oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:= 00 | 2015-02-15 06:42:44 -1 -> 2015-02-15 06:42:44 0 =3D 1423982564 | Assuming you get different output, can you debug Emacs with GDB to | send us more details about what's going wrong? If not, can you give | me access to a FreeBSD 10.1 amd64 machine like yours? Hi, When I looked into this before filing this bug report, from what I noticed that it's not using libc's `mktime' function, unlike what you seem to indicate. I'm not sure quite why it's doing that when libc provided mktime works just fine, as evident by output of attached program: =2D-8<---------------cut here---------------start------------->8--- % ./gmtime Staying at localtime zone Time (in seconds): 1423962764 Updated environment Switching to UTC Time (in seconds): 1423982564 Didn't update environment Switching to UTC+1 Time (in seconds): 1423978964 Didn't update environment Switching to UTC+3 Time (in seconds): 1423971764 =2D-8<---------------cut here---------------end--------------->8--- =2D-8<---------------cut here---------------start------------->8--- >>> print gmtime(1423962764) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D1, tm_= min=3D12, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) >>> print gmtime(1423982564) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D6, tm_= min=3D42, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) >>> print gmtime(1423978964) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D5, tm_= min=3D42, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) >>> print gmtime(1423971764) time.struct_time(tm_year=3D2015, tm_mon=3D2, tm_mday=3D15, tm_hour=3D3, tm_= min=3D42, tm_sec=3D44, tm_wday=3D6, tm_yday=3D46, tm_isdst=3D0) =2D-8<---------------cut here---------------end--------------->8--- The built-in mktime implementation (__mktime_internal) in Emacs sources don= 't seem to take into account timezone offsets. I might be completely wrong her= e, but the code seemed to be doing it. I'll get back to you with the output of your command-line from patched Emacs in few, but the results of my past investigation were handy so I've attached them. HTH =2D-=20 Ashish SHUKLA =E2=80=9C"Intellectual Property" is nowhere near as valuable as "Intellect"= =E2=80=9D ("Ion-Mihai Tetcu") Sent from my Emacs --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=gmtime.c Content-Description: gmtime.c #include #include #include #include #define BUFSIZE 256 void settz(const char* tz) { static char *tzvalbuf; static size_t tzvalbufsize; if( tzvalbufsize <= 3 + strlen(tz)) { tzvalbuf = malloc(tzvalbufsize = BUFSIZE); snprintf( tzvalbuf, BUFSIZE, "TZ=%s", tz ); putenv( tzvalbuf ); puts( "Updated environment" ); } else { puts( "Didn't update environment" ); snprintf( tzvalbuf, BUFSIZE, "TZ=%s", tz ); } tzset(); } int main() { struct tm t = { .tm_sec = 44, .tm_min = 42, .tm_hour = 6, .tm_mday = 15, .tm_mon = 2 - 1, .tm_year = 2015 - 1900, .tm_isdst = -1, }; time_t val; puts( "Staying at localtime zone" ); val = mktime( &t ); printf( "Time (in seconds): %ld\n", val ); settz( "TZ=XXX-0:00:00" ); puts( "Switching to UTC" ); val = mktime( &t ); printf( "Time (in seconds): %ld\n", val ); settz( "TZ=XXX-1:00:00" ); puts( "Switching to UTC+1" ); val = mktime( &t ); printf( "Time (in seconds): %ld\n", val ); settz( "TZ=XXX-3:00:00" ); puts( "Switching to UTC+3" ); val = mktime( &t ); printf( "Time (in seconds): %ld\n", val ); return 0; } --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU7me0AAoJEMdGz6nnT6SwEmYP/3aYc/zE8UUVU8oDtVkfkZhE LV8rld5wb7EbAJedZKcgtD5lOh7W3ZfR1V8T5ifDCPEFjgy4CSIAFpDhIFVxz+++ RtlkF8UPnO+DJvg7nTVAW2J2RRw9XmYBWe88z4OweRa8SZYHcoGDzabLHaEo1Tae PvA/4yYch29wbYGWsRT7swNQ5Tza3839Kdbrcz2zyzu4VN1BZ+UbC+ZJj9jBAH6s XaQyWAt2RzDxZ71UAk5R2JEx7Q6HhhTGjjQTAkY99PNvHbjsS4rnXuF5NWrJw09r jpaezK/xFyh6YTQbxesAk7PcwyX/J408bJrPnxZa8T1JIYWsg/TPOmGMwXKvURRE 5DbC031qGiBX43pjKaPV1vuqm8gT64NVECe6ZBrRHFEzw9BalobAjXrHySJ15fUu iqOagMGhshOeKkh+n2xqcNzcpB3OLHt8wGQhvRhcq9t0nOq+De4EjdP2cdZ0QSyk 2JMMXyjUq9j+ZE1xRcywXvyttiM8VeAWk9D2N9h6pMrnt5WuvWQeg2PyilEAs3Fw 2ci7+45PqqAuKuCz05bj1EARWxReGTgk8pVHXu+u+GZSvuWAexFPALDTTceRxgRN vr8rxgwZ4zP3Ve3EU1ccVX05rYGWAlPWB0WMtTnsQQy/dINWIrrKOeiXWQLT19ft Dms/dJY7ThBw7hyjKQtd =9WLO -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 01:52:09 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 06:52:10 +0000 Received: from localhost ([127.0.0.1]:58180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQsIq-00012f-O8 for submit@debbugs.gnu.org; Thu, 26 Feb 2015 01:52:09 -0500 Received: from aloka.lostca.se ([178.63.46.202]:28731 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQsIn-00012R-3n for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 01:52:06 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id E72A186F; Thu, 26 Feb 2015 06:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=MldkzF+id4Iy4VFh7wY9U7fd4jk=; b=q1G3 Zknt9hgI/prOgmHP9Mcr8m+ZywoZDbYupS2YNfs1WTI2G7xHrB0AX52wNV5NPwWF rK3miZ6eU0fEMGNK5Xwc3YocH+TOD/U1JlthzR3w0beOy6qJt7hkzxHLuLRrG3W7 EIn5Syn/VSf02sU59ku0EUc4RPazfMmmMcmgP0Q= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 3E55E86E; Thu, 26 Feb 2015 06:52:02 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 017a0969; Thu, 26 Feb 2015 12:21:58 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Paul Eggert Subject: Re: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 11:32AM up 7:29, 8 users, load averages: 0.22, 0.22, 0.19 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150226:19874@debbugs.gnu.org::C/kl0a29ABbJvREa:00000000000000000000000000000000000000000G2P X-Hashcash: 1:20:150226:eggert@cs.ucla.edu::wKWTgZ5BgFBlmEXd:000000000000000000000000000000000000000000036mU Date: Thu, 26 Feb 2015 12:21:55 +0530 In-Reply-To: <54EE0959.5080901@cs.ucla.edu> (Paul Eggert's message of "Wed, 25 Feb 2015 09:41:45 -0800") Message-ID: <86zj8188s4.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 25 Feb 2015 09:41:45 -0800, Paul Eggert said: | Thanks for the bug report. My guess is that there's an | incompatibility with FreeBSD 10.1 amd64 mktime. I can't reproduce the | problem on FreeBSD 9.1 x86. | Please try the attached patch, just for debugging, and then run the | following one-line shell command: | src/emacs -Q -batch -eval '(progn (setenv "TZ" "Asia/Kolkata") (print | (encode-time 44 42 6 15 2 2015 0 nil 0)))' | What output do you get? Here's what I get on Fedora 21 x86-64, which see= ms correct: | oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:= 00 | 2015-02-15 06:42:44 -1 -> 2015-02-15 06:42:44 0 =3D 1423982564 Tried, and following is what I get: =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ../src/emacs -Q -batch -eval '(progn = (setenv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)= ))' oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:00= 2015-02-15 06:42:44 -1 -> 2015-02-15 06:42:44 0 =3D 1423982564 (21728 16356) =2D-8<---------------cut here---------------end--------------->8--- Since I noticed that your code doesn't do any changes, rather just prints some intermediate information, so I did this in X11 window (note the absence of '-batch' option) =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ../src/emacs -Q -eval '(progn (setenv= "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))' oldtz=3D(null) tz=3DXXX-0:00:00 oldTZ=3D(null) TZ=3D(null) 2015-02-15 06:42= :44 -1 -> 2015-02-15 06:42:44 0 =3D 1423962764 =2D-8<---------------cut here---------------end--------------->8--- in minibuffer in X11 window, "(21727 62092)" message was printed. I explici= tly eval-ed Emacs Lisp code in *scratch* buffer, and got same output as mention= ed above. Ran "emacs -batch ...." under gdb, with breaking on `getenv' after `Fencode= _time': =2D-8<---------------cut here---------------start------------->8--- Breakpoint 5, 0x00000008084beab4 in getenv () from /lib/libc.so.7 (gdb) bt #0 0x00000008084beab4 in getenv () from /lib/libc.so.7 #1 0x0000000000677fa8 in emacs_mktime_z (tz=3D0x1385fd8 "XXX-0:00:00", tm= =3D0x7fffffffb140) at editfns.c:1404 #2 0x0000000000679f6a in Fencode_time (nargs=3D9, args=3D0x7fffffffb1a0) a= t editfns.c:2150 #3 0x000000000068ac60 in eval_sub (form=3D18361299) at eval.c:2154 #4 0x000000000068ad06 in eval_sub (form=3D18361523) at eval.c:2167 #5 0x000000000068b4b6 in Fprogn (body=3D18360931) at eval.c:445 #6 0x000000000068aa06 in eval_sub (form=3D18361811) at eval.c:2131 #7 0x000000000068fb66 in Feval (form=3D18361811, lexical=3D0) at eval.c:19= 96 #8 0x0000000000690a7d in Ffuncall (nargs=3D2, args=3D0x7fffffffba78) at ev= al.c:2721 #9 0x00000000006f3114 in exec_byte_code (bytestr=3D11659316, vector=3D1165= 9349, maxdepth=3D94, args_template=3D1030, nargs=3D1, args=3D0x7fffffffc458= ) at bytecode.c:919 #10 0x0000000000691aba in funcall_lambda (fun=3D11659269, nargs=3D1, arg_ve= ctor=3D0x7fffffffc450) at eval.c:2885 #11 0x0000000000690c6e in Ffuncall (nargs=3D2, args=3D0x7fffffffc448) at ev= al.c:2767 #12 0x00000000006f3114 in exec_byte_code (bytestr=3D11636164, vector=3D1163= 6197, maxdepth=3D74, args_template=3D2, nargs=3D0, args=3D0x7fffffffce78) a= t bytecode.c:919 #13 0x0000000000691aba in funcall_lambda (fun=3D11636117, nargs=3D0, arg_ve= ctor=3D0x7fffffffce78) at eval.c:2885 #14 0x0000000000690c6e in Ffuncall (nargs=3D1, args=3D0x7fffffffce70) at ev= al.c:2767 #15 0x00000000006f3114 in exec_byte_code (bytestr=3D11633180, vector=3D1163= 3213, maxdepth=3D50, args_template=3D2, nargs=3D0, args=3D0x7fffffffd730) a= t bytecode.c:919 #16 0x0000000000691aba in funcall_lambda (fun=3D11633133, nargs=3D0, arg_ve= ctor=3D0x7fffffffd730) at eval.c:2885 #17 0x000000000068ff01 in apply_lambda (fun=3D11633133, args=3D0, count=3D3= ) at eval.c:2826 #18 0x000000000068afdf in eval_sub (form=3D18458531) at eval.c:2226 #19 0x000000000068fb66 in Feval (form=3D18458531, lexical=3D0) at eval.c:19= 96 #20 0x00000000005cff4a in top_level_2 () at keyboard.c:1148 #21 0x000000000068e3d1 in internal_condition_case (bfun=3D0x5cff20 , handlers=3D19488, hfun=3D0x5cff50 ) at eval.c:1348 #22 0x00000000005cfeb3 in top_level_1 (ignore=3D0) at keyboard.c:1156 #23 0x000000000068d981 in internal_catch (tag=3D46224, func=3D0x5cfe60 , arg=3D0) at eval.c:1108 #24 0x00000000005b1190 in command_loop () at keyboard.c:1117 #25 0x00000000005b0fe1 in recursive_edit_1 () at keyboard.c:728 #26 0x00000000005b138a in Frecursive_edit () at keyboard.c:799 #27 0x00000000005aeda1 in main (argc=3D5, argv=3D0x7fffffffde88) at emacs.c= :1607 Lisp Backtrace: "encode-time" (0xffffb1a0) "print" (0xffffb5e8) "progn" (0xffffb848) "eval" (0xffffba80) "command-line-1" (0xffffc450) "command-line" (0xffffce78) "normal-top-level" (0xffffd730) (gdb) next Single stepping until exit from function getenv, which has no line number information. emacs_mktime_z (tz=3D0x1385fd8 "XXX-0:00:00", tm=3D0x7fffffffb140) at editf= ns.c:1405 1405 USE_SAFE_ALLOCA; (gdb) list 1400 #ifndef HAVE_TZALLOC 1401 time_t 1402 mktime_z (timezone_t tz, struct tm *tm) 1403 { 1404 char *oldtz =3D getenv ("TZ"); 1405 USE_SAFE_ALLOCA; 1406 if (oldtz) 1407 { 1408 size_t oldtzsize =3D strlen (oldtz) + 1; 1409 char *oldtzcopy =3D SAFE_ALLOCA (oldtzsize); (gdb) print oldtz $1 =3D 0x1364783 "Asia/Kolkata" =2D-8<---------------cut here---------------end--------------->8--- And with gdb-ing in non -batch mode, got this instead: =2D-8<---------------cut here---------------start------------->8--- Breakpoint 4, 0x00000008084beab4 in getenv () from /lib/libc.so.7 (gdb) bt #0 0x00000008084beab4 in getenv () from /lib/libc.so.7 #1 0x0000000000677fa8 in emacs_mktime_z (tz=3D0x1d16ae8 "XXX-0:00:00", tm= =3D0x7fffffffb150) at editfns.c:1404 #2 0x0000000000679f6a in Fencode_time (nargs=3D9, args=3D0x7fffffffb1b0) a= t editfns.c:2150 #3 0x000000000068ac60 in eval_sub (form=3D30524771) at eval.c:2154 #4 0x000000000068ad06 in eval_sub (form=3D30524755) at eval.c:2167 #5 0x000000000068b4b6 in Fprogn (body=3D30524947) at eval.c:445 #6 0x000000000068aa06 in eval_sub (form=3D30524675) at eval.c:2131 #7 0x000000000068fb66 in Feval (form=3D30524675, lexical=3D0) at eval.c:19= 96 #8 0x0000000000690a7d in Ffuncall (nargs=3D2, args=3D0x7fffffffba88) at ev= al.c:2721 #9 0x00000000006f3114 in exec_byte_code (bytestr=3D11659316, vector=3D1165= 9349, maxdepth=3D94, args_template=3D1030, nargs=3D1, args=3D0x7fffffffc468= ) at bytecode.c:919 #10 0x0000000000691aba in funcall_lambda (fun=3D11659269, nargs=3D1, arg_ve= ctor=3D0x7fffffffc460) at eval.c:2885 #11 0x0000000000690c6e in Ffuncall (nargs=3D2, args=3D0x7fffffffc458) at ev= al.c:2767 #12 0x00000000006f3114 in exec_byte_code (bytestr=3D11636164, vector=3D1163= 6197, maxdepth=3D74, args_template=3D2, nargs=3D0, args=3D0x7fffffffce88) a= t bytecode.c:919 #13 0x0000000000691aba in funcall_lambda (fun=3D11636117, nargs=3D0, arg_ve= ctor=3D0x7fffffffce88) at eval.c:2885 #14 0x0000000000690c6e in Ffuncall (nargs=3D1, args=3D0x7fffffffce80) at ev= al.c:2767 #15 0x00000000006f3114 in exec_byte_code (bytestr=3D11633180, vector=3D1163= 3213, maxdepth=3D50, args_template=3D2, nargs=3D0, args=3D0x7fffffffd740) a= t bytecode.c:919 #16 0x0000000000691aba in funcall_lambda (fun=3D11633133, nargs=3D0, arg_ve= ctor=3D0x7fffffffd740) at eval.c:2885 #17 0x000000000068ff01 in apply_lambda (fun=3D11633133, args=3D0, count=3D3= ) at eval.c:2826 #18 0x000000000068afdf in eval_sub (form=3D18458531) at eval.c:2226 #19 0x000000000068fb66 in Feval (form=3D18458531, lexical=3D0) at eval.c:19= 96 #20 0x00000000005cff4a in top_level_2 () at keyboard.c:1148 #21 0x000000000068e3d1 in internal_condition_case (bfun=3D0x5cff20 , handlers=3D19488, hfun=3D0x5cff50 ) at eval.c:1348 #22 0x00000000005cfeb3 in top_level_1 (ignore=3D0) at keyboard.c:1156 #23 0x000000000068d981 in internal_catch (tag=3D46224, func=3D0x5cfe60 , arg=3D0) at eval.c:1108 #24 0x00000000005b1190 in command_loop () at keyboard.c:1117 #25 0x00000000005b0fe1 in recursive_edit_1 () at keyboard.c:728 #26 0x00000000005b138a in Frecursive_edit () at keyboard.c:799 #27 0x00000000005aeda1 in main (argc=3D4, argv=3D0x7fffffffde98) at emacs.c= :1607 Lisp Backtrace: "encode-time" (0xffffb1b0) "print" (0xffffb5f8) "progn" (0xffffb858) "eval" (0xffffba90) "command-line-1" (0xffffc460) "command-line" (0xffffce88) "normal-top-level" (0xffffd740) (gdb) next Single stepping until exit from function getenv, which has no line number information. emacs_mktime_z (tz=3D0x1d16ae8 "XXX-0:00:00", tm=3D0x7fffffffb150) at editf= ns.c:1405 1405 USE_SAFE_ALLOCA; (gdb) print oldtz=20 $1 =3D 0x0 =2D-8<---------------cut here---------------end--------------->8--- HTH =2D-=20 Ashish SHUKLA <@abbe> give man ssh access, he'll still need computer. give him a computer, he'll give ssh access to you. Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU7sKLAAoJEMdGz6nnT6SwkCwP/jH2GKLoTu+t2L4YXcHuxqDX ZGnziheQkmR8yd5ZjOKTFU9QVpFDlw9fzRuony09lVwZh0eZw2prL98MSnbj/FaS cOXQDK+fxJQjBVDRQZR9QfZsK+D774KOedhTt7SGCgHUzeuVJ/7y5huDVm8AywrV KENwxLK//QCdp/Qkv+7VcdQsE8ZKflsCyZygV76N+o8pRy5kAWE9FVxYyerrDIae g5oblZ4f1aNzokydKse77PQilfbyTl79IkFFVlA9QPUrqyO0Eg7zIXsuy0fr8n1y FTqi0TfhnTr+3ZMgotOIxGmqXP1tZTTxfzfRAE3bKR5a/pRJyFl3o03yqP9UTupG rvncYrrRPZlTYo3eGoaUMMZRAeb+foG8E+TnchtZKOj2eUSWF/B3jg7s+w6Ybxox N0bTO7A7VHHHx7Q9T0572Jg55POvhinRiCH+4IG/PZiqEo2SoLPUFyg+Q+spGqFs oJb0iSTN3jIlJrctzODj+FMOII3BIfpCSyUlMp3r4ywHfWL2gBCb/6D6z0m4bG70 U3yBx1iGDOKfgI2MNdVJ3P+YWNRNFezCtn4j7XGTk9f9hObRAPmVvd/sUdYUepOc /itNfQzI3rp5fsKlfXyWYWpb9GRO8mQuyCkx/oA8DpJSPXFbCq9N+kcP/ksg/ybR judcBSll0iRLJIs0laDI =OU8j -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 03:16:01 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 08:16:01 +0000 Received: from localhost ([127.0.0.1]:58208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQtc1-0002zw-5y for submit@debbugs.gnu.org; Thu, 26 Feb 2015 03:16:01 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:37203) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQtbz-0002zi-83 for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 03:16:00 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id A2B72A6000A; Thu, 26 Feb 2015 00:15:52 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sTGu2Xy9Tvnd; Thu, 26 Feb 2015 00:15:52 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 3BD36A60001; Thu, 26 Feb 2015 00:15:52 -0800 (PST) Message-ID: <54EED638.8070604@cs.ucla.edu> Date: Thu, 26 Feb 2015 00:15:52 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ashish SHUKLA Subject: Re: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> In-Reply-To: <86sidta5ak.fsf@chateau.d.if> Content-Type: multipart/mixed; boundary="------------000908060007030906080109" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------000908060007030906080109 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Ashish SHUKLA wrote: > When I looked into this before filing this bug report, from what I noticed > that it's not using libc's `mktime' function, unlike what you seem to > indicate. I'm not sure quite why it's doing that when libc provided mktime > works just fine It may work for this example, but 'configure' checks for a number of mktime bugs, and perhaps mktime is not working for some other examples. Is 'configure' setting APPLE_UNIVERSAL_BUILD to 1, or to 0? You can tell by looking for APPLE_UNIVERSAL_BUILD in lib/Makefile. When 'configure' says 'checking for working mktime', what's the result? If you compile and run the attached program, using the same flags that you use to build Emacs, what is its exit status? --------------000908060007030906080109 Content-Type: text/x-csrc; name="mktime-test.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mktime-test.c" #define HAVE_UNISTD_H 1 #define HAVE_DECL_ALARM 1 /* Test program from Paul Eggert and Tony Leneis. */ #include #include #include #ifdef HAVE_UNISTD_H # include #endif #if HAVE_DECL_ALARM # include #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static char *tz_strings[] = { (char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (int j) { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { int result = 0; time_t t, delta; int i, j; int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; int time_t_signed = ! ((time_t) 0 < (time_t) -1); #if HAVE_DECL_ALARM /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ signal (SIGALRM, SIG_DFL); alarm (60); #endif time_t_max = (! time_t_signed ? (time_t) -1 : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) * 2 + 1)); time_t_min = (! time_t_signed ? (time_t) 0 : time_t_signed_magnitude ? ~ (time_t) 0 : ~ time_t_max); delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv (tz_strings[i]); for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta) if (! mktime_test (t)) result |= 1; if ((result & 2) == 0 && ! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) result |= 2; for (j = 1; (result & 4) == 0; j <<= 1) { if (! bigtime_test (j)) result |= 4; if (INT_MAX / 2 < j) break; } if ((result & 8) == 0 && ! bigtime_test (INT_MAX)) result |= 8; } if (! irix_6_4_bug ()) result |= 16; if (! spring_forward_gap ()) result |= 32; if (! year_2050_test ()) result |= 64; return result; } --------------000908060007030906080109-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 03:40:09 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 08:40:09 +0000 Received: from localhost ([127.0.0.1]:58230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQtzM-0003cT-8W for submit@debbugs.gnu.org; Thu, 26 Feb 2015 03:40:09 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:38049) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQtzI-0003bp-50 for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 03:40:04 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 4C14CA6000A; Thu, 26 Feb 2015 00:39:58 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wuVRzlJ+aOj7; Thu, 26 Feb 2015 00:39:58 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 04560A60001; Thu, 26 Feb 2015 00:39:58 -0800 (PST) Message-ID: <54EEDBDD.9090009@cs.ucla.edu> Date: Thu, 26 Feb 2015 00:39:57 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ashish SHUKLA Subject: Re: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86zj8188s4.fsf@chateau.d.if> In-Reply-To: <86zj8188s4.fsf@chateau.d.if> Content-Type: multipart/mixed; boundary="------------090504060102010602080804" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------090504060102010602080804 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Ashish SHUKLA wrote: > I did this in X11 window (note the absence > of '-batch' option) > > --8<---------------cut here---------------start------------->8--- > emacs-25.0.50.20150206.5c9ad35f/src % ../src/emacs -Q -eval '(progn (setenv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))' > oldtz=(null) tz=XXX-0:00:00 oldTZ=(null) TZ=(null) 2015-02-15 06:42:44 -1 -> 2015-02-15 06:42:44 0 = 1423962764 This makes it look like immediately after set_time_zone_rule ("XXX-0:00:00") was called, getenv ("TZ") returned NULL. That shouldn't happen: set_time_zone_rule is supposed to arrange for TZ to have the specified value. Could you please try similar tests with the attached patch instead? It should tell us whether set_time_zone_rule is properly affecting the TZ environment variable. --------------090504060102010602080804 Content-Type: text/x-patch; name="getenv.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="getenv.patch" diff --git a/src/editfns.c b/src/editfns.c index dbcb316..4c542bd 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2359,6 +2359,11 @@ set_time_zone_rule (const char *tzstring) xputenv (tzval); } + char const *TZ = getenv ("TZ"); + fprintf (stderr, ("set_time_zone_rule (\"%s\"); " + "tzval = \"%s\"; getenv (\"TZ\") -> %s\n"), + tzstring ? tzstring : "(null)", tzval, TZ ? TZ : "(null)"); + #ifdef HAVE_TZSET tzset (); #endif --------------090504060102010602080804-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 08:42:42 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 13:42:42 +0000 Received: from localhost ([127.0.0.1]:58328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQyi9-0003xu-PF for submit@debbugs.gnu.org; Thu, 26 Feb 2015 08:42:42 -0500 Received: from b2bfep13.mx.upcmail.net ([62.179.121.58]:38757) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQyi7-0003xd-50 for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 08:42:40 -0500 Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep13.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150226134232.PXZJ20529.b2bfep13-int.chello.at@edge12.upcmail.net> for <19874@debbugs.gnu.org>; Thu, 26 Feb 2015 14:42:32 +0100 Received: from iznogoud.viz ([91.119.99.97]) by edge12.upcmail.net with edge id x1iW1p029264PVX0C1iX5M; Thu, 26 Feb 2015 14:42:32 +0100 X-SourceIP: 91.119.99.97 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YQyhy-0000Kt-K4; Thu, 26 Feb 2015 14:42:30 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> Date: Thu, 26 Feb 2015 14:42:30 +0100 In-Reply-To: <54EED638.8070604@cs.ucla.edu> (Paul Eggert's message of "Thu, 26 Feb 2015 00:15:52 -0800") Message-ID: <85385s94c9.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Thu, Feb 26 2015, Paul Eggert wrote: > Ashish SHUKLA wrote: >> When I looked into this before filing this bug report, from what I noticed >> that it's not using libc's `mktime' function, unlike what you seem to >> indicate. I'm not sure quite why it's doing that when libc provided mktime >> works just fine > > It may work for this example, but 'configure' checks for a number of > mktime bugs, and perhaps mktime is not working for some other > examples. Indeed, on amd64 time_t is a signed 64 bit type but something doesn't really support that. Adjusting time_t_max (and time_t_min) as if time_t were a 32 bit type makes the mktime test pass, so that seems to be a FreeBSD bug. diff --git a/m4/mktime.m4 b/m4/mktime.m4 index 3f0e1ee..af60ef8 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -181,7 +181,7 @@ main () time_t_max = (! time_t_signed ? (time_t) -1 - : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1) + : ((((time_t) 1 << (4 * CHAR_BIT - 2)) - 1) * 2 + 1)); time_t_min = (! time_t_signed ? (time_t) 0 > Is 'configure' setting APPLE_UNIVERSAL_BUILD to 1, or to 0? You can > tell by looking for APPLE_UNIVERSAL_BUILD in lib/Makefile. What has this to do with FreeBSD? > When 'configure' says 'checking for working mktime', what's the result? The test fails with exit status 3 (without the work-around above). Wolfgang From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 11:03:47 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 16:03:47 +0000 Received: from localhost ([127.0.0.1]:58863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR0ug-0007X9-KF for submit@debbugs.gnu.org; Thu, 26 Feb 2015 11:03:47 -0500 Received: from aloka.lostca.se ([178.63.46.202]:50046 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR0ud-0007Wt-Iw for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 11:03:44 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id EBB99F36; Thu, 26 Feb 2015 16:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=uDPlacNFyLLMmJaOC+J5n+RF5lo=; b=WZ2B THO0JzTrAMnXd2WvNY0xTDh4fW7EMriFxDF4x8wbeyiyJWjmeuLoQgUFENRR5p6K dmQGP663bNtODn7wctO5jed9vSwgKGJn+c+6+LGEHrsqgGLqlF71NYz8h/cO7h9K P3yP+rPDtvzZYFalVLaOA4HB8cHp0t+qXxrVFTc= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 497B2F35; Thu, 26 Feb 2015 16:03:41 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 5aef91bd; Thu, 26 Feb 2015 21:28:59 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Paul Eggert Subject: Re: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> <86zj8188s4.fsf@chateau.d.if> <54EEDBDD.9090009@cs.ucla.edu> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 9:21PM up 12 mins, 2 users, load averages: 0.17, 0.21, 0.17 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150226:19874@debbugs.gnu.org::PLARFZlwNeC8Ow7B:00000000000000000000000000000000000000003HEg X-Hashcash: 1:20:150226:eggert@cs.ucla.edu::3Slcs/jk+1aRJLo0:00000000000000000000000000000000000000000007Qd5 Date: Thu, 26 Feb 2015 21:28:55 +0530 In-Reply-To: <54EEDBDD.9090009@cs.ucla.edu> (Paul Eggert's message of "Thu, 26 Feb 2015 00:39:57 -0800") Message-ID: <86y4nkslz4.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, 26 Feb 2015 00:39:57 -0800, Paul Eggert said: | Ashish SHUKLA wrote: || I did this in X11 window (note the absence || of '-batch' option) ||=20 || --8<---------------cut here---------------start------------->8--- || emacs-25.0.50.20150206.5c9ad35f/src % ../src/emacs -Q -eval '(progn (set= env "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))' || oldtz=3D(null) tz=3DXXX-0:00:00 oldTZ=3D(null) TZ=3D(null) 2015-02-15 06= :42:44 -1 -> 2015-02-15 06:42:44 0 =3D 1423962764 | This makes it look like immediately after set_time_zone_rule | ("XXX-0:00:00") was called, getenv ("TZ") returned NULL. That | shouldn't happen: set_time_zone_rule is supposed to arrange for TZ to | have the specified value. | Could you please try similar tests with the attached patch instead? | It should tell us whether set_time_zone_rule is properly affecting the | TZ environment variable. | diff --git a/src/editfns.c b/src/editfns.c | index dbcb316..4c542bd 100644 | --- a/src/editfns.c | +++ b/src/editfns.c | @@ -2359,6 +2359,11 @@ set_time_zone_rule (const char *tzstring) | xputenv (tzval); | } =20 | + char const *TZ =3D getenv ("TZ"); | + fprintf (stderr, ("set_time_zone_rule (\"%s\"); " | + "tzval =3D \"%s\"; getenv (\"TZ\") -> %s\n"), | + tzstring ? tzstring : "(null)", tzval, TZ ? TZ : "(null)"); | + | #ifdef HAVE_TZSET | tzset (); | #endif There you go: =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ../src/emacs -Q -eval '(progn (setenv= "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))' set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -> (null) set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> (null) set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> (null) oldtz=3D(null) tz=3DXXX-0:00:00 oldTZ=3D(null) TZ=3D(null) 2015-02-15 06:42= :44 -1 -> set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -= > (null) 2015-02-15 06:42:44 0 =3D 1423962764^C =2D-8<---------------cut here---------------end--------------->8--- In minibuffer, "(21727 62092)" is displayed. And with "-batch": =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ../src/emacs -batch -Q -eval '(progn = (setenv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)= ))' set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -> (null) set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> XXX-0:00:00 oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:00= 2015-02-15 06:42:44 -1 -> set_time_zone_rule ("Asia/Kolkata"); tzval =3D "= TZ=3DAsia/Kolkata"; getenv ("TZ") -> Asia/Kolkata 2015-02-15 06:42:44 0 =3D 1423982564 (21728 16356) =2D-8<---------------cut here---------------end--------------->8--- Decided to explicitly set "TZ=3DAsia/Kolkata" in environment before invoking Emacs, and it seems like now getenv("TZ") is returning "Asia/Kolkata" everytime: =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % TZ=3DAsia/Kolkata ../src/emacs -Q -ev= al '(progn (setenv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 20= 15 0 nil 0)))' set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> Asia/Kolkata oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DAsia/Kolkat= a 2015-02-15 06:42:44 -1 -> set_time_zone_rule ("Asia/Kolkata"); tzval =3D = "TZ=3DAsia/Kolkata"; getenv ("TZ") -> Asia/Kolkata 2015-02-15 06:42:44 0 =3D 1423962764 =2D-8<---------------cut here---------------end--------------->8--- In minibuffer, "(21727 62092)" is displayed. And with "-batch": =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % TZ=3DAsia/Kolkata ../src/emacs -batch= -Q -eval '(progn (setenv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 = 15 2 2015 0 nil 0)))' set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> XXX-0:00:00 oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:00= 2015-02-15 06:42:44 -1 -> set_time_zone_rule ("Asia/Kolkata"); tzval =3D "= TZ=3DAsia/Kolkata"; getenv ("TZ") -> Asia/Kolkata 2015-02-15 06:42:44 0 =3D 1423982564 =2D-8<---------------cut here---------------end--------------->8--- Thanks! =2D-=20 Ashish SHUKLA =E2=80=9CThe mirror sees the man as beautiful, the mirror loves the man; an= other mirror sees the man as frightful and hates him; and it is always the same being who produces the impressions.=E2=80=9D (Marquis D. A. F. de Sade) Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU70K/AAoJEMdGz6nnT6SwbVsQAJHiz4IzcFGkcHSOBGe+TcLP 7DwZPXu8NqBsZo5/szq5GPhbtq8nOqAJHvlA3d4VDXDWxSiIVnRf9CxpFUIMqhKR 2Y8xByFU4jh0t+4YGxtYV2RL7gYdBymgHt0xGFGMcU50Y4Y4p/L7bBDqL+MLNXpD tmsUA8IG8r2X3kRO6XkmyEGIuz7m0vpgpET5wVLhz261GwlWnxIsfQ4pCFyvQn3P 1cUnrDZXPtTuBSLSjJancXKOBcDsv3vo+BUdHEVmI1twUPH4LPYwFpZs8sBWpI4h pA9SAHPyAenD8TeP69YEws2NNtjKKp/RMqQI10wU/z/NtEP6paZYStyv2egwpdAE d4ZheqKXSjjlLdomsbh2dMjrd65ellAcfINWxJsXmErE3zLoBCxzzTtFZBEeU+qF /eiQ9Ircic9DqdGTF/49SsqltcheiLfeCls9ucJ9S8dK/j69bwNPeYxrbeffocn6 HQmcMKZG9IPL/6MYGanwSvP8mT3Ygree574S4h1FN8wmgNaFTqMSa3hz53+pfXu1 FlleyClkPJgJE3T1rX7z0L7RI5GbnY7LN7raCQqqHMq5eGBPleKCCWmXdwLS0crA hg3HTxFV7HpMb23bB9HsDkC5b7kz7pt61orNdIJGKnbIK5jBL5qFmMmQwLa81KOR llERl210TnziKTGeRVyf =Yisz -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 11:03:47 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 16:03:47 +0000 Received: from localhost ([127.0.0.1]:58865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR0uh-0007XB-8w for submit@debbugs.gnu.org; Thu, 26 Feb 2015 11:03:47 -0500 Received: from aloka.lostca.se ([178.63.46.202]:15552 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR0ue-0007Ww-So for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 11:03:45 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id 04AF1F38; Thu, 26 Feb 2015 16:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=olhu7rbAuUCJWgDGdlwfmL/XlUk=; b=LA/H Z158/JI6ZhThtXQafuIqjPcu4P0vI76jOoriNIQDIJnJNxELQ+gx8KMq78HIQfNu AW1zZ41fvwA80d3NaZAc5LiSwPH8u2tqo2YFOc7o/7bEg86KI65X4CA4YsirrHnC wwJWSEQHYwl3+xuStGpjUjauqcuntbeW8mzQZIw= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 58A85F37; Thu, 26 Feb 2015 16:03:43 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 8e849252; Thu, 26 Feb 2015 21:33:18 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Paul Eggert Subject: Re: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 9:29PM up 20 mins, 2 users, load averages: 0.14, 0.15, 0.15 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150226:eggert@cs.ucla.edu::XkMk17hXKfnVmv8l:00000000000000000000000000000000000000000000Y+p X-Hashcash: 1:20:150226:19874@debbugs.gnu.org::FqVTEk6tTd0ESGVu:00000000000000000000000000000000000000002OX+ Date: Thu, 26 Feb 2015 21:33:17 +0530 In-Reply-To: <54EED638.8070604@cs.ucla.edu> (Paul Eggert's message of "Thu, 26 Feb 2015 00:15:52 -0800") Message-ID: <86twy8slru.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, 26 Feb 2015 00:15:52 -0800, Paul Eggert said: | Ashish SHUKLA wrote: || When I looked into this before filing this bug report, from what I notic= ed || that it's not using libc's `mktime' function, unlike what you seem to || indicate. I'm not sure quite why it's doing that when libc provided mkti= me || works just fine | It may work for this example, but 'configure' checks for a number of | mktime bugs, and perhaps mktime is not working for some other | examples. | Is 'configure' setting APPLE_UNIVERSAL_BUILD to 1, or to 0? You can | tell by looking for APPLE_UNIVERSAL_BUILD in lib/Makefile. =2D-8<---------------cut here---------------start------------->8--- % fgrep APPLE_UNIVERSAL lib/Makefile APPLE_UNIVERSAL_BUILD =3D 0 ## -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g'= \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g'= \ # -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g'= \ =2D-8<---------------cut here---------------end--------------->8--- | When 'configure' says 'checking for working mktime', what's the result? =2D-8<---------------cut here---------------start------------->8--- configure:25619: checking for working mktime configure:25827: clang -o conftest -g -march=3Dcorei7 -g -fstack-protector= -fno-strict-aliasing -I/usr/local/include -L/usr/local/lib -Wl,-rpath= =3D/usr/local/lib -ltinfo -fstack-protector -L/usr/local/lib con ftest.c >&5=20 configure:25827: $? =3D 0 configure:25827: ./conftest configure:25827: $? =3D 3 configure: program exited with status 3 =2D-8<---------------cut here---------------end--------------->8--- | If you compile and run the attached program, using the same flags that | you use to build Emacs, what is its exit status? =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % clang -o /tmp/mktime-test -g -march= =3Dcorei7 -g -fstack-protector -fno-strict-aliasing -I/usr/local/include= -L/usr/local/lib -Wl,-rpath=3D/usr/local/lib -ltinfo -fstack-protector -L= /usr/local/lib /tmp/mktime-test.c emacs-25.0.50.20150206.5c9ad35f/src % /tmp/mktime-test=20 emacs-25.0.50.20150206.5c9ad35f/src % echo $? 3 =2D-8<---------------cut here---------------end--------------->8--- Thanks! =2D-=20 Ashish SHUKLA =E2=80=9CThe only things certain in life are death, taxes, and accidentally= deleted data.=E2=80=9D (bazza) Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU70PGAAoJEMdGz6nnT6Sw1CwP/jRiZCLN69hDpVONaxhyW4fL qa7gE9X9FG0y8yx00bAeJgbUGh3CyOKmXMSflh46ETDxPTQf65RuJgJJF16EZzM3 APAXrqzE5l7fBEDJLVWhMjlHVJ4OAxmhvnA+SxpOq0sMe1qTmkl2XxB0Q6l2Wicm NABPKdtKEw1rYZhgxLCIRpFwiKqtMYU89z/eFDGYhHebZKGf6Wrt1KxCIm8qnS9d LFgiYCkMjSGFJrfCTdaSpJx5D46OcjH6I8BEz2x/sWJdA8xN7WBirtCE7SpmfLbD UvYFZpTz5/sFv7wNbE33tC3iJfUrtHJgcRv9fGEP6wTm5PAvlqqHi2bTv3mXU0Yt foaiiXT1y3PFm4TCby0iNSAudukLMw6pymJsG+uXvB1PHlCA8+1FkgpdzLjOQdj7 7boibfwEGSo+VGJaC7nm/xo1ZiiRCq3WD7CFJcihOR3u6xzliPIOkntBYm9SS6YN eGkJoj/WcZhLx9CLGh4AO1/4/1XbM83o+wsjbTya/8wUTpXIUaaMLSUYlYY2/Zva rccPvr7uEraFq8bIZpw8th7OZNAHgPP9OKLIXq6nshtsMw+Ydybo6U6omCd4WN8q S5g+8ZFc6KqQNnYvR9aBFNJyYIDUdrPOPxo61HamOhpRQVbncsW3oghA751ISxGP oK2elgv75wO/PqFyD0zQ =ERkB -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 12:36:16 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 17:36:16 +0000 Received: from localhost ([127.0.0.1]:58891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR2MC-0001EM-6T for submit@debbugs.gnu.org; Thu, 26 Feb 2015 12:36:16 -0500 Received: from b2bfep11.mx.upcmail.net ([62.179.121.56]:41360) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR2M9-0001E7-Nj for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 12:36:14 -0500 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep11.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150226173606.QPKJ22355.b2bfep11-int.chello.at@edge11.upcmail.net> for <19874@debbugs.gnu.org>; Thu, 26 Feb 2015 18:36:06 +0100 Received: from iznogoud.viz ([91.119.99.97]) by edge11.upcmail.net with edge id x5c51p01a264PVX0B5c6v1; Thu, 26 Feb 2015 18:36:06 +0100 X-SourceIP: 91.119.99.97 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YR2M1-0000Vf-OE; Thu, 26 Feb 2015 18:36:05 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> Date: Thu, 26 Feb 2015 18:36:05 +0100 In-Reply-To: <85385s94c9.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Thu, 26 Feb 2015 14:42:30 +0100") Message-ID: <854mq87eyi.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Thu, Feb 26 2015, Wolfgang Jenkner wrote: > Indeed, on amd64 time_t is a signed 64 bit type but something doesn't > really support that. Adjusting time_t_max (and time_t_min) as if time_t > were a 32 bit type makes the mktime test pass, so that seems to be > a FreeBSD bug. Sigh. It's localtime that is broken: It doesn't return a NULL pointer (nor sets it errno) when the tm_year field (an int) can't hold the result. Hence mktime_test1 doesn't return 1 in this case. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=145341 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 12:58:50 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 17:58:50 +0000 Received: from localhost ([127.0.0.1]:58906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR2i2-0001kR-8n for submit@debbugs.gnu.org; Thu, 26 Feb 2015 12:58:50 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:58826) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR2i0-0001kB-1g for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 12:58:49 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 87085A6000C; Thu, 26 Feb 2015 09:58:41 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F13fwyfksIQX; Thu, 26 Feb 2015 09:58:41 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 35A3BA6000A; Thu, 26 Feb 2015 09:58:41 -0800 (PST) Message-ID: <54EF5ECD.2030909@cs.ucla.edu> Date: Thu, 26 Feb 2015 09:58:37 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> In-Reply-To: <85385s94c9.fsf@iznogoud.viz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 02/26/2015 05:42 AM, Wolfgang Jenkner wrote: >> Is 'configure' setting APPLE_UNIVERSAL_BUILD to 1, or to 0? You can >> >tell by looking for APPLE_UNIVERSAL_BUILD in lib/Makefile. > What has this to do with FreeBSD? > If 'configure' mistakenly set APPLE_UNIVERSAL_BUILD to 1, it would cause 'configure' to guess that mktime was buggy, and I was worried that this would have caused the problem. However, this was a red herring, as you've established that FreeBSD localtime and/or mktime is indeed buggy in this area, so 'configure' appears to be doing the right thing in rejecting FreeBSD mktime. It also appears to be the case that FreeBSD 10.1's implementation of putenv is buggy, and that this is what is breaking Emacs's time code (as Emacs uses putenv to modify the TZ environment variable), but we haven't gotten to the bottom of that yet. I'll try to write a little test program to narrow it down. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 14:00:30 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 19:00:30 +0000 Received: from localhost ([127.0.0.1]:58949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR3fi-0003DR-1o for submit@debbugs.gnu.org; Thu, 26 Feb 2015 14:00:30 -0500 Received: from b2bfep14.mx.upcmail.net ([62.179.121.59]:60820) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR3fe-0003D9-3E for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 14:00:27 -0500 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep14.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150226190019.MWHX11972.b2bfep14-int.chello.at@edge11.upcmail.net> for <19874@debbugs.gnu.org>; Thu, 26 Feb 2015 20:00:19 +0100 Received: from iznogoud.viz ([91.119.99.97]) by edge11.upcmail.net with edge id x70J1p00c264PVX0B70JeC; Thu, 26 Feb 2015 20:00:19 +0100 X-SourceIP: 91.119.99.97 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YR3fW-0000Yf-DJ; Thu, 26 Feb 2015 20:00:18 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> Date: Thu, 26 Feb 2015 20:00:18 +0100 Message-ID: <85mw405whp.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Thu, Feb 26 2015, Paul Eggert wrote: > On 02/26/2015 05:42 AM, Wolfgang Jenkner wrote: >>> Is 'configure' setting APPLE_UNIVERSAL_BUILD to 1, or to 0? You can >>> >tell by looking for APPLE_UNIVERSAL_BUILD in lib/Makefile. >> What has this to do with FreeBSD? >> > > If 'configure' mistakenly set APPLE_UNIVERSAL_BUILD to 1, it would > cause 'configure' to guess that mktime was buggy, and I was worried > that this would have caused the problem. However, this was a red > herring, as you've established that FreeBSD localtime and/or mktime is > indeed buggy in this area, so 'configure' appears to be doing the > right thing in rejecting FreeBSD mktime. Thanks for the explanation! However, there's no indication that mktime is buggy (all tests pass when adjusting time_t_min, time_t_max), while localtime (and localtime_r) certainly is. Nevertheless, the configure test causes mktime to be replaced but not localtime_r, which is actually used in emacs. If I may say so this seems a bit like pulling the wrong tooth ;-) > It also appears to be the case that FreeBSD 10.1's implementation of > putenv is buggy, and that this is what is breaking Emacs's time code > (as Emacs uses putenv to modify the TZ environment variable), but we > haven't gotten to the bottom of that yet. I'll try to write a little > test program to narrow it down. But putenv is already replaced on my 10-STABLE system (and emacs trunk): $ nm src/emacs | grep putenv 00000000005b85a0 T rpl_putenv 0000000000527150 T xputenv Ah, and the OP's example actually seems to give the expected result here (my timezone is Europe/Vienna): (encode-time 44 42 6 15 2 2015 0 nil 0) => (21728 16356) From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 14:44:50 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 19:44:50 +0000 Received: from localhost ([127.0.0.1]:58972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR4Mc-0004DK-Bg for submit@debbugs.gnu.org; Thu, 26 Feb 2015 14:44:50 -0500 Received: from aloka.lostca.se ([178.63.46.202]:65439 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR4Ma-0004DC-Fq for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 14:44:49 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id 2A9DB38A; Thu, 26 Feb 2015 19:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=DNbwzxZPafOKbzrFoI4PUeP6wLY=; b=UH6i a9aw03+DtacZ7/uL1LYyJ5VaFNdjW0MuGYDX+40zWgr6+XiflrdqfTdIDTaeDBWg TNZ27J976UQutF7ZdyiXGIfgMaF7BXigfjsKVkrCyue3oU3WzAw6e+6RATKOfrAz mreUD4VSkwfZCeOOhYFv2x14/1uGr28u5p01eaY= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 11972389; Thu, 26 Feb 2015 19:44:45 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id cd1b3295; Fri, 27 Feb 2015 01:14:42 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 1:13AM up 4:04, 11 users, load averages: 0.10, 0.13, 0.11 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150226:19874@debbugs.gnu.org::LTCVHUJi6bMvdQAK:0000000000000000000000000000000000000000121/ X-Hashcash: 1:20:150226:wjenkner@inode.at::kz9FQeG5gHdoPmVy:000000000000000000000000000000000000000000000PAq X-Hashcash: 1:20:150226:eggert@cs.ucla.edu::1IPrrOOUv2W2MZpV:00000000000000000000000000000000000000000004aqj Date: Fri, 27 Feb 2015 01:14:38 +0530 In-Reply-To: <85mw405whp.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Thu, 26 Feb 2015 20:00:18 +0100") Message-ID: <86a900sbix.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Paul Eggert , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, 26 Feb 2015 20:00:18 +0100, Wolfgang Jenkner sa= id: | On Thu, Feb 26 2015, Paul Eggert wrote: || On 02/26/2015 05:42 AM, Wolfgang Jenkner wrote: |||| Is 'configure' setting APPLE_UNIVERSAL_BUILD to 1, or to 0? You can |||| >tell by looking for APPLE_UNIVERSAL_BUILD in lib/Makefile. ||| What has this to do with FreeBSD? |||=20 ||=20 || If 'configure' mistakenly set APPLE_UNIVERSAL_BUILD to 1, it would || cause 'configure' to guess that mktime was buggy, and I was worried || that this would have caused the problem. However, this was a red || herring, as you've established that FreeBSD localtime and/or mktime is || indeed buggy in this area, so 'configure' appears to be doing the || right thing in rejecting FreeBSD mktime. [...] | Ah, and the OP's example actually seems to give the expected result here | (my timezone is Europe/Vienna): | (encode-time 44 42 6 15 2 2015 0 nil 0) | =3D> (21728 16356) In interactive mode ? In interactive-mode it's broken for me, in batch mode= it works fine. =2D-=20 Ashish SHUKLA =E2=80=9CThe English have no respect for their language, and will not teach= their children to speak it.=E2=80=9D (George Bernard Shaw, "Pygmalion", 1912) Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU73enAAoJEMdGz6nnT6SwhhEP/3hgWpQpeE2e364oIU5whXtT H1gSn5gQ01fi7mwwB3oEh/tB4Fcx1fSKAcVjEEjYhXduO7gRYmtYGv7zKJQUhpw5 5njCXZg95ijHrQLluUl7bOL63ise9VxxclVFM/KlnhEgNuQTWTMUQ/3GiuxoDLcr QUp+mY4vwOinR4AqL7kdfj8zTc3fTxVSm+llHZyCnFIeuognFc/U+3y6Svp6KBJP jPVvkog4nJEGKm2CjxmbvepNxw5yjik0IGxoVSucu5Zwi3fCTPwtSDaOR23JR9Zc qwV9xflABPLieMMQ6sNh+kZ8l154t16YXGb4PaN82d+FDb1MNegjaXsiC2nlnRR2 uAPDjtE0YQlV1Wet3KIb2iUSBZeTmSYkjMuSxlgY/zmjIQEorlz3iI471L+oxjKZ Cy+ofb4irqqHPtds8ANbcWKMb6cmViPBBKVHRxwij0DRz9DrT8vVVBT8oh9sgylO MsiZlPP50hFhNkSDv6KgZ+d9H+ZGqUiVtkqs8kXAY4AUCpTeyFg6c/DaVfL8XVt9 oQQ6raFl12riCVSaFqP07HB6zyMYyb4HJsGpJmcb17cISu4ZFqiJ4qAGNZKHtETb Bkip4IW//Q9NHxouJ23wxuXZY/7uY8ZSFMKDZwjZUctNMOStX8rA5S+f9f39hZzo aitTF4uS+1lwEiyrKkBL =Y1+2 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 15:06:13 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 20:06:13 +0000 Received: from localhost ([127.0.0.1]:58976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR4hJ-0004i8-7c for submit@debbugs.gnu.org; Thu, 26 Feb 2015 15:06:13 -0500 Received: from b2bfep16.mx.upcmail.net ([62.179.121.61]:36417) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR4hG-0004hs-IG for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 15:06:11 -0500 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep16.mx.upcmail.net (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150226200553.BNWX14049.b2bfep16-int.chello.at@edge11.upcmail.net> for <19874@debbugs.gnu.org>; Thu, 26 Feb 2015 21:05:53 +0100 Received: from iznogoud.viz ([91.119.99.97]) by edge11.upcmail.net with edge id x85s1p015264PVX0B85sy3; Thu, 26 Feb 2015 21:05:53 +0100 X-SourceIP: 91.119.99.97 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YR4gy-0000bJ-Ka; Thu, 26 Feb 2015 21:05:52 +0100 From: Wolfgang Jenkner To: ashish.is@lostca.se (Ashish SHUKLA) Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> Date: Thu, 26 Feb 2015 21:05:52 +0100 In-Reply-To: <86a900sbix.fsf@chateau.d.if> (Ashish SHUKLA's message of "Fri, 27 Feb 2015 01:14:38 +0530") Message-ID: <85ioeo5tgf.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Paul Eggert , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Fri, Feb 27 2015, Ashish SHUKLA wrote: > | (encode-time 44 42 6 15 2 2015 0 nil 0) > | => (21728 16356) > > In interactive mode ? In interactive-mode it's broken for me, in batch mode it > works fine. Yes, it gives the same result as above in both ways for me. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 16:47:30 2015 Received: (at 19874) by debbugs.gnu.org; 26 Feb 2015 21:47:30 +0000 Received: from localhost ([127.0.0.1]:59035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR6HJ-0008QW-MH for submit@debbugs.gnu.org; Thu, 26 Feb 2015 16:47:30 -0500 Received: from aloka.lostca.se ([178.63.46.202]:43111 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR6HH-0008QL-9C for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 16:47:28 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id B692A59C; Thu, 26 Feb 2015 21:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=MmCRxBADXsl5yK/8BGUxhn8ybqU=; b=Md6+ K+iYsBaF6QiNT4qVAXsS42FmjB0ELy7mGjuKrTV/FNa4HAK2gfbPRgo8LlzR9w9U JFWdlyRF/7Fk7CuWsuiuI5TOSHP8+85+PKOvPEo0PaCYR9wHYlXdoTOVG+JDTJoj V7Hj2JBfdbYhIZvwLO4paq0/Z3gFaGEL8aNbYKU= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id C665E59B; Thu, 26 Feb 2015 21:47:24 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 40b3e213; Fri, 27 Feb 2015 03:17:20 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 3:13AM up 6:03, 8 users, load averages: 0.05, 0.10, 0.12 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150226:19874@debbugs.gnu.org::Mv+zCAtEYa5N5Qhz:00000000000000000000000000000000000000000aAS X-Hashcash: 1:20:150226:eggert@cs.ucla.edu::xpDppFfw/jK1sNqS:00000000000000000000000000000000000000000006S0B X-Hashcash: 1:20:150226:wjenkner@inode.at::bSLauQUi+TqY9xoZ:000000000000000000000000000000000000000000006uAF Date: Fri, 27 Feb 2015 03:17:17 +0530 In-Reply-To: <85ioeo5tgf.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Thu, 26 Feb 2015 21:05:52 +0100") Message-ID: <8661aos5ui.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Paul Eggert , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, 26 Feb 2015 21:05:52 +0100, Wolfgang Jenkner sa= id: | On Fri, Feb 27 2015, Ashish SHUKLA wrote: || | (encode-time 44 42 6 15 2 2015 0 nil 0) || | =3D> (21728 16356) ||=20 || In interactive mode ? In interactive-mode it's broken for me, in batch m= ode it || works fine. | Yes, it gives the same result as above in both ways for me. Very strange. FTR, following is output of `uname -a`: FreeBSD chateau.d.if 10.1-RELEASE-p6 FreeBSD 10.1-RELEASE-p6 #0 r279268: We= d Feb 25 12:37:13 IST 2015 root@chateau.d.if:/wrksrc/usr/src/sys/CHATEA= U amd64 and /etc/localtime points to the file in /usr/share/zoneinfo, and no TZ environment variable is set, in my case. Do you have TZ environment variable set, or you use /etc/localtime ? And al= so are you on FreeBSD 10.1/amd64 as well ? Thanks! =2D-=20 Ashish SHUKLA =E2=80=9CNow I=E2=80=99ve only been an OpenBSD developer for 11 years, one = year less than this header has existed, but in that brief time, I=E2=80=99ve learned a thing or= two about deleting obsolete code. It doesn=E2=80=99t delete itself. And worse, people= will continue using it until you force them onto a better path.=E2=80=9D (Ted Un= angst, OpenBSD) Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU75RlAAoJEMdGz6nnT6SwnLcP/izLe+buR1DfDMGeJ9iylN8d qthY9Kg0f53faiImKLPj12Ai4vhB4sZoa666oSxobVj9hZeIBHG+QnJsM2dTGcQ3 sT2lLB+q2LiD23h4GKYNq4EuoDjqw9S5i5Vyn5FaOgwA3Sl5Y8SPVNt7DR+Hg1mi Y1/XCRgcuAb0PdQ/JqvM2E/GL3UQf1FnoxUtNEtoJykibxyAgiM9jGoMV4EQO/mI 3cDGrW+8+RMuSExi/xuD7MeRN+EihUA69tCf+ERTaakiSJV1Jfria7e4K8EmdyTS 1UIc2Wjc5b8SavUyziGG6J1CmAp3armZLEycwRE/RUZJQCn/zUdVY08A3htRfgCM wtQa2VCjYbrvVnVSh8KmdzkvohceATCKBCl5N2GKFOYCiyQ18VAkPZan9ZYYyS9S XAvae6Hof193n9qeasHGJ0u/cMTCHIdU9iL297SHA3CI1AcQuFQN4wEeMziYm2ec oC/dSqOHeMj2GOowrMov7b1Ya9gtrlkxC+xi6R45sBXQ1E24MUwzCSzm9qFRSJO9 YqKT9pfuQOtbBSFnnCZH4y2Obf3P2cyoGYUJrZ9XN91pVoIRSYsHMkuk3jVwaY1g V3d8rsaVWQlUhMGqaSIxp2xjxSbaG3/7XvxsBckAE407HJ+7bDCFF6Pq2t+TMW+y aHaEtS1Zpqfw+cyx5T0S =sBgw -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 19:16:26 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 00:16:26 +0000 Received: from localhost ([127.0.0.1]:59076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR8bR-0006BC-Qb for submit@debbugs.gnu.org; Thu, 26 Feb 2015 19:16:26 -0500 Received: from b2bfep15.mx.upcmail.net ([62.179.121.60]:56509) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YR8bO-0006Ax-Sa for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 19:16:24 -0500 Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep15.mx.upcmail.net (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150227001616.CNUK25126.b2bfep15-int.chello.at@edge12.upcmail.net> for <19874@debbugs.gnu.org>; Fri, 27 Feb 2015 01:16:16 +0100 Received: from iznogoud.viz ([91.119.99.97]) by edge12.upcmail.net with edge id xCGF1p00j264PVX0CCGFPX; Fri, 27 Feb 2015 01:16:16 +0100 X-SourceIP: 91.119.99.97 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YR8bH-0000uF-AH; Fri, 27 Feb 2015 01:16:15 +0100 From: Wolfgang Jenkner To: ashish.is@lostca.se (Ashish SHUKLA) Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> Date: Fri, 27 Feb 2015 01:16:15 +0100 In-Reply-To: <8661aos5ui.fsf@chateau.d.if> (Ashish SHUKLA's message of "Fri, 27 Feb 2015 03:17:17 +0530") Message-ID: <85lhjkryy8.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Paul Eggert , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Fri, Feb 27 2015, Ashish SHUKLA wrote: > On Thu, 26 Feb 2015 21:05:52 +0100, Wolfgang Jenkner said: > | On Fri, Feb 27 2015, Ashish SHUKLA wrote: > > || | (encode-time 44 42 6 15 2 2015 0 nil 0) > || | => (21728 16356) > || > || In interactive mode ? In interactive-mode it's broken for me, in batch mode it > || works fine. > > | Yes, it gives the same result as above in both ways for me. > > Very strange. FTR, following is output of `uname -a`: > > FreeBSD chateau.d.if 10.1-RELEASE-p6 FreeBSD 10.1-RELEASE-p6 #0 r279268: Wed Feb 25 12:37:13 IST 2015 root@chateau.d.if:/wrksrc/usr/src/sys/CHATEAU amd64 My 10-STABLE version is actually a month or so older than 10.1-RELEASE (which was announced on 14 Nov 2014): FreeBSD iznogoud.viz 10.1-RC1 FreeBSD 10.1-RC1 #0 r272822M: Thu Oct 9 19:45:54 CEST 2014 adm@iznogoud.viz:/usr/obj/usr/src/sys/IZNOGOUD amd64 Here's the output of `svn info' (I haven't updated since I compiled base and kernel): Path: . Working Copy Root Path: /usr/src URL: svn://svn0.eu.freebsd.org/base/stable/10 Relative URL: ^/stable/10 Repository Root: svn://svn0.eu.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 272822 Node Kind: directory Schedule: normal Last Changed Author: mav Last Changed Rev: 272798 Last Changed Date: 2014-10-09 07:28:11 +0200 (Thu, 09 Oct 2014) > and /etc/localtime points to the file in /usr/share/zoneinfo, and no TZ > environment variable is set, in my case. In my case, /etc/localtime is a copy of the file in /usr/share/zoneinfo. IIUC, `mergemaster -i' is supposed to automatically run `tzsetup -r' to update /etc/localtime from /var/db/zoneinfo. I have no TZ in the environment. $ ls -li /etc/localtime /usr/share/zoneinfo/Europe/Vienna 211986 -r--r--r-- 1 root wheel 2211 Oct 9 20:42 /etc/localtime 7892691 -r--r--r-- 1 root wheel 2211 Oct 9 20:36 /usr/share/zoneinfo/Europe/Vienna $ cmp /etc/localtime /usr/share/zoneinfo/Europe/Vienna $ echo $? 0 $ cat /var/db/zoneinfo Europe/Vienna $ printenv | grep TZ $ echo $? 1 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 21:51:12 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 02:51:12 +0000 Received: from localhost ([127.0.0.1]:59094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRB1D-0001F6-KQ for submit@debbugs.gnu.org; Thu, 26 Feb 2015 21:51:11 -0500 Received: from b2bfep13.mx.upcmail.net ([62.179.121.58]:42041) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRB1A-0001Eo-7V for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 21:51:09 -0500 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep13.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150227025101.XUCS20529.b2bfep13-int.chello.at@edge11.upcmail.net> for <19874@debbugs.gnu.org>; Fri, 27 Feb 2015 03:51:01 +0100 Received: from iznogoud.viz ([91.119.99.97]) by edge11.upcmail.net with edge id xEr01p00Y264PVX0BEr1Kv; Fri, 27 Feb 2015 03:51:01 +0100 X-SourceIP: 91.119.99.97 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YRB12-0004qa-KC; Fri, 27 Feb 2015 03:51:00 +0100 From: Wolfgang Jenkner To: ashish.is@lostca.se (Ashish SHUKLA) Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> Date: Fri, 27 Feb 2015 03:51:00 +0100 In-Reply-To: <8661aos5ui.fsf@chateau.d.if> (Ashish SHUKLA's message of "Fri, 27 Feb 2015 03:17:17 +0530") Message-ID: <85h9u8rrsb.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Paul Eggert , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Fri, Feb 27 2015, Ashish SHUKLA wrote: > Very strange. Looking at the configure options from your original report I notice that another difference (apart from the somewhat different FreeBSD 10 revisions) is that I don't compile emacs with gconf, gsettings, dbus or gtk3. I wonder if the bug is still present in, say, a minimally built emacs with X support, viz., ./configure --without-all --with-x --with-x-toolkit=no From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 26 23:59:23 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 04:59:23 +0000 Received: from localhost ([127.0.0.1]:59165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRD1G-00048A-Q5 for submit@debbugs.gnu.org; Thu, 26 Feb 2015 23:59:23 -0500 Received: from aloka.lostca.se ([178.63.46.202]:28991 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRD1D-000481-QN for 19874@debbugs.gnu.org; Thu, 26 Feb 2015 23:59:20 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id EACD5ACE; Fri, 27 Feb 2015 04:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=CFt9LyYNSPxCY1Yxl1jnFY017RE=; b=vUlZ tc6puXoyta6tk/BfTy8X788uQnJ5Yd5vqVBAyd7o/qgN3PhTjPFv9lm29Cs0LI+q FXXRjX6VRQgB+a9M9CgqBQBWK3bFcKImmdWAVzhDZQf4MrQGcE5S4grgzmHolJ/H lp5Ju3HC24k8x2QMZKEHQ9KB406XH1+1eQeh0So= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 19C1FACD; Fri, 27 Feb 2015 04:59:15 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 4c8a5e46; Fri, 27 Feb 2015 10:29:11 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 10:15AM up 13:06, 13 users, load averages: 0.18, 0.41, 0.45 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150227:wjenkner@inode.at::+lhqIFxV9h0g33IJ:000000000000000000000000000000000000000000001nbq X-Hashcash: 1:20:150227:19874@debbugs.gnu.org::aYLnaT9E+s8sk2hy:00000000000000000000000000000000000000003umi X-Hashcash: 1:20:150227:eggert@cs.ucla.edu::3Pu1ZOtylwRGmVsn:00000000000000000000000000000000000000000003pZX Date: Fri, 27 Feb 2015 10:29:07 +0530 In-Reply-To: <85h9u8rrsb.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Fri, 27 Feb 2015 03:51:00 +0100") Message-ID: <864mq8ar1g.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Paul Eggert , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, 27 Feb 2015 03:51:00 +0100, Wolfgang Jenkner sa= id: | On Fri, Feb 27 2015, Ashish SHUKLA wrote: || Very strange. | Looking at the configure options from your original report I notice that | another difference (apart from the somewhat different FreeBSD 10 | revisions) is that I don't compile emacs with gconf, gsettings, dbus or | gtk3. I wonder if the bug is still present in, say, a minimally built | emacs with X support, viz., | ./configure --without-all --with-x --with-x-toolkit=3Dno So, looks like you're right it only happens with X11 (Gtk3) build, and if I invoke Emacs in '-nw', or with Xaw front-end, it does not happen as evident From=20following tests: Emacs in batch mode: =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ./emacs -Q -batch -eval '(progn (sete= nv "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))'= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -> (null) set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> XXX-0:00:00 oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:00= 2015-02-15 06:42:44 -1 -> set_time_zone_rule ("Asia/Kolkata"); tzval =3D "= TZ=3DAsia/Kolkata"; getenv ("TZ") -> Asia/Kolkata 2015-02-15 06:42:44 0 =3D 1423982564 (21728 16356) =2D-8<---------------cut here---------------end--------------->8--- Emacs in interactive mode in curses: =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ./emacs -Q -nw -eval '(progn (setenv = "TZ" "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))' >/t= mp/foo.txt 2>&1 chateau.d.if!abbe:~/tinderbox/redports/editors/emacs-devel/work2/emacs-25.0= .50.20150206.5c9ad35f/src =CE=BB cat /tmp/foo.txt set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -> (null) set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> XXX-0:00:00 oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:00= 2015-02-15 06:42:44 -1 -> set_time_zone_rule ("Asia/Kolkata"); tzval =3D "= TZ=3DAsia/Kolkata"; getenv ("TZ") -> Asia/Kolkata 2015-02-15 06:42:44 0 =3D 1423982564 =2D-8<---------------cut here---------------end--------------->8--- Emacs in interactive mode in X11 (GTK3): =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ./emacs -Q -eval '(progn (setenv "TZ= " "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))'=20=20= =20=20=20=20=20=20 set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -> (null) set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> (null) set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> (null) oldtz=3D(null) tz=3DXXX-0:00:00 oldTZ=3D(null) TZ=3D(null) 2015-02-15 06:42= :44 -1 -> set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -= > (null) 2015-02-15 06:42:44 0 =3D 1423962764 =2D-8<---------------cut here---------------end--------------->8--- Emacs in interactive mode in X11 (Xaw) compiled with following ./configure = line: ./configure --localstatedir=3D/var --without-compress-install --without-dbu= s --with-file-notification=3Dgfile --without-gconf --without-gif --with-gnu= tls --without-gsettings --without-jpeg --without-m17n-flt --without-imagema= gick --without-libotf --without-png --without-toolkit-scroll-bars --without= -rsvg --without-tiff --with-x --without-xft --without-xim --with-xml2 --wit= hout-xpm --with-x-toolkit=3Dathena --without-xaw3d --with-sound=3Doss --x-l= ibraries=3D/usr/local/lib --x-includes=3D/usr/local/include --prefix=3D/usr= /local --mandir=3D/usr/local/man --infodir=3D/usr/local/share/emacs/info/ -= -build=3Damd64-portbld-freebsd10.1 =2D-8<---------------cut here---------------start------------->8--- emacs-25.0.50.20150206.5c9ad35f/src % ./emacs -Q -eval '(progn (setenv "TZ= " "Asia/Kolkata") (print (encode-time 44 42 6 15 2 2015 0 nil 0)))'=20=20= =20=20=20=20=20=20 set_time_zone_rule ("(null)"); tzval =3D "tZ=3D"; getenv ("TZ") -> (null) set_time_zone_rule ("Asia/Kolkata"); tzval =3D "TZ=3DAsia/Kolkata"; getenv = ("TZ") -> Asia/Kolkata set_time_zone_rule ("XXX-0:00:00"); tzval =3D "TZ=3DXXX-0:00:00"; getenv ("= TZ") -> XXX-0:00:00 oldtz=3DAsia/Kolkata tz=3DXXX-0:00:00 oldTZ=3DAsia/Kolkata TZ=3DXXX-0:00:00= 2015-02-15 06:42:44 -1 -> set_time_zone_rule ("Asia/Kolkata"); tzval =3D "= TZ=3DAsia/Kolkata"; getenv ("TZ") -> Asia/Kolkata 2015-02-15 06:42:44 0 =3D 1423982564 =2D-8<---------------cut here---------------end--------------->8--- HTH =2D-=20 Ashish SHUKLA contracts are no match for geniuses Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU7/mbAAoJEMdGz6nnT6Sw35sP/jGo/k88bQv36wMim3MMykYB VsDV0ktfWv1uCU9KGPEY7Ci2/5o/oLdxAllbK9jUHc5/yU3Pam3lDB2jbpugFM5N 9stOceeUO4Ys5gRk5TIGQia8N0n/Bor74ZYTOkqtLpaRAcjXzHT8Lj9pclIUbsu0 71QoEEPvHHpTepNkOqFiTw2TbYDp0p1hwWNokGADRD43JDmQv8yefTghQCmVGnFc XjKeilZXzKD1+YpyRG6pZRfVid2uhTKtwo3a+ArxFVsZhvuRtGqZO3z5pUOrhFHN xy9PQcR+NZnsu/Os98etl3J2hs/XIPpB+N3F5opx77cmkBoli7s7kVZcQ5s6tv5Q lNaVXq0cmNWQyW+IJ3Z/6LUotOrhGKqs7SfLIR/zXQebw23mW1VIkqhMYv4hiBBm 8GhID7QufYbfjN+PvaHWEd6OdxO5srtx27X5hDVA/PEh4XwHnOAonxEvo6tjozNV VEsSaUI302yrH7/L6Oy5PWj6Q+RvoQa9LjRp4ZYHy+qwTiWfxFSMyErPfxz8Zil9 wWYONbZSISFcI4rqg0QIsKtgzBuDETlSaMnRfkRbuMAX5luDgU6o2v/Oh+fzSK54 dpnubvBedQAMOxxEEGWHjUvTLJqhct3rQDsTIFz+lQw+T3ydLsZp82oHQfGtxPwh J0zNUrhuQb2wa3wye96Y =dMGe -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 00:13:53 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 05:13:54 +0000 Received: from localhost ([127.0.0.1]:59169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRDFJ-0004Tb-LC for submit@debbugs.gnu.org; Fri, 27 Feb 2015 00:13:53 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:58345) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRDFH-0004TO-FM for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 00:13:52 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 3099DA6001B; Thu, 26 Feb 2015 21:13:45 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LC-be+KDUBH6; Thu, 26 Feb 2015 21:13:44 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id CE7ABA60015; Thu, 26 Feb 2015 21:13:44 -0800 (PST) Message-ID: <54EFFD04.20304@cs.ucla.edu> Date: Thu, 26 Feb 2015 21:13:40 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ashish SHUKLA Subject: Re: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86zj8188s4.fsf@chateau.d.if> <54EEDBDD.9090009@cs.ucla.edu> <86y4nkslz4.fsf@chateau.d.if> In-Reply-To: <86y4nkslz4.fsf@chateau.d.if> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Ashish SHUKLA wrote: > set_time_zone_rule ("Asia/Kolkata"); tzval = "TZ=Asia/Kolkata"; getenv ("TZ") -> (null) This confirms that there's something wrong with set_time_zone_rule and/or getenv; the former is supposed to set the environment variable TZ to "Asia/Kolkata", but getenv ("TZ") returns NULL. Can you run GDB and see why getenv is failing there? From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 01:31:54 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 06:31:54 +0000 Received: from localhost ([127.0.0.1]:59200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRESm-0006Oe-JZ for submit@debbugs.gnu.org; Fri, 27 Feb 2015 01:31:53 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:60807) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRESi-0006OP-Sa for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 01:31:49 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 8DF88A60015; Thu, 26 Feb 2015 22:31:42 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p-DcDeiNbIjp; Thu, 26 Feb 2015 22:31:42 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 3F93439E801D; Thu, 26 Feb 2015 22:31:42 -0800 (PST) Message-ID: <54F00F4D.8010807@cs.ucla.edu> Date: Thu, 26 Feb 2015 22:31:41 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> In-Reply-To: <85mw405whp.fsf@iznogoud.viz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Wolfgang Jenkner wrote: > Thanks for the explanation! However, there's no indication that mktime > is buggy (all tests pass when adjusting time_t_min, time_t_max), while > localtime (and localtime_r) certainly is. Nevertheless, the configure > test causes mktime to be replaced but not localtime_r, which is actually > used in emacs. If I may say so this seems a bit like pulling the wrong > tooth ;-) I suppose we could make Gnulib smarter, so that it replaces some other function if it finds a particular bug in mktime, a bug that can be chalked up to localtime_r etc. However, the current approach is simpler to maintain and shouldn't hurt anything. Ashish's problem seems not to be in mktime at all (nor in its replacement). >> It also appears to be the case that FreeBSD 10.1's implementation of >> putenv is buggy, and that this is what is breaking Emacs's time code >> (as Emacs uses putenv to modify the TZ environment variable), but we >> haven't gotten to the bottom of that yet. I'll try to write a little >> test program to narrow it down. > > But putenv is already replaced on my 10-STABLE system (and emacs trunk): > > $ nm src/emacs | grep putenv > 00000000005b85a0 T rpl_putenv > 0000000000527150 T xputenv Yes, and that's because FreeBSD putenv is incompatible with GNU putenv; in GNU systems, putenv ("xxx") is equivalent to unsetenv ("xxx") but FreeBSD doesn't support this extension to POSIX. I don't know whether Emacs needs this extension, but it shouldn't hurt to have it. > Ah, and the OP's example actually seems to give the expected result here > (my timezone is Europe/Vienna): Yes. I can't reproduce the problem either. I finally got around to building a VM running FreeBSD 10.1 amd64, and I cannot reproduce the bug, even when /etc/localtime is a copy of /usr/share/zoneinfo/Asia/Kolkata and TZ is initially unset. However, I am running it in a text window, not under Gtk3. Perhaps Gtk3 is in some way interfering with Emacs's putenv substitute. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 01:38:40 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 06:38:40 +0000 Received: from localhost ([127.0.0.1]:59204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YREZL-0006YJ-Me for submit@debbugs.gnu.org; Fri, 27 Feb 2015 01:38:40 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:32809) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YREZK-0006Y6-5T for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 01:38:38 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 695B7A60015; Thu, 26 Feb 2015 22:38:32 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aW17J8knWnnB; Thu, 26 Feb 2015 22:38:32 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 20DA239E801D; Thu, 26 Feb 2015 22:38:32 -0800 (PST) Message-ID: <54F010E7.3040900@cs.ucla.edu> Date: Thu, 26 Feb 2015 22:38:31 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ashish SHUKLA , Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> In-Reply-To: <864mq8ar1g.fsf@chateau.d.if> Content-Type: multipart/mixed; boundary="------------030204090805040509070504" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------030204090805040509070504 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Ashish SHUKLA wrote: > So, looks like you're right it only happens with X11 (Gtk3) build Possibly the Gtk3 code calls 'setenv', and this collides with Emacs's implementation of putenv. Emacs's putenv implementation should be portable to any POSIX platform, but FreeBSD 10.1 getenv+setenv has a bug. The attached program should work on any POSIX platform, and it does work on GNU/Linux and on Solaris, but it doesn't work on FreeBSD 10.1. Emacs has similar code, which apparently also runs afoul of the FreeBSD bug. --------------030204090805040509070504 Content-Type: text/x-csrc; name="putenv-test.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="putenv-test.c" #include #include extern char **environ; char env1[] = "abc=def"; char *small_environ[] = { env1, 0 }; int main (void) { environ = small_environ; if (setenv ("mno", "pqr", 0) != 0) return perror ("setenv"), 1; env1[0] = 'x'; if (! getenv ("xbc")) return fprintf (stderr, "getenv failed\n"), 1; return 0; } --------------030204090805040509070504-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 03:09:33 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 08:09:33 +0000 Received: from localhost ([127.0.0.1]:59217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRFzI-0000D0-Ov for submit@debbugs.gnu.org; Fri, 27 Feb 2015 03:09:33 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:35640) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRFzG-0000Ck-M3 for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 03:09:31 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 91CF6A6002F; Fri, 27 Feb 2015 00:09:24 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v7uyPQ+HOCtu; Fri, 27 Feb 2015 00:09:21 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B1E67A60021; Fri, 27 Feb 2015 00:09:21 -0800 (PST) Message-ID: <54F02631.40708@cs.ucla.edu> Date: Fri, 27 Feb 2015 00:09:21 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ashish SHUKLA , Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> In-Reply-To: <864mq8ar1g.fsf@chateau.d.if> Content-Type: multipart/mixed; boundary="------------030501010306080205090806" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------030501010306080205090806 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Ashish SHUKLA wrote: > So, looks like you're right it only happens with X11 (Gtk3) build Please try the attached patch, which I've installed in the Emacs master. It should work around the bug in FreeBSD 10.1 getenv that was identified in . --------------030501010306080205090806 Content-Type: text/x-patch; name="0001-Don-t-require-GNU-putenv.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Don-t-require-GNU-putenv.patch" >From 1556eb079d0ce8207b17faad9861e52e07fd92f8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 27 Feb 2015 00:04:39 -0800 Subject: [PATCH] Don't require GNU putenv * configure.ac: Use system putenv even if it lacks GNU features, as we don't need them. This works around a bug in FreeBSD 10.1 getenv. Fixes: bug#19874 --- ChangeLog | 7 +++++++ configure.ac | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 47ef578..0bfdfbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-02-27 Paul Eggert + + Don't require GNU putenv + * configure.ac: Use system putenv even if it lacks GNU features, as + we don't need them. This works around a bug in FreeBSD 10.1 getenv. + Fixes: bug#19874 + 2015-02-25 Paul Eggert Merge from gnulib diff --git a/configure.ac b/configure.ac index 0bcc55c..e7408f1 100644 --- a/configure.ac +++ b/configure.ac @@ -780,6 +780,11 @@ AC_DEFUN([gl_CRYPTO_CHECK]) # Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, # as we don't use them. AC_DEFUN([gl_FCNTL_O_FLAGS]) +# Use the system putenv even if it lacks GNU features, as we don't need them, +# and the gnulib replacement runs afoul of a FreeBSD 10.1 bug; see Bug#19874. +AC_CHECK_FUNCS_ONCE([putenv]) +AC_DEFUN([gl_FUNC_PUTENV], + [test "$ac_cv_func_putenv" = yes || REPLACE_PUTENV=1]) # Initialize gnulib right after choosing the compiler. dnl Amongst other things, this sets AR and ARFLAGS. -- 2.1.0 --------------030501010306080205090806-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 03:50:07 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 08:50:07 +0000 Received: from localhost ([127.0.0.1]:59238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRGcY-0001F4-Dh for submit@debbugs.gnu.org; Fri, 27 Feb 2015 03:50:06 -0500 Received: from aloka.lostca.se ([178.63.46.202]:23054 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRGcU-0001EZ-Pg for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 03:50:03 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id 827FCC48; Fri, 27 Feb 2015 08:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:message-id:mime-version:content-type; s=howrah; bh=CoDsWOHIzY2dMOgcXdXRA1VypLk=; b=rhBnBBjmI7TuXv6qg4 y5UBwVzxJv7McHXzK9DwzthU2H4XsV4upHnaj2EEiYTaGVasGuOqfrb4SLuXCeNF aZtS2FkAEPCXKxRgOt24WYp1XeWIVqEpnyPtABg8nn7OSxtZJDa9dmc3lf/U6J7W U3xVTx84KUzrvMBOfJ3p5X0tE= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id 8ECB5C47; Fri, 27 Feb 2015 08:49:59 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id 6cee4dba; Fri, 27 Feb 2015 13:58:11 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 1:18PM up 23 mins, 3 users, load averages: 0.12, 0.11, 0.12 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150227:19874@debbugs.gnu.org::JpWxvOpY1SStrOZK:00000000000000000000000000000000000000001NR4 X-Hashcash: 1:20:150227:eggert@cs.ucla.edu::Ot9xLArQkPX1ahYF:00000000000000000000000000000000000000000003ZMs X-Hashcash: 1:20:150227:wjenkner@inode.at::tG/DBk8XtfqDu8xz:000000000000000000000000000000000000000000004y8N X-Hashcash: 1:20:150227:ashish.is@lostca.se::v22AqFiq+Htvh2ZA:0000000000000000000000000000000000000000009ZIH Date: Fri, 27 Feb 2015 13:58:10 +0530 Message-ID: <86twy77o85.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Wolfgang Jenkner , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, 26 Feb 2015 22:38:31 -0800, Paul Eggert said: | Ashish SHUKLA wrote: || So, looks like you're right it only happens with X11 (Gtk3) build | Possibly the Gtk3 code calls 'setenv', and this collides with Emacs's | implementation of putenv. | Emacs's putenv implementation should be portable to any POSIX | platform, but FreeBSD 10.1 getenv+setenv has a bug. The attached | program should work on any POSIX platform, and it does work on | GNU/Linux and on Solaris, but it doesn't work on FreeBSD 10.1. Emacs | has similar code, which apparently also runs afoul of the FreeBSD bug. In FreeBSD, every call to setenv() results in a rebuilding of "internal environment" with strdup-ed copies of existing strings in "environ"[1], and getenv only refers to "environ" iff environ is different than what "internal environment" points to. If your test program is modified a bit: =2D-8<---------------cut here---------------start------------->8--- #include #include extern char **environ; char env1[] =3D "abc=3Ddef"; char *small_environ[] =3D { env1, 0 }; int main (void) { int i =3D 0; environ =3D small_environ; for( i =3D 0; NULL !=3D environ[i]; i++ ) printf( "environment[%d]: %p\n", i, environ[i] ); if (setenv ("mno", "pqr", 0) !=3D 0) return perror ("setenv"), 1; for( i =3D 0; NULL !=3D environ[i]; i++ ) printf( "environment[%d]: %p\n", i, environ[i] ); environ[1][0] =3D 'x'; if (! getenv ("xbc")) { printf("environ: %p\nsmall_environ: %p\n", environ, small_environ ); return fprintf (stderr, "getenv failed\n"), 1; } return 0; } =2D-8<---------------cut here---------------end--------------->8--- then it doesn't fail: =2D-8<---------------cut here---------------start------------->8--- % /tmp/putenv-test=20=20=20=20=20=20=20=20=20=20=20 environment[0]: 0x600de0 environment[0]: 0x801008060 environment[1]: 0x801008058 =2D-8<---------------cut here---------------end--------------->8--- which is definitely incompatible with GNU Emacs, and thus breaks its expectations. References: [1] http://svnweb.freebsd.org/base/releng/10.1/lib/libc/stdlib/getenv.c?re= vision=3D272461&view=3Dmarkup#l349 HTH =2D-=20 Ashish SHUKLA =E2=80=9Cecho pkill cat >curiosity ; chmod +x !$; ./curiosity=E2=80=9D (abb= e, 2010) Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU8CqaAAoJEMdGz6nnT6SwdHgP/2BXVgAnKTZAYTHg+bh5ORZC LuYznfuooPaJUygOzwexHEdWscIfRw/NAJJtufrUwDko0wQzaeZsdqwNLWpAxk58 BineJeiEkbMoWaoL5cDf3rT/zXsKiM4LwzseNn8Q2y1GtmzJSIsaMQdwbtNxi14M WnMy8P+Mgoey35iap6Ym8oaaXszV0mzFFKcNMVDbmvPZB6Lv99ih0BXg8fQGYFH3 ywR19psZYrVRQs7YmRj8ypHRIIt5UoIfTUf0tXgRKj9jvSGEkEQQxwWIFhSuUjI/ l+rRNZ9GH+ubciIHR3ISFBkLuTjTnPWm3yCxxRuSMWn60c1Sq0dVxbuJrngB97KY eau3jmjoBMMWtxXYM2wmDaD12t456QgFMv/qvTAG3YpiU07bTzIoIMgYw0BEzIjh E3h2YMBaK2K2eTFxHE/GlKLhVnESUh8VmzzT0YlPlqZkxrIjeYev2rnJeZkdoJ6x 8K1yRCNb4eeMu31lxPNY4k577EnXHGHs2hXH8XpGOwKiLxz0QTNiiOqEQCMPMun0 hpcg43brrNZdogr8XuqlFunIOuhoBp3VOxcPSVAHC6bqjDg5+OoG9887xDRts707 fRPccL23o7fi14ousRiWnRzpfn5074A0+kzzEh+4QU6vXrk8wDXhw+B2wkngHt5L wM5aIlyA8+8QEjjfhUMj =UCvp -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 03:50:07 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 08:50:07 +0000 Received: from localhost ([127.0.0.1]:59240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRGcZ-0001F6-7m for submit@debbugs.gnu.org; Fri, 27 Feb 2015 03:50:07 -0500 Received: from aloka.lostca.se ([178.63.46.202]:23057 ident=having) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRGcV-0001En-N3 for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 03:50:04 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id BBE38C4A; Fri, 27 Feb 2015 08:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=howrah; bh=0hu+ff5q40Ln5RQE8sDWwcjxlw4=; b=iYEl kcCpT7hbMBdIXGgvqsbf1m6+6By59xbsuYH5pnVQKe71vKihH3JoyCawLYlzUNjW jqr8s7msGtiSLotKKP284OHE6V9QCn9mpMenlZxz7GqAXW4bJGVfYrUOi6fVFS7D VnQ33T8EWdhe0C/+70oCZzDO3DMHdJhHiVPDzB8= Received: from chateau.d.if (aloka [IPv6:::1]) by aloka.lostca.se (Postfix) with ESMTPSA id E5465C49; Fri, 27 Feb 2015 08:50:01 +0000 (UTC) Received: from chateau.d.if (chateau.d.if [IPv6:::1]) by chateau.d.if (OpenSMTPD) with ESMTP id baabb171; Fri, 27 Feb 2015 14:19:13 +0530 (IST) From: ashish.is@lostca.se (Ashish SHUKLA) To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected Organization: Lost Case References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F02631.40708@cs.ucla.edu> X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Uptime: 2:15PM up 1:20, 7 users, load averages: 1.09, 0.80, 0.56 X-Operating-System: FreeBSD/FreeBSD 10.1-RELEASE-p6/amd64 X-OpenPGP-Fingerprint: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= Organisation: Lost Case X-Hashcash: 1:20:150227:wjenkner@inode.at::MyoHloOZsIkuKo1q:000000000000000000000000000000000000000000000jTc X-Hashcash: 1:20:150227:19874@debbugs.gnu.org::KxmqEtxB75Zz8+ra:00000000000000000000000000000000000000001JO5 X-Hashcash: 1:20:150227:eggert@cs.ucla.edu::1Kf8b/F6wvav7+LO:00000000000000000000000000000000000000000002dFm Date: Fri, 27 Feb 2015 14:19:13 +0530 In-Reply-To: <54F02631.40708@cs.ucla.edu> (Paul Eggert's message of "Fri, 27 Feb 2015 00:09:21 -0800") Message-ID: <86r3tb20za.fsf@chateau.d.if> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (amd64-portbld-freebsd10.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEWpqal/f39tbW1jY2Md HR2goKCenp6UlJROTk7////9/f35+fnT09ORJdieAAACVklEQVQ4jXXUP2vbQBQA8AvUTkgz5OzY Z0iGWhpS6BSrkECn0mvx0MEJ6AjtYrfoBCVDlD8naJYmNlRfwZq8+mkKlIZaGpJSYmP7Q/XkJDrJ Td8i/H68u3vHPaPufwLdf32AMA4A6GcAgvAamY1pOJiDIFqicTwLswDhfr3uxfFtkAY/GFHPMwzD 8zpnACmIOnE6js7rQb+v4NJrG9od0C+QgpHMy5jBewV+UDSMWiw1Y4fWfyV7+NGFzDsYa3pth9LJ Q4XvXxFHcJRvHOmygn5NAEabnDcQQguarnfoiwSCJ99jmKKcphsZONmWsDK9Ro7cvZOCtQdg8nje egLhc2LNlkLmsezzTFUUy5w18ocox/f0LaLgJy0zO75zk+9pp85GAj36xjqhdI0y3tq2m4dqqcWX zQWBTz8L1irvolXV4J+3q7eCDgVnttjNq6X8H+9KOZsuNk1uCzx8pSp+E9HImfJOTLdcGqo+YKnG EIovizkEn48V7BO+ch2DXcD4ENSpWiU+q8hjjbgTBZCXnZtyj0Ws4Q1Q0B2WXFtYZo65Bbyeeldw RS6qFueM80LlLA29YlVwGRYvFD+kwI/0O+A2PlpOP9GwslUVciHuYGechuBTp922YiDZCrghTknm XSyOM+D3aoRZlo0Jb42zY7DN4p2x4AeZ+QAYutx1sHwTHzMT5cMNduQ9yW3GczN4KZ86kb0c9O8T yXDeFqpl2fryPEAYGXIlezAPXYh2NgVr/gvdoHIuDwuPwOhcWE8f8mmICq41eATkn8x0kuRTIKcB wE9+/QUtiiAnYcaN7wAAAABJRU5ErkJggg== MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: Wolfgang Jenkner , 19874@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, 27 Feb 2015 00:09:21 -0800, Paul Eggert said: | Ashish SHUKLA wrote: || So, looks like you're right it only happens with X11 (Gtk3) build | Please try the attached patch, which I've installed in the Emacs | master. It should work around the bug in FreeBSD 10.1 getenv that was | identified in . Hi, This works great now. We can close this bug. References: [1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18899 Thank you! =2D-=20 Ashish SHUKLA =E2=80=9CSnow and adolescence are the only problems that disappear if you i= gnore them long enough.=E2=80=9D Sent from my Emacs --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJU8C+JAAoJEMdGz6nnT6SwYvQQAKMdneaVfg9dDyPBTm/+UkjU QFcQ9IhsLP+8pmgDQJDZeFl9rpgXVtgXkuyQkuDN1byTCr87E7Z0MBK7m62mFGPD ZqSetgAK+Hr5Kvr4GGt6kLEFmYd0FZV6awJpaaX1AlGuD8EUDpxzGn8Bu24wmkq6 dAp+KZ2D6mA7oam3uJXUNc/+LirJjTGnucu6wKkgDdv6tKhPvvVhFXtHTnQUFL+f wk6dFNgWKJo/Oo3uGpiS10wGP/SSick6JVtmBkDQMGwBzwfhVRyDwg328Yeiag0k wAiHG/ZvjBtl5XzJWh+E/pY+VbqK3JuYs2BOE46lVksE8+L+4YEzsAZ7U/pFjAU+ 5CEz1jyqr5mB1Bhm9hPqWMdIvt7N7AhISa4QPOhPWbB51O6wk7adGtbpmNHf+wBF eoUfI2B/MN/KOHYjXpIqHErJBs8VfARq/a4aY+S/zWUR8tgjWvnyxvw5L2Fr/5Vg A7EzGbaxhB45l9shml1yh1pvATC8CdWQAaZ2Jo4yh3x8jYb7Tvr5wTeWSPHlXtvL R8AAAP+iplqnETQZb1LAhEjz3iSUppR+hv9JpRCCBW1r6HqQ+t4mTg6xNncOhbfJ rOXzevgL7fJ88+quzZOiT3zE5Zjyf9RVuYWl+Ka9s11SQdf29QvI4lfC/QbdEK5J l4bPoJLe/WLB9S5zsrdM =6+XP -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 11:41:19 2015 Received: (at 19874-done) by debbugs.gnu.org; 27 Feb 2015 16:41:19 +0000 Received: from localhost ([127.0.0.1]:60138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRNyZ-0006zq-DV for submit@debbugs.gnu.org; Fri, 27 Feb 2015 11:41:19 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:53159) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRNyW-0006zb-Rv for 19874-done@debbugs.gnu.org; Fri, 27 Feb 2015 11:41:17 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id CC632A6003C; Fri, 27 Feb 2015 08:41:10 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dm2vPkkMWkBx; Fri, 27 Feb 2015 08:41:10 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1B62239E801F; Fri, 27 Feb 2015 08:41:10 -0800 (PST) Message-ID: <54F09E22.4000603@cs.ucla.edu> Date: Fri, 27 Feb 2015 08:41:06 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ashish SHUKLA Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <86twy77o85.fsf@chateau.d.if> In-Reply-To: <86twy77o85.fsf@chateau.d.if> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874-done Cc: Wolfgang Jenkner , 19874-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 02/27/2015 12:28 AM, Ashish SHUKLA wrote: > If your test program is modified a bit: > ... > then it doesn't fail: Sure, but the modified test program has unspecified behavior in POSIX, as there's no guarantee that environ[1] is "abc" (it might be "mno"). Whereas the original test program has well-defined behavior in POSIX, but reports an error because FreeBSD 10.1 getenv is buggy. Anyway, Emacs now works around the FreeBSD bug so I'm closing this Emacs bug report. Thanks for checking the fix. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 12:37:19 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 17:37:19 +0000 Received: from localhost ([127.0.0.1]:60167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YROql-0008JT-6V for submit@debbugs.gnu.org; Fri, 27 Feb 2015 12:37:19 -0500 Received: from b2bfep14.mx.upcmail.net ([62.179.121.59]:44838) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YROqj-0008JF-GE for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 12:37:18 -0500 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep14.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150227173710.BFEB11972.b2bfep14-int.chello.at@edge11.upcmail.net> for <19874@debbugs.gnu.org>; Fri, 27 Feb 2015 18:37:10 +0100 Received: from iznogoud.viz ([91.119.130.1]) by edge11.upcmail.net with edge id xVdA1p00401xFQB0BVdAfe; Fri, 27 Feb 2015 18:37:10 +0100 X-SourceIP: 91.119.130.1 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YROqb-0000QU-Mk; Fri, 27 Feb 2015 18:37:09 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected Date: Fri, 27 Feb 2015 18:33:47 +0100 References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> Message-ID: <8561an5k8q.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Thu, Feb 26 2015, Paul Eggert wrote: > Emacs's putenv implementation should be portable to any POSIX > platform, but FreeBSD 10.1 getenv+setenv has a bug. The attached > program should work on any POSIX platform, and it does work on > GNU/Linux and on Solaris, but it doesn't work on FreeBSD 10.1. Emacs > has similar code, which apparently also runs afoul of the FreeBSD bug. > > #include > #include > extern char **environ; > char env1[] = "abc=def"; > char *small_environ[] = { env1, 0 }; > int > main (void) > { > environ = small_environ; > if (setenv ("mno", "pqr", 0) != 0) > return perror ("setenv"), 1; > env1[0] = 'x'; > if (! getenv ("xbc")) > return fprintf (stderr, "getenv failed\n"), 1; > return 0; > } IIUC, the standard explicitly permits the FreeBSD behaviour, so the program above does not seem to be conforming: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html If the application switches to a complete new environment by assigning a new value to environ, this can be detected by getenv(), setenv(), unsetenv(), or putenv() and the implementation can at that point reinitialize based on the new environment. (This may include copying the environment strings into a new array and assigning environ to point to it.) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 27 18:54:17 2015 Received: (at 19874) by debbugs.gnu.org; 27 Feb 2015 23:54:17 +0000 Received: from localhost ([127.0.0.1]:60297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRUjY-0000cG-Kj for submit@debbugs.gnu.org; Fri, 27 Feb 2015 18:54:17 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:46377) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRUjV-0000c1-FU for 19874@debbugs.gnu.org; Fri, 27 Feb 2015 18:54:14 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 72F52A60052; Fri, 27 Feb 2015 15:54:06 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n4pZc9aScB+w; Fri, 27 Feb 2015 15:54:05 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7527CA60060; Fri, 27 Feb 2015 15:54:05 -0800 (PST) Message-ID: <54F10399.8010207@cs.ucla.edu> Date: Fri, 27 Feb 2015 15:54:01 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> In-Reply-To: <8561an5k8q.fsf@iznogoud.viz> Content-Type: multipart/alternative; boundary="------------030208000905060105040201" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------030208000905060105040201 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 02/27/2015 09:33 AM, Wolfgang Jenkner wrote: > IIUC, the standard explicitly permits the FreeBSD behaviour, so the > program above does not seem to be conforming: > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html > > If the application switches to a complete new environment by > assigning a new value to environ, this can be detected by > getenv(), setenv(), unsetenv(), or putenv() and the > implementation can at that point reinitialize based on the new > environment. (This may include copying the environment strings > into a new array and assigning environ to point to it.) No, because that part of the rationale is not talking about the buggy FreeBSD behavior. Although the test program does assign a new value to environ, that's not a problem because everything still works: 'setenv' reinitializes based on the new environment, as it's allowed to do. The problem doesn't occur until after the assignment "env1[0] = 'x'", and this is a different matter. As the getenv rationale points out, "conforming applications are required not to directly modify the pointers to which /environ/ points", and it appears that's the restriction you're thinking about. However, the test program obeys this restriction. Although the restriction applies to environ[0], environ[1], etc., it does not apply to environ[0][0], environ[0][1], etc. Programs are allowed to change the char objects in environ strings that they supply (either via putenv, or directly by switching to a complete new environment), and Emacs relies on this, as does the test program. The reason Emacs relies on this, by the way, is that Emacs requires a thread-safe way to set the TZ environment variable without dumping core if different threads invoke 'setenv' and/or 'unsetenv' and/or 'putenv' at about the same time. This was a real problem in Emacs before it started using the current approach of modifying the environment's TZ value in-place (or zapping its name to unset TZ). Please see: http://bugs.gnu.org/8705 --------------030208000905060105040201 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 02/27/2015 09:33 AM, Wolfgang Jenkner wrote:
IIUC, the standard explicitly permits the FreeBSD behaviour, so the
program above does not seem to be conforming:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html

	If the application switches to a complete new environment by
	assigning a new value to environ, this can be detected by
	getenv(), setenv(), unsetenv(), or putenv() and the
	implementation can at that point reinitialize based on the new
	environment. (This may include copying the environment strings
	into a new array and assigning environ to point to it.)

No, because that part of the rationale is not talking about the buggy FreeBSD behavior.  Although the test program does assign a new value to environ, that's not a problem because everything still works: 'setenv' reinitializes based on the new environment, as it's allowed to do.  The problem doesn't occur until after the assignment "env1[0] = 'x'", and this is a different matter.

As the getenv rationale points out, "conforming applications are required not to directly modify the pointers to which environ points", and it appears that's the restriction you're thinking about.  However, the test program obeys this restriction.  Although the restriction applies to environ[0], environ[1], etc., it does not apply to environ[0][0], environ[0][1], etc.  Programs are allowed to change the char objects in environ strings that they supply (either via putenv, or directly by switching to a complete new environment), and Emacs relies on this, as does the test program.

The reason Emacs relies on this, by the way, is that Emacs requires a thread-safe way to set the TZ environment variable without dumping core if different threads invoke 'setenv' and/or 'unsetenv' and/or 'putenv' at about the same time.  This was a real problem in Emacs before it started using the current approach of modifying the environment's TZ value in-place (or zapping its name to unset TZ).  Please see:

http://bugs.gnu.org/8705
--------------030208000905060105040201-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 28 09:11:09 2015 Received: (at 19874) by debbugs.gnu.org; 28 Feb 2015 14:11:09 +0000 Received: from localhost ([127.0.0.1]:60450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRi6n-00079b-5P for submit@debbugs.gnu.org; Sat, 28 Feb 2015 09:11:09 -0500 Received: from b2bfep16.mx.upcmail.net ([62.179.121.61]:65153) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRi6j-000791-Uy for 19874@debbugs.gnu.org; Sat, 28 Feb 2015 09:11:07 -0500 Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep16.mx.upcmail.net (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150228141049.OHEL17514.b2bfep16-int.chello.at@edge12.upcmail.net> for <19874@debbugs.gnu.org>; Sat, 28 Feb 2015 15:10:49 +0100 Received: from iznogoud.viz ([91.119.222.134]) by edge12.upcmail.net with edge id xqAo1p0062ubb8B0CqAozB; Sat, 28 Feb 2015 15:10:49 +0100 X-SourceIP: 91.119.222.134 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YRi6S-0000L6-4B; Sat, 28 Feb 2015 15:10:48 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> <54F10399.8010207@cs.ucla.edu> Date: Sat, 28 Feb 2015 15:10:47 +0100 In-Reply-To: <54F10399.8010207@cs.ucla.edu> (Paul Eggert's message of "Fri, 27 Feb 2015 15:54:01 -0800") Message-ID: <85lhjim8ig.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, Feb 27 2015, Paul Eggert wrote: > On 02/27/2015 09:33 AM, Wolfgang Jenkner wrote: >> IIUC, the standard explicitly permits the FreeBSD behaviour, so the >> program above does not seem to be conforming: >> >> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html >> >> If the application switches to a complete new environment by >> assigning a new value to environ, this can be detected by >> getenv(), setenv(), unsetenv(), or putenv() and the >> implementation can at that point reinitialize based on the new >> environment. (This may include copying the environment strings >> into a new array and assigning environ to point to it.) > > No, because that part of the rationale is not talking about the buggy > FreeBSD behavior. Although the test program does assign a new value > to environ, that's not a problem because everything still works: > 'setenv' reinitializes based on the new environment, as it's allowed > to do. The problem doesn't occur until after the assignment "env1[0] > = 'x'", and this is a different matter. > > As the getenv rationale points out, "conforming applications are > required not to directly modify the pointers to which /environ/ > points", and it appears that's the restriction you're thinking about. [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [62.179.121.61 listed in list.dnswl.org] X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, Feb 27 2015, Paul Eggert wrote: > On 02/27/2015 09:33 AM, Wolfgang Jenkner wrote: >> IIUC, the standard explicitly permits the FreeBSD behaviour, so the >> program above does not seem to be conforming: >> >> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html >> >> If the application switches to a complete new environment by >> assigning a new value to environ, this can be detected by >> getenv(), setenv(), unsetenv(), or putenv() and the >> implementation can at that point reinitialize based on the new >> environment. (This may include copying the environment strings >> into a new array and assigning environ to point to it.) > > No, because that part of the rationale is not talking about the buggy > FreeBSD behavior. Although the test program does assign a new value > to environ, that's not a problem because everything still works: > 'setenv' reinitializes based on the new environment, as it's allowed > to do. The problem doesn't occur until after the assignment "env1[0] > = 'x'", and this is a different matter. > > As the getenv rationale points out, "conforming applications are > required not to directly modify the pointers to which /environ/ > points", and it appears that's the restriction you're thinking about. [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [62.179.121.61 listed in list.dnswl.org] 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] On Fri, Feb 27 2015, Paul Eggert wrote: > On 02/27/2015 09:33 AM, Wolfgang Jenkner wrote: >> IIUC, the standard explicitly permits the FreeBSD behaviour, so the >> program above does not seem to be conforming: >> >> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html >> >> If the application switches to a complete new environment by >> assigning a new value to environ, this can be detected by >> getenv(), setenv(), unsetenv(), or putenv() and the >> implementation can at that point reinitialize based on the new >> environment. (This may include copying the environment strings >> into a new array and assigning environ to point to it.) > > No, because that part of the rationale is not talking about the buggy > FreeBSD behavior. Although the test program does assign a new value > to environ, that's not a problem because everything still works: > 'setenv' reinitializes based on the new environment, as it's allowed > to do. The problem doesn't occur until after the assignment "env1[0] > = 'x'", and this is a different matter. > > As the getenv rationale points out, "conforming applications are > required not to directly modify the pointers to which /environ/ > points", and it appears that's the restriction you're thinking about. No, I think about the parenthetical remark above: It states `copying the environment strings' and not `copying the pointers to the environment strings'. Normally, in documentation, copying a `string' refers to the object, i.e the region in memory it occupies, not to the pointer designating it. And the program modifies env1 after it may have copied to the new `environment'. Wolfgang From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 28 09:18:42 2015 Received: (at 19874) by debbugs.gnu.org; 28 Feb 2015 14:18:42 +0000 Received: from localhost ([127.0.0.1]:60454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRiE6-0007KM-Bs for submit@debbugs.gnu.org; Sat, 28 Feb 2015 09:18:42 -0500 Received: from b2bfep13.mx.upcmail.net ([62.179.121.58]:38073) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRiE4-0007K9-C2 for 19874@debbugs.gnu.org; Sat, 28 Feb 2015 09:18:41 -0500 Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep13.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150228141834.RWJL20529.b2bfep13-int.chello.at@edge12.upcmail.net> for <19874@debbugs.gnu.org>; Sat, 28 Feb 2015 15:18:34 +0100 Received: from iznogoud.viz ([91.119.222.134]) by edge12.upcmail.net with edge id xqJZ1p00Z2ubb8B0CqJZak; Sat, 28 Feb 2015 15:18:34 +0100 X-SourceIP: 91.119.222.134 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YRiDx-0000LI-LF; Sat, 28 Feb 2015 15:18:33 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> <54F10399.8010207@cs.ucla.edu> <85lhjim8ig.fsf@iznogoud.viz> Date: Sat, 28 Feb 2015 15:18:33 +0100 In-Reply-To: <85lhjim8ig.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Sat, 28 Feb 2015 15:10:47 +0100") Message-ID: <85h9u6m85i.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Sat, Feb 28 2015, Wolfgang Jenkner wrote: > may have copied may have been copied From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 28 14:43:20 2015 Received: (at 19874) by debbugs.gnu.org; 28 Feb 2015 19:43:20 +0000 Received: from localhost ([127.0.0.1]:60857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRnIG-0006gi-DG for submit@debbugs.gnu.org; Sat, 28 Feb 2015 14:43:20 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:52142) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRnID-0006gO-UT for 19874@debbugs.gnu.org; Sat, 28 Feb 2015 14:43:18 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id B6E29A60004; Sat, 28 Feb 2015 11:43:11 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PSCzf8oiZtmY; Sat, 28 Feb 2015 11:43:10 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id A5B2139E8014; Sat, 28 Feb 2015 11:43:10 -0800 (PST) Message-ID: <54F21A4E.70707@cs.ucla.edu> Date: Sat, 28 Feb 2015 11:43:10 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> <54F10399.8010207@cs.ucla.edu> <85lhjim8ig.fsf@iznogoud.viz> In-Reply-To: <85lhjim8ig.fsf@iznogoud.viz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Wolfgang Jenkner wrote: > No, I think about the parenthetical remark above: It states `copying the > environment strings' and not `copying the pointers to the environment > strings'. Normally, in documentation, copying a `string' refers to the > object, i.e the region in memory it occupies, not to the pointer > designating it. That interpretation of the rationale is inconsistent with how putenv is required to behave. If one uses putenv to add a string to the environment, one can later alter the string (via strcpy, say), and this changes the environment; this is quite clear from the normative text. Under the above interpretation, however, getenv could copy the string's contents somewhere else, which would mean that modifying the putenv-supplied string would not change the environment. If the rationale were intended to discuss copying the strings' contents, then its sentence "copying the environment strings into a new array and assigning environ to point to it" would be incorrect, as one would not assign environ to point to the new array containing the strings' contents, but rather one would assign environ[0], environ[1], environ[2], etc. to point within the new array. The context of that part of the rationale makes it clear that "assign to environ" means "environ = SOMETHING", not "environ[0] = SOMETHING". From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 11:52:43 2015 Received: (at 19874) by debbugs.gnu.org; 1 Mar 2015 16:52:43 +0000 Received: from localhost ([127.0.0.1]:33490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YS76g-0007QR-F1 for submit@debbugs.gnu.org; Sun, 01 Mar 2015 11:52:42 -0500 Received: from b2bfep12.mx.upcmail.net ([62.179.121.57]:38570) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YS76d-0007QB-QE for 19874@debbugs.gnu.org; Sun, 01 Mar 2015 11:52:40 -0500 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep12.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150301165233.MTWO14748.b2bfep12-int.chello.at@edge11.upcmail.net> for <19874@debbugs.gnu.org>; Sun, 1 Mar 2015 17:52:33 +0100 Received: from iznogoud.viz ([91.119.117.221]) by edge11.upcmail.net with edge id yGsY1p0094mhD3P0BGsY7u; Sun, 01 Mar 2015 17:52:33 +0100 X-SourceIP: 91.119.117.221 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YS76W-0000Qb-1e; Sun, 01 Mar 2015 17:52:32 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected Date: Sun, 01 Mar 2015 17:42:22 +0100 References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> <54F10399.8010207@cs.ucla.edu> <85lhjim8ig.fsf@iznogoud.viz> <54F21A4E.70707@cs.ucla.edu> Message-ID: <85vbikvewg.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Sat, Feb 28 2015, Paul Eggert wrote: > Wolfgang Jenkner wrote: >> No, I think about the parenthetical remark above: It states `copying the >> environment strings' and not `copying the pointers to the environment >> strings'. Normally, in documentation, copying a `string' refers to the >> object, i.e the region in memory it occupies, not to the pointer >> designating it. > > That interpretation of the rationale is inconsistent with how putenv > is required to behave. If one uses putenv to add a string to the > environment, one can later alter the string (via strcpy, say), and > this changes the environment; this is quite clear from the normative > text. Under the above interpretation, however, getenv could copy the > string's contents somewhere else, which would mean that modifying the > putenv-supplied string would not change the environment. Sure, if putenv is supported it must be compatible with getenv (as the standard states) and the interpretation of the rationale in this case implies that getenv can't copy the strings' content, but setenv may, IIUC (I'm still just wondering if the test program you posted is conforming). > If the rationale were intended to discuss copying the strings' > contents, then its sentence "copying the environment strings into > a new array and assigning environ to point to it" would be incorrect, > as one would not assign environ to point to the new array containing > the strings' contents, but rather one would assign environ[0], > environ[1], environ[2], etc. to point within the new array. The > context of that part of the rationale makes it clear that "assign to > environ" means "environ = SOMETHING", not "environ[0] = SOMETHING". Yes, I was simply thinking about something like q = environ_tmp; for (p = environ; *p; p++, q++) *q = strdup(*p); environ = environ_tmp; From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 13:28:19 2015 Received: (at 19874) by debbugs.gnu.org; 1 Mar 2015 18:28:19 +0000 Received: from localhost ([127.0.0.1]:33518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YS8bC-0001EE-P0 for submit@debbugs.gnu.org; Sun, 01 Mar 2015 13:28:19 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:35202) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YS8bA-0001E0-9n for 19874@debbugs.gnu.org; Sun, 01 Mar 2015 13:28:17 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 33B0D39E80BC; Sun, 1 Mar 2015 10:28:10 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05FJr0Epii2k; Sun, 1 Mar 2015 10:28:09 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7D04C39E8017; Sun, 1 Mar 2015 10:28:09 -0800 (PST) Message-ID: <54F35A32.90202@cs.ucla.edu> Date: Sun, 01 Mar 2015 10:28:02 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Wolfgang Jenkner Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> <54F10399.8010207@cs.ucla.edu> <85lhjim8ig.fsf@iznogoud.viz> <54F21A4E.70707@cs.ucla.edu> <85vbikvewg.fsf@iznogoud.viz> In-Reply-To: <85vbikvewg.fsf@iznogoud.viz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Wolfgang Jenkner wrote: > I was simply thinking about something like > > q = environ_tmp; > for (p = environ; *p; p++, q++) > *q = strdup(*p); > environ = environ_tmp; The behavior of getenv, setenv, etc. are undefined after a program modifies environ[0], environ[1], etc. See POSIX 8.1 . So, although a POSIX-conforming program can do the above, it can't use getenv etc. afterwards. In contrast the putenv-test.c program I sent earlier doesn't modify environ[0], environ[1], etc., so it can rely upon getenv etc. Emacs's problem on FreeBSD occurred because Gnulib's workaround for FreeBSD putenv's incompatibility with GNU putenv ran afoul of the POSIX 8.1 restriction. My recent patch worked around the workaround, by telling Emacs to not use Gnulib's workaround. So fixing the FreeBSD bug exemplified by putenv-test.c isn't needed to get Emacs to work; still, it's a bug that may bite other programs. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 17:49:51 2015 Received: (at 19874) by debbugs.gnu.org; 1 Mar 2015 22:49:51 +0000 Received: from localhost ([127.0.0.1]:33624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSCgJ-0001r9-3d for submit@debbugs.gnu.org; Sun, 01 Mar 2015 17:49:51 -0500 Received: from b2bfep16.mx.upcmail.net ([62.179.121.61]:34924) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSCgF-0001qp-Jh for 19874@debbugs.gnu.org; Sun, 01 Mar 2015 17:49:48 -0500 Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep16.mx.upcmail.net (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150301224930.OJXF17187.b2bfep16-int.chello.at@edge12.upcmail.net> for <19874@debbugs.gnu.org>; Sun, 1 Mar 2015 23:49:30 +0100 Received: from iznogoud.viz ([91.119.117.221]) by edge12.upcmail.net with edge id yNpV1p00J4mhD3P0CNpWcs; Sun, 01 Mar 2015 23:49:30 +0100 X-SourceIP: 91.119.117.221 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YSCfx-0000Gi-JY; Sun, 01 Mar 2015 23:49:29 +0100 From: Wolfgang Jenkner To: Paul Eggert Subject: Re: bug#19874: 25.0.50; encode-time not working as expected References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> <54F10399.8010207@cs.ucla.edu> <85lhjim8ig.fsf@iznogoud.viz> <54F21A4E.70707@cs.ucla.edu> <85vbikvewg.fsf@iznogoud.viz> <54F35A32.90202@cs.ucla.edu> Date: Sun, 01 Mar 2015 23:49:29 +0100 Message-ID: <85twy4cozq.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Ashish SHUKLA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Sun, Mar 01 2015, Paul Eggert wrote: >> I was simply thinking about something like >> >> q = environ_tmp; >> for (p = environ; *p; p++, q++) >> *q = strdup(*p); >> environ = environ_tmp; > > The behavior of getenv, setenv, etc. are undefined after a program > modifies environ[0], environ[1], etc. See POSIX 8.1 > . So, > although a POSIX-conforming program can do the above, it can't use > getenv etc. afterwards. The parenthetical remark in the getenv RATIONALE section is about what the *implementation* may do. the implementation can at that point reinitialize based on the new environment. (This may include copying the environment strings into a new array and assigning environ to point to it.) The code snippet above just illustrates a possible interpretation of the parenthetical remark above. From unknown Mon Jun 16 23:41:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 30 Mar 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 18 23:57:13 2020 Received: (at control) by debbugs.gnu.org; 19 Jan 2020 04:57:13 +0000 Received: from localhost ([127.0.0.1]:42596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1it2e9-0008WQ-0s for submit@debbugs.gnu.org; Sat, 18 Jan 2020 23:57:13 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1it2e7-0008WC-J3 for control@debbugs.gnu.org; Sat, 18 Jan 2020 23:57:12 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 30D95160060 for ; Sat, 18 Jan 2020 20:57:05 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Cjcuqwhq1Rze for ; Sat, 18 Jan 2020 20:57:04 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2EB4E16006B for ; Sat, 18 Jan 2020 20:57:04 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zQf7ONxaI1Oj for ; Sat, 18 Jan 2020 20:57:04 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 0BD54160060 for ; Sat, 18 Jan 2020 20:57:04 -0800 (PST) To: control@debbugs.gnu.org From: Paul Eggert Subject: unarchive 19874 Organization: UCLA Computer Science Department Message-ID: <11941489-d5a4-d2ca-20c2-c7b61568cb35@cs.ucla.edu> Date: Sat, 18 Jan 2020 20:57:03 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) unarchive 19874 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 19 00:09:32 2020 Received: (at 19874) by debbugs.gnu.org; 19 Jan 2020 05:09:32 +0000 Received: from localhost ([127.0.0.1]:42601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1it2q4-0002MQ-3w for submit@debbugs.gnu.org; Sun, 19 Jan 2020 00:09:32 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1it2q2-0002MB-Ey for 19874@debbugs.gnu.org; Sun, 19 Jan 2020 00:09:31 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 71E40160060; Sat, 18 Jan 2020 21:09:24 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 2CtHlR9-75-R; Sat, 18 Jan 2020 21:09:19 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D2A5816006B; Sat, 18 Jan 2020 21:09:19 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0mwu7BOd1Sje; Sat, 18 Jan 2020 21:09:19 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 93B08160060; Sat, 18 Jan 2020 21:09:19 -0800 (PST) Subject: Re: simplifying Emacs configure.ac To: Bruno Haible References: <2972759.yA5RhZVnzj@omega> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sat, 18 Jan 2020 21:09:19 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <2972759.yA5RhZVnzj@omega> Content-Type: multipart/mixed; boundary="------------5BD3AEFCD78E8370DADF5E89" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19874 Cc: Wolfgang Jenkner , 19874@debbugs.gnu.org, Ashish Shukla X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is a multi-part message in MIME format. --------------5BD3AEFCD78E8370DADF5E89 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 1/18/20 5:46 AM, Bruno Haible wrote: > This code in Emacs configure.ac: > > # Use the system putenv even if it lacks GNU features, as we don't need them, > # and the gnulib replacement runs afoul of a FreeBSD 10.1 bug; see Bug#19874. > AC_CHECK_FUNCS_ONCE([putenv]) > AC_DEFUN([gl_FUNC_PUTENV], > [test "$ac_cv_func_putenv" = yes || REPLACE_PUTENV=1]) > > appears to be extra convoluted. All platforms have the putenv function. > Therefore REPLACE_PUTENV=1 is never executed here. If Emacs does not need > the putenv override, the simpler way is to invoke gnulib-tool with > '--avoid=putenv'. Thanks for suggesting that. I installed the attached patch to Emacs master to implement something along the lines you suggested. I am cc'ing Ashish Shukla who reported Bug#19874 ("25.0.50; encode-time not working as expected"), as well as Wolfgang Jenkner who helped debug that, to give them a heads-up that the fix for Bug#19874 has changed. --------------5BD3AEFCD78E8370DADF5E89 Content-Type: text/x-patch; charset=UTF-8; name="0001-Remove-Gnulib-putenv-code.patch" Content-Disposition: attachment; filename="0001-Remove-Gnulib-putenv-code.patch" Content-Transfer-Encoding: quoted-printable >From 35a1a007bb7506c72ee6d9757a79014c679e7bae Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 18 Jan 2020 20:54:29 -0800 Subject: [PATCH] Remove Gnulib putenv code MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit It=E2=80=99s not needed, since Emacs always uses the system putenv and al= l platforms have putenv. This improves on the fix for Bug#19874. Suggested by Bruno Haible. * admin/merge-gnulib (GNULIB_MODULES): Remove putenv. * configure.ac: Remove workarounds for Gnulib putenv module. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/putenv.c, m4/putenv.m4: Remove. --- admin/merge-gnulib | 2 +- configure.ac | 5 -- lib/gnulib.mk.in | 12 --- lib/putenv.c | 194 --------------------------------------------- m4/gnulib-comp.m4 | 9 --- m4/putenv.m4 | 60 -------------- 6 files changed, 1 insertion(+), 281 deletions(-) delete mode 100644 lib/putenv.c delete mode 100644 m4/putenv.m4 diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 3dee0b72b3..48c81e61e2 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -38,7 +38,7 @@ GNULIB_MODULES=3D getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ieee754-h ignore-value intprops largefile lstat manywarnings memmem-simple mempcpy memrchr minmax mkostemp mktime nstr= ftime - pathmax pipe2 pselect pthread_sigmask putenv + pathmax pipe2 pselect pthread_sigmask qcopy-acl readlink readlinkat regex sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strnlen strtoimax symlink sys_stat sys_time diff --git a/configure.ac b/configure.ac index 8a13b36e94..d7b4d0352c 100644 --- a/configure.ac +++ b/configure.ac @@ -882,11 +882,6 @@ AC_DEFUN test $func =3D pthread_sigmask || AS_VAR_APPEND([funcs], [" $func"]) done ac_func_list=3D$funcs -# Use the system putenv even if it lacks GNU features, as we don't need = them, -# and the gnulib replacement runs afoul of a FreeBSD 10.1 bug; see Bug#1= 9874. -AC_CHECK_FUNCS_ONCE([putenv]) -AC_DEFUN([gl_FUNC_PUTENV], - [test "$ac_cv_func_putenv" =3D yes || REPLACE_PUTENV=3D1]) # Emacs does not use the wchar or wctype-h modules. AC_DEFUN([gt_TYPE_WINT_T], [GNULIB_OVERRIDES_WINT_T=3D0 diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index ed80f88a87..1c8085b1a4 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -127,7 +127,6 @@ # pipe2 \ # pselect \ # pthread_sigmask \ -# putenv \ # qcopy-acl \ # readlink \ # readlinkat \ @@ -2162,17 +2161,6 @@ EXTRA_libgnu_a_SOURCES +=3D pthread_sigmask.c endif ## end gnulib module pthread_sigmask =20 -## begin gnulib module putenv -ifeq (,$(OMIT_GNULIB_MODULE_putenv)) - - -EXTRA_DIST +=3D putenv.c - -EXTRA_libgnu_a_SOURCES +=3D putenv.c - -endif -## end gnulib module putenv - ## begin gnulib module qcopy-acl ifeq (,$(OMIT_GNULIB_MODULE_qcopy-acl)) =20 diff --git a/lib/putenv.c b/lib/putenv.c deleted file mode 100644 index 9e862e63d3..0000000000 --- a/lib/putenv.c +++ /dev/null @@ -1,194 +0,0 @@ -/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2020 Free Software - Foundation, Inc. - - NOTE: The canonical source of this file is maintained with the GNU C - Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - This program is free software: you can redistribute it and/or modify = it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3 of the License, or any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see = . */ - -#include - -/* Specification. */ -#include - -#include - -/* Include errno.h *after* sys/types.h to work around header problems - on AIX 3.2.5. */ -#include -#ifndef __set_errno -# define __set_errno(ev) ((errno) =3D (ev)) -#endif - -#include -#include - -#if defined _WIN32 && ! defined __CYGWIN__ -# define WIN32_LEAN_AND_MEAN -# include -#endif - -#if _LIBC -# if HAVE_GNU_LD -# define environ __environ -# else -extern char **environ; -# endif -#endif - -#if _LIBC -/* This lock protects against simultaneous modifications of 'environ'. = */ -# include -__libc_lock_define_initialized (static, envlock) -# define LOCK __libc_lock_lock (envlock) -# define UNLOCK __libc_lock_unlock (envlock) -#else -# define LOCK -# define UNLOCK -#endif - -static int -_unsetenv (const char *name) -{ - size_t len; -#if !HAVE_DECL__PUTENV - char **ep; -#endif - - if (name =3D=3D NULL || *name =3D=3D '\0' || strchr (name, '=3D') !=3D= NULL) - { - __set_errno (EINVAL); - return -1; - } - - len =3D strlen (name); - -#if HAVE_DECL__PUTENV - { - int putenv_result, putenv_errno; - char *name_ =3D malloc (len + 2); - memcpy (name_, name, len); - name_[len] =3D '=3D'; - name_[len + 1] =3D 0; - putenv_result =3D _putenv (name_); - putenv_errno =3D errno; - free (name_); - __set_errno (putenv_errno); - return putenv_result; - } -#else - - LOCK; - - ep =3D environ; - while (*ep !=3D NULL) - if (!strncmp (*ep, name, len) && (*ep)[len] =3D=3D '=3D') - { - /* Found it. Remove this pointer by moving later ones back. */ - char **dp =3D ep; - - do - dp[0] =3D dp[1]; - while (*dp++); - /* Continue the loop in case NAME appears again. */ - } - else - ++ep; - - UNLOCK; - - return 0; -#endif -} - - -/* Put STRING, which is of the form "NAME=3DVALUE", in the environment. - If STRING contains no '=3D', then remove STRING from the environment.= */ -int -putenv (char *string) -{ - const char *name_end =3D strchr (string, '=3D'); - char **ep; - - if (name_end =3D=3D NULL) - { - /* Remove the variable from the environment. */ - return _unsetenv (string); - } - -#if HAVE_DECL__PUTENV - /* Rely on _putenv to allocate the new environment. If other - parts of the application use _putenv, the !HAVE_DECL__PUTENV code - would fight over who owns the environ vector, causing a crash. */ - if (name_end[1]) - return _putenv (string); - else - { - /* _putenv ("NAME=3D") unsets NAME, so invoke _putenv ("NAME=3D ") - to allocate the environ vector and then replace the new - entry with "NAME=3D". */ - int putenv_result, putenv_errno; - char *name_x =3D malloc (name_end - string + sizeof "=3D "); - if (!name_x) - return -1; - memcpy (name_x, string, name_end - string + 1); - name_x[name_end - string + 1] =3D ' '; - name_x[name_end - string + 2] =3D 0; - putenv_result =3D _putenv (name_x); - putenv_errno =3D errno; - for (ep =3D environ; *ep; ep++) - if (strcmp (*ep, name_x) =3D=3D 0) - { - *ep =3D string; - break; - } -# if defined _WIN32 && ! defined __CYGWIN__ - if (putenv_result =3D=3D 0) - { - /* _putenv propagated "NAME=3D " into the subprocess environme= nt; - fix that by calling SetEnvironmentVariable directly. */ - name_x[name_end - string] =3D 0; - putenv_result =3D SetEnvironmentVariable (name_x, "") ? 0 : -1= ; - putenv_errno =3D ENOMEM; /* ENOMEM is the only way to fail. *= / - } -# endif - free (name_x); - __set_errno (putenv_errno); - return putenv_result; - } -#else - for (ep =3D environ; *ep; ep++) - if (strncmp (*ep, string, name_end - string) =3D=3D 0 - && (*ep)[name_end - string] =3D=3D '=3D') - break; - - if (*ep) - *ep =3D string; - else - { - static char **last_environ =3D NULL; - size_t size =3D ep - environ; - char **new_environ =3D malloc ((size + 2) * sizeof *new_environ); - if (! new_environ) - return -1; - new_environ[0] =3D string; - memcpy (new_environ + 1, environ, (size + 1) * sizeof *new_environ= ); - free (last_environ); - last_environ =3D new_environ; - environ =3D new_environ; - } - - return 0; -#endif -} diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index cb3b89dd72..48d8030f53 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -133,7 +133,6 @@ AC_DEFUN # Code from module pipe2: # Code from module pselect: # Code from module pthread_sigmask: - # Code from module putenv: # Code from module qcopy-acl: # Code from module readlink: # Code from module readlinkat: @@ -368,12 +367,6 @@ AC_DEFUN gl_PREREQ_PTHREAD_SIGMASK fi gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) - gl_FUNC_PUTENV - if test $REPLACE_PUTENV =3D 1; then - AC_LIBOBJ([putenv]) - gl_PREREQ_PUTENV - fi - gl_STDLIB_MODULE_INDICATOR([putenv]) gl_FUNC_READLINK if test $HAVE_READLINK =3D 0 || test $REPLACE_READLINK =3D 1; then AC_LIBOBJ([readlink]) @@ -973,7 +966,6 @@ AC_DEFUN lib/pipe2.c lib/pselect.c lib/pthread_sigmask.c - lib/putenv.c lib/qcopy-acl.c lib/readlink.c lib/readlinkat.c @@ -1112,7 +1104,6 @@ AC_DEFUN m4/pipe2.m4 m4/pselect.m4 m4/pthread_sigmask.m4 - m4/putenv.m4 m4/readlink.m4 m4/readlinkat.m4 m4/regex.m4 diff --git a/m4/putenv.m4 b/m4/putenv.m4 deleted file mode 100644 index e38f8c5694..0000000000 --- a/m4/putenv.m4 +++ /dev/null @@ -1,60 +0,0 @@ -# putenv.m4 serial 24 -dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Jim Meyering. -dnl -dnl Check whether putenv ("FOO") removes FOO from the environment. -dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that. - -AC_DEFUN([gl_FUNC_PUTENV], -[ - AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - AC_CACHE_CHECK([for putenv compatible with GNU and SVID], - [gl_cv_func_svid_putenv], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ - /* Put it in env. */ - if (putenv ("CONFTEST_putenv=3Dval")) - return 1; - - /* Try to remove it. */ - if (putenv ("CONFTEST_putenv")) - return 2; - - /* Make sure it was deleted. */ - if (getenv ("CONFTEST_putenv") !=3D 0) - return 3; - - return 0; - ]])], - gl_cv_func_svid_putenv=3Dyes, - gl_cv_func_svid_putenv=3Dno, - dnl When crosscompiling, assume putenv is broken. - [case "$host_os" in - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_svid_putenv=3D"guessing yes" ;= ; - # Guess yes on musl systems. - *-musl*) gl_cv_func_svid_putenv=3D"guessing yes" ;= ; - # Guess no on native Windows. - mingw*) gl_cv_func_svid_putenv=3D"guessing no" ;; - # If we don't know, obey --enable-cross-g= uesses. - *) gl_cv_func_svid_putenv=3D"$gl_cross_guess= _normal" ;; - esac - ]) - ]) - case "$gl_cv_func_svid_putenv" in - *yes) ;; - *) - REPLACE_PUTENV=3D1 - ;; - esac -]) - -# Prerequisites of lib/putenv.c. -AC_DEFUN([gl_PREREQ_PUTENV], -[ - AC_CHECK_DECLS([_putenv]) -]) --=20 2.17.1 --------------5BD3AEFCD78E8370DADF5E89-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 22 03:08:05 2020 Received: (at 19874) by debbugs.gnu.org; 22 Jan 2020 08:08:05 +0000 Received: from localhost ([127.0.0.1]:48932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iuB3V-00080d-Fr for submit@debbugs.gnu.org; Wed, 22 Jan 2020 03:08:05 -0500 Received: from aloka.lostca.se ([178.63.46.202]:22258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iuB3P-000809-BG for 19874@debbugs.gnu.org; Wed, 22 Jan 2020 03:08:03 -0500 Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id 2171660C7; Wed, 22 Jan 2020 08:07:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=howrah; bh=FMlfmqTXMob3gql1CUsT9rHroaY=; b=rjAhblAD8QZsvarBGNtkE7uVEAlL gUCCcFGzW4GgF2TidI4+UnsQjkRVoTJBSePAQEt7uYmw3UiNI0s1KZuOwx6m3hTA NhwHG89Wdvm+5+GGOiJtakGA5X9rjJtaegqz23T+3Q9GFhZh7yPxaTPMB4uCjEuX 35ubwjG8s+fuWeM= Received: from [IPv6:2001:983:4097:1:5d3b:f8e8:fd6f:a54f] (unknown [IPv6:2001:983:4097:1:5d3b:f8e8:fd6f:a54f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aloka.lostca.se (Postfix) with ESMTPSA id EE49860C6; Wed, 22 Jan 2020 08:07:57 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: simplifying Emacs configure.ac From: Ashish SHUKLA In-Reply-To: Date: Wed, 22 Jan 2020 09:07:53 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <4C026FAF-AE44-4732-8F3B-1E7FA126BAFC@lostca.se> References: <2972759.yA5RhZVnzj@omega> To: Paul Eggert X-Mailer: Apple Mail (2.3608.40.2.2.4) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19874 Cc: 19874@debbugs.gnu.org, Wolfgang Jenkner , Bruno Haible , Joseph Mingrone X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Jan 19, 2020, at 06:09, Paul Eggert wrote: >=20 > On 1/18/20 5:46 AM, Bruno Haible wrote: >=20 >> This code in Emacs configure.ac: >> # Use the system putenv even if it lacks GNU features, as we don't = need them, >> # and the gnulib replacement runs afoul of a FreeBSD 10.1 bug; see = Bug#19874. >> AC_CHECK_FUNCS_ONCE([putenv]) >> AC_DEFUN([gl_FUNC_PUTENV], >> [test "$ac_cv_func_putenv" =3D yes || REPLACE_PUTENV=3D1]) >> appears to be extra convoluted. All platforms have the putenv = function. >> Therefore REPLACE_PUTENV=3D1 is never executed here. If Emacs does = not need >> the putenv override, the simpler way is to invoke gnulib-tool with >> '--avoid=3Dputenv'. >=20 > Thanks for suggesting that. I installed the attached patch to Emacs = master to implement something along the lines you suggested. I am cc'ing = Ashish Shukla who reported Bug#19874 ("25.0.50; encode-time not working = as expected"), as well as Wolfgang Jenkner who helped debug that, to = give them a heads-up that the fix for Bug#19874 has changed. > <0001-Remove-Gnulib-putenv-code.patch> Hi I just tried Emacs (git revision =E2=80=9C140eb90bc5=E2=80=9D) on = FreeBSD 12.1-RELEASE-p1 (amd64) which includes your commit, and it=E2=80=99= s working as expected. Thanks! -- Ashish | GPG: F682 CDCC 39DC 0FEA E116 20B6 C746 CFA9 E74F A4B0 =E2=80=9CSometimes even to live is an act of courage.=E2=80=9D (Seneca) From unknown Mon Jun 16 23:41:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 19 Feb 2020 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator