From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.devel Subject: Re: Time zone problem in cygwin Date: Thu, 05 Feb 2009 17:36:44 -0500 Message-ID: <498B69FC.4090607@cornell.edu> References: <498AFBE4.2070906@cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233874621 10147 80.91.229.12 (5 Feb 2009 22:57:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 22:57:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 05 23:58:15 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LVDAk-0004EB-FK for ged-emacs-devel@m.gmane.org; Thu, 05 Feb 2009 23:58:14 +0100 Original-Received: from localhost ([127.0.0.1]:50734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVD9R-0007W4-BG for ged-emacs-devel@m.gmane.org; Thu, 05 Feb 2009 17:56:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVCpz-0001mZ-IA for emacs-devel@gnu.org; Thu, 05 Feb 2009 17:36:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVCpx-0001jc-TI for emacs-devel@gnu.org; Thu, 05 Feb 2009 17:36:46 -0500 Original-Received: from [199.232.76.173] (port=44160 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVCpx-0001j9-7R for emacs-devel@gnu.org; Thu, 05 Feb 2009 17:36:45 -0500 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141]:32918 helo=authusersmtp.mail.cornell.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVCpt-0005sy-VV; Thu, 05 Feb 2009 17:36:42 -0500 Original-Received: from [128.84.234.191] (markov.math.cornell.edu [128.84.234.191]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.13.1/8.12.10) with ESMTP id n15MacuO010984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 5 Feb 2009 17:36:39 -0500 (EST) User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108806 Archived-At: On 2/5/2009 3:38 PM, Eli Zaretskii wrote: >> Date: Thu, 05 Feb 2009 09:47:00 -0500 >> From: Ken Brown >> >> http://lists.gnu.org/archive/html/emacs-devel/2008-11/msg00532.html >> >> Eli Zaretskii replied and asked for the value of (format-time-string >> "%Y-%m-%d %T %z"). The OP never responded, but the answer for me is >> the following: emacs 23 incorrectly reports 2009-02-05 13:35:36 -0100, >> whereas emacs 22.3 correctly gives 2009-02-05 09:36:13 -0500 a few >> seconds later. One further detail: emacs 23 gives the right time if I >> set TZ=America/New_York prior to starting emacs; but my understanding is >> that it's not supposed to be necessary to set TZ. > > Unfortunately, I don't have Cygwin installed, so I'm forced to ask > you: can you please step through format-time-string in both Emacs 22.3 > and Emacs 23, and see where does the difference come from? I have virtually no experience with gdb, but I looked at the gdb documentation and made an attempt. I can't make sense of the result. What I did was to look at the C source where format-time-string is defined, and I saw the C function synchronize_system_time_locale nearby. This led me to try the following gdb session: $ gdb /usr/local/bin/emacs [...] (gdb) break synchronize_system_time_locale Breakpoint 1 at 0x4b51c6: file emacs.c, line 2429. (gdb) run -Q Starting program: /usr/local/bin/emacs.exe -Q [New thread 2500.0x1128] [New thread 2500.0xc0c] [New thread 2500.0xddc] [New thread 2500.0x13a0] [New thread 2500.0x1414] [At this point I had emacs evaluate (format-time-string "%Y-%m-%d %T %z"), triggering the breakpoint] Breakpoint 1, synchronize_system_time_locale () at emacs.c:2429 2429 synchronize_locale (LC_TIME, &Vprevious_system_time_locale, I then repeatedly pressed 's' to step through the program, and I didn't see anything interesting, or anything different between emacs 22.3 and emacs 23, so finally I just pressed 'c' to continue. At this point emacs displayed the result of the evaluation, and it gave the correct time! I've rechecked this several times, and emacs 23 gives the right time when it's run under gdb (with or without a breakpoint), and the wrong time otherwise. Do you have any idea what could be going on? If there's anything else I should try under gdb, please give me detailed instructions. As you can see, I don't know much about debugging. > Btw, were both binaries compiled with the same versions of the Cygwin > runtime libraries? I rebuilt emacs 22.3 before trying the debugging above, so I do have two binaries compiled with the same libraries. And it remains true that emacs 22.3 displays the correct time, even when not run under gdb. Ken