Subject: bug#27736: OSX 10.6.8: Building from master branch fails.

From: "Charles A. Roelli" <[email-masked]>
Date: Wed, 19 Jul 2017 21:58:03 +0200

Err, oops: I guess there will be no patch for this in Lisp, since 
decode-time is written in C.

So the choice is either to make a change in lib/time_rz.c or src/editfns.c.

On 18/07/2017 20:42, Charles A. Roelli wrote:
> Thanks for checking this so quickly.
>
> It looks like your machine also enters an infinite loop when
> evaluating the same form that I posted here:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27706#5
>
> I'm not sure where we should patch this issue: in Lisp, in
> lib/time_rz.c (which is part of gnulib if I remember right), or in
> src/editfns.c (emacs_localtime_rz).  Does anyone have an opinion about
> this?
>
>
> On 18/07/2017 18:07, Keith David Bershatsky wrote:
>> Thank you, Eli, for teaching me about:
>>
>>> "pp" is defined in src/.gdbinit.  You need to tell GDB to read it:
>>>
>>>    (gdb) source /path/to/emacs/src/.gdbinit
>> Here is a new backtrace for the frame that deals with decode_time:
>>
>> (gdb) frame 10
>> #10 0x00000001001e9746 in Fdecode_time (specified_time={i = 
>> 4351999171}, zone={i = 0}) at editfns.c:2163
>> 2163      struct tm *tm = emacs_localtime_rz (tz, &time_spec, 
>> &local_tm);
>> (gdb) pp specified_time
>> (-1034058203136 0)
>>
>> And, here is the whole thing:
>>
>> Last login: Tue Jul 18 08:48:40 on console
>>
>> server:emacs HOME$ gdb /Users/HOME/Desktop/emacs/src/emacs
>>
>> GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 
>> UTC 2009)
>> Copyright 2004 Free Software Foundation, Inc.
>> GDB is free software, covered by the GNU General Public License, and 
>> you are
>> welcome to change it and/or distribute copies of it under certain 
>> conditions.
>> Type "show copying" to see the conditions.
>> There is absolutely no warranty for GDB.  Type "show warranty" for 
>> details.
>> This GDB was configured as "x86_64-apple-darwin"...Reading symbols 
>> for shared libraries ........... done
>>
>> (gdb) source /Users/HOME/Desktop/emacs/src/.gdbinit
>> Warning: /Users/HOME/Desktop/emacs/../lwlib: No such file or directory.
>> DISPLAY = /tmp/launch-uSoMoF/org.x:0
>> TERM = xterm-color
>> Breakpoint 1 at 0x100134c52: file emacs.c, line 364.
>> Breakpoint 2 at 0x100162889: file sysdep.c, line 1016.
>> /Users/HOME/Desktop/emacs/src/.gdbinit:1273: Error in sourced command 
>> file:
>> Undefined command: "python".  Try "help".
>> (gdb) run -batch --no-site-file --no-site-lisp --eval '(setq 
>> load-prefer-newer t)' -f batch-byte-compile 
>> /Users/HOME/Desktop/emacs/lisp/org/org-timer.el
>> Starting program: /Users/HOME/Desktop/emacs/src/emacs -batch 
>> --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -f 
>> batch-byte-compile /Users/HOME/Desktop/emacs/lisp/org/org-timer.el
>> Reading symbols for shared libraries 
>> .++++++++++............................................................................... 
>> done
>> ^C
>> Breakpoint 1, terminate_due_to_signal (sig=2, backtrace_limit=40) at 
>> emacs.c:364
>> 364      signal (sig, SIG_DFL);
>> (gdb) bt
>> #0  terminate_due_to_signal (sig=2, backtrace_limit=40) at emacs.c:364
>> #1  0x0000000100163bdc in handle_fatal_signal (sig=Could not find the 
>> frame base for "handle_fatal_signal".
>> ) at sysdep.c:1714
>> #2  0x0000000100163b10 in deliver_process_signal (sig=2, 
>> handler=0x100163bc4 <handle_fatal_signal>) at sysdep.c:1654
>> #3  0x0000000100163bf6 in deliver_fatal_signal (sig=2) at sysdep.c:1720
>> #4  <signal handler called>
>> #5  0x00007fff87007b0a in timesub ()
>> #6  0x00007fff8700781c in _st_localsub ()
>> #7  0x00007fff87010d71 in localtime_r ()
>> #8  0x00000001002f5696 in localtime_rz (tz=0x101000f90, 
>> t=0x7fff5fbf9498, tm=0x7fff5fbf93c0) at time_rz.c:296
>> #9  0x00000001001e3afd in emacs_localtime_rz (tz=0x101000f90, 
>> t=0x7fff5fbf9498, tm=0x7fff5fbf93c0) at editfns.c:103
>> #10 0x00000001001e9746 in Fdecode_time (specified_time={i = 
>> 4351999171}, zone={i = 0}) at editfns.c:2163
>> #11 0x000000010020183b in funcall_subr (subr=0x1007bcdd8, numargs=1, 
>> args=0x7fff5fbf9608) at eval.c:2817
>> #12 0x000000010020133c in Ffuncall (nargs=2, args=0x7fff5fbf9600) at 
>> eval.c:2740
>> #13 0x000000010025ad5d in exec_byte_code (bytestr={i = 4333399444}, 
>> vector={i = 4352860773}, maxdepth={i = 18}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbf9a08) at bytecode.c:629
>> #14 0x0000000100201fe7 in funcall_lambda (fun={i = 4352860813}, 
>> nargs=1, arg_vector=0x7fff5fbf9a00) at eval.c:2941
>> #15 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbf99f8) at 
>> eval.c:2742
>> #16 0x000000010025ad5d in exec_byte_code (bytestr={i = 4333399380}, 
>> vector={i = 4352860677}, maxdepth={i = 42}, args_template={i = 3086}, 
>> nargs=3, args=0x7fff5fbf9e30) at bytecode.c:629
>> #17 0x0000000100201fe7 in funcall_lambda (fun={i = 4352860725}, 
>> nargs=3, arg_vector=0x7fff5fbf9e18) at eval.c:2941
>> #18 0x0000000100201374 in Ffuncall (nargs=4, args=0x7fff5fbf9e10) at 
>> eval.c:2742
>> #19 0x000000010025ad5d in exec_byte_code (bytestr={i = 4333399348}, 
>> vector={i = 4352860861}, maxdepth={i = 46}, args_template={i = 0}, 
>> nargs=0, args=0x0) at bytecode.c:629
>> #20 0x0000000100259e7b in Fbyte_code (bytestr={i = 4333399348}, 
>> vector={i = 4352860861}, maxdepth={i = 46}) at bytecode.c:321
>> #21 0x00000001001ffac1 in eval_sub (form={i = 4352004051}) at 
>> eval.c:2222
>> #22 0x00000001001fb503 in Fdefconst (args={i = 4352004099}) at 
>> eval.c:809
>> #23 0x00000001001ff63a in eval_sub (form={i = 4352004115}) at 
>> eval.c:2169
>> #24 0x0000000100239455 in readevalloop (readcharfun={i = 24096}, 
>> infile0=0x7fff5fbfa750, sourcename={i = 4330661364}, printflag=false, 
>> unibyte={i = 0}, readfun={i = 0}, start={i = 0}, end={i = 0}) at 
>> lread.c:2038
>> #25 0x0000000100237532 in Fload (file={i = 4331687524}, noerror={i = 
>> 0}, nomessage={i = 45360}, nosuffix={i = 0}, must_suffix={i = 45360}) 
>> at lread.c:1425
>> #26 0x0000000100210444 in Frequire (feature={i = 42008288}, 
>> filename={i = 0}, noerror={i = 0}) at fns.c:2801
>> #27 0x000000010020186f in funcall_subr (subr=0x1007bed48, numargs=1, 
>> args=0x7fff5fbfacd0) at eval.c:2820
>> #28 0x000000010020133c in Ffuncall (nargs=2, args=0x7fff5fbfacc8) at 
>> eval.c:2740
>> #29 0x0000000100200087 in Fapply (nargs=2, args=0x7fff5fbfacc8) at 
>> eval.c:2328
>> #30 0x00000001002016cc in funcall_subr (subr=0x1007bda88, numargs=2, 
>> args=0x7fff5fbfacc8) at eval.c:2795
>> #31 0x000000010020133c in Ffuncall (nargs=3, args=0x7fff5fbfacc0) at 
>> eval.c:2740
>> #32 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330679892}, 
>> vector={i = 4455527021}, maxdepth={i = 38}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfb138) at bytecode.c:629
>> #33 0x0000000100201fe7 in funcall_lambda (fun={i = 4455527189}, 
>> nargs=1, arg_vector=0x7fff5fbfb130) at eval.c:2941
>> #34 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfb128) at 
>> eval.c:2742
>> #35 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330678964}, 
>> vector={i = 4455517957}, maxdepth={i = 18}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfb530) at bytecode.c:629
>> #36 0x0000000100201fe7 in funcall_lambda (fun={i = 4455518005}, 
>> nargs=1, arg_vector=0x7fff5fbfb528) at eval.c:2941
>> #37 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfb520) at 
>> eval.c:2742
>> #38 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330678836}, 
>> vector={i = 4455517813}, maxdepth={i = 22}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfb918) at bytecode.c:629
>> #39 0x0000000100201fe7 in funcall_lambda (fun={i = 4455517861}, 
>> nargs=1, arg_vector=0x7fff5fbfb910) at eval.c:2941
>> #40 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfb908) at 
>> eval.c:2742
>> #41 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330662116}, 
>> vector={i = 4455466989}, maxdepth={i = 42}, args_template={i = 2058}, 
>> nargs=2, args=0x7fff5fbfbd38) at bytecode.c:629
>> #42 0x0000000100201fe7 in funcall_lambda (fun={i = 4455467093}, 
>> nargs=2, arg_vector=0x7fff5fbfbd28) at eval.c:2941
>> #43 0x0000000100201374 in Ffuncall (nargs=3, args=0x7fff5fbfbd20) at 
>> eval.c:2742
>> #44 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330678804}, 
>> vector={i = 4455495149}, maxdepth={i = 18}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfc108) at bytecode.c:629
>> #45 0x0000000100201fe7 in funcall_lambda (fun={i = 4455517909}, 
>> nargs=1, arg_vector=0x7fff5fbfc100) at eval.c:2941
>> #46 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfc0f8) at 
>> eval.c:2742
>> #47 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330676260}, 
>> vector={i = 4455508293}, maxdepth={i = 42}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfc580) at bytecode.c:629
>> #48 0x0000000100201fe7 in funcall_lambda (fun={i = 4455508517}, 
>> nargs=1, arg_vector=0x7fff5fbfc578) at eval.c:2941
>> #49 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfc570) at 
>> eval.c:2742
>> #50 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330676164}, 
>> vector={i = 4455512637}, maxdepth={i = 70}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfcad8) at bytecode.c:629
>> #51 0x0000000100201fe7 in funcall_lambda (fun={i = 4455508565}, 
>> nargs=1, arg_vector=0x7fff5fbfcad0) at eval.c:2941
>> #52 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfcac8) at 
>> eval.c:2742
>> #53 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330675236}, 
>> vector={i = 4455503421}, maxdepth={i = 66}, args_template={i = 2054}, 
>> nargs=1, args=0x7fff5fbfd0a0) at bytecode.c:629
>> #54 0x0000000100201fe7 in funcall_lambda (fun={i = 4455504133}, 
>> nargs=1, arg_vector=0x7fff5fbfd098) at eval.c:2941
>> #55 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfd090) at 
>> eval.c:2742
>> #56 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330698708}, 
>> vector={i = 4455656013}, maxdepth={i = 34}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfd4f8) at bytecode.c:629
>> #57 0x0000000100201fe7 in funcall_lambda (fun={i = 4455647189}, 
>> nargs=1, arg_vector=0x7fff5fbfd4f0) at eval.c:2941
>> #58 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfd4e8) at 
>> eval.c:2742
>> #59 0x000000010025ad5d in exec_byte_code (bytestr={i = 4330698612}, 
>> vector={i = 4455660765}, maxdepth={i = 42}, args_template={i = 1026}, 
>> nargs=0, args=0x7fff5fbfd9e8) at bytecode.c:629
>> #60 0x0000000100201fe7 in funcall_lambda (fun={i = 4455647141}, 
>> nargs=0, arg_vector=0x7fff5fbfd9e8) at eval.c:2941
>> #61 0x0000000100201374 in Ffuncall (nargs=1, args=0x7fff5fbfd9e0) at 
>> eval.c:2742
>> #62 0x000000010025ad5d in exec_byte_code (bytestr={i = 4299934692}, 
>> vector={i = 4299934725}, maxdepth={i = 94}, args_template={i = 1030}, 
>> nargs=1, args=0x7fff5fbfe288) at bytecode.c:629
>> #63 0x0000000100201fe7 in funcall_lambda (fun={i = 4299934645}, 
>> nargs=1, arg_vector=0x7fff5fbfe280) at eval.c:2941
>> #64 0x0000000100201374 in Ffuncall (nargs=2, args=0x7fff5fbfe278) at 
>> eval.c:2742
>> #65 0x000000010025ad5d in exec_byte_code (bytestr={i = 4299912628}, 
>> vector={i = 4299912661}, maxdepth={i = 86}, args_template={i = 2}, 
>> nargs=0, args=0x7fff5fbfedb8) at bytecode.c:629
>> #66 0x0000000100201fe7 in funcall_lambda (fun={i = 4299912581}, 
>> nargs=0, arg_vector=0x7fff5fbfedb8) at eval.c:2941
>> #67 0x0000000100201374 in Ffuncall (nargs=1, args=0x7fff5fbfedb0) at 
>> eval.c:2742
>> #68 0x000000010025ad5d in exec_byte_code (bytestr={i = 4299908964}, 
>> vector={i = 4299908997}, maxdepth={i = 50}, args_template={i = 2}, 
>> nargs=0, args=0x7fff5fbff2f0) at bytecode.c:629
>> #69 0x0000000100201fe7 in funcall_lambda (fun={i = 4299908917}, 
>> nargs=0, arg_vector=0x7fff5fbff2f0) at eval.c:2941
>> #70 0x0000000100201c16 in apply_lambda (fun={i = 4299908917}, args={i 
>> = 0}, count=4) at eval.c:2877
>> #71 0x00000001001ffc89 in eval_sub (form={i = 4379235827}) at 
>> eval.c:2261
>> #72 0x00000001001fef96 in Feval (form={i = 4379235827}, lexical={i = 
>> 0}) at eval.c:2038
>> #73 0x0000000100139c2c in top_level_2 () at keyboard.c:1123
>> #74 0x00000001001fd0d8 in internal_condition_case (bfun=0x100139c08 
>> <top_level_2>, handlers={i = 18528}, hfun=0x100139519 <cmd_error>) at 
>> eval.c:1319
>> #75 0x0000000100139c78 in top_level_1 (ignore={i = 0}) at 
>> keyboard.c:1131
>> #76 0x00000001001fc551 in internal_catch (tag={i = 46944}, 
>> func=0x100139c2e <top_level_1>, arg={i = 0}) at eval.c:1084
>> #77 0x0000000100139b4d in command_loop () at keyboard.c:1092
>> #78 0x0000000100138fb0 in recursive_edit_1 () at keyboard.c:699
>> #79 0x00000001001391c7 in Frecursive_edit () at keyboard.c:770
>> #80 0x0000000100136cdc in main (argc=9, argv=0x7fff5fbff8e8) at 
>> emacs.c:1706
>>
>> Lisp Backtrace:
>> "decode-time" (0x5fbf9608)
>> 0x3736288 PVEC_COMPILED
>> 0x3736230 PVEC_COMPILED
>> "byte-code" (0x5fbfa140)
>> "defconst" (0x5fbfa3e0)
>> "require" (0x5fbfacd0)
>> "apply" (0x5fbfacc8)
>> "byte-compile-file-form-require" (0x5fbfb130)
>> "byte-compile-file-form" (0x5fbfb528)
>> 0x991cea0 PVEC_COMPILED
>> "byte-compile-recurse-toplevel" (0x5fbfbd28)
>> "byte-compile-toplevel-file-form" (0x5fbfc100)
>> 0x991aa20 PVEC_COMPILED
>> "byte-compile-from-buffer" (0x5fbfcad0)
>> "byte-compile-file" (0x5fbfd098)
>> "batch-byte-compile-file" (0x5fbfd4f0)
>> "batch-byte-compile" (0x5fbfd9e8)
>> "command-line-1" (0x5fbfe280)
>> "command-line" (0x5fbfedb8)
>> "normal-top-level" (0x5fbff2f0)
>> (gdb) select 5
>> (gdb) frame 5
>> #5  0x00007fff87007b0a in timesub ()
>> (gdb) frame 10
>> #10 0x00000001001e9746 in Fdecode_time (specified_time={i = 
>> 4351999171}, zone={i = 0}) at editfns.c:2163
>> 2163      struct tm *tm = emacs_localtime_rz (tz, &time_spec, 
>> &local_tm);
>> (gdb) pp specified_time
>> (-1034058203136 0)
>> (gdb)
>