Subject: Re: bug#49507: 28.0.50; macOS: Symbol’s value as variable is void: lock-file-name-transforms

From: Naofumi Yasufuku <[email-masked]>
Date: Sun, 11 Jul 2021 04:17:24 +0900

Lars Ingebrigtsen <[email-masked]> writes:

> Naofumi Yasufuku <[email-masked]> writes:
>
>> Precondition:
>> - Repository revision: 9ce6541ac9710933beca7f9944087fe4849d5ae9
>> - macOS
>> - $ mv ~/.emacs.d/eln-cache ~/.emacs.d/eln-cache.old
>>
>> Emacs doesn't start due to the following error:
>>   $ ./src/emacs -Q
>>   Symbol’s value as variable is void: lock-file-name-transforms
>>   $
>
> Try saying "make bootstrap" and see whether the problem goes away.

I've tried "make bootstrap", but it doesn't solve.

I found out that this issue is language environment specific
and not macOS specific.  The same issue can be reproduced under linux
with LANG=ja_JP.UTF-8:

$ LANG=C ./src/emacs -Q
$ LANG=en_US.UTF-8 ./src/emacs -Q
# LANG=ja_JP.UTF-8 ./src/emacs -Q
Symbol’s value as variable is void: lock-file-name-transforms
$

------------------------------------------------------------------------
[naofumi@hyperion src ((9ce6541ac9...))]% gdb emacs
GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin20.3.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from emacs...
SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
DISPLAY = /private/tmp/com.apple.launchd.LJFJOAZgMb/org.xquartz:0
TERM = xterm-256color
Breakpoint 1 at 0x1000d3a00: terminate_due_to_signal. (2 locations)
(gdb) b make_lock_file_name
Breakpoint 2 at 0x100100aa8: make_lock_file_name. (3 locations)
(gdb) r -Q
Starting program: /Users/naofumi/src/git.sv.gnu.org/emacs/src/emacs -Q
[New Thread 0x2303 of process 36192]
[New Thread 0x2203 of process 36192]
warning: unhandled dyld version (17)
[New Thread 0x1907 of process 36192]
[New Thread 0x2003 of process 36192]
[New Thread 0x2103 of process 36192]

Thread 2 hit Breakpoint 2, make_lock_file_name (fn=XIL(0x14562c9a4))
    at filelock.c:625
625	  return call1 (Qmake_lock_file_name, Fexpand_file_name (fn, Qnil));
(gdb) bt
#0  make_lock_file_name (fn=XIL(0x14562c9a4)) at filelock.c:625
#1  lock_file (fn=XIL(0x14562c9a4)) at filelock.c:666
#2  Flock_file (file=XIL(0x14562c9a4)) at filelock.c:755
#3  0x000000010010c9b5 in write_region (start=<optimized out>,
    end=<optimized out>, filename=<optimized out>, append=<optimized out>,
    visit=make_fixnum(0), lockname=<optimized out>, mustbenew=XIL(0), desc=10)
    at fileio.c:5230
#4  0x0000000000000008 in ?? ()
#5  0x00000001460b7400 in ?? ()
#6  0x00007ffeefbfd7e0 in ?? ()
#7  0x00007fff20324131 in ?? ()
#8  0x000000014545e380 in ?? ()
#9  0x000000014545e380 in ?? ()
#10 0x0000000000000008 in ?? ()
#11 0x0000000145466a00 in ?? ()
#12 0x0000000145467e00 in ?? ()
#13 0x0000000000000008 in ?? ()
#14 0x00007ffeefbfd890 in ?? ()
#15 0x00007fff20323937 in ?? ()
#16 0x00007ffeefbfd820 in ?? ()
#17 0xf6b78000c0001002 in ?? ()
#18 0x00007ffeefbfffff in ?? ()
#19 0x00000001001488ef in swap_in_symval_forwarding (symbol=0x14562c9a4,
    blv=0x481b79e8) at data.c:1385
#20 0x00000001481c9980 in ?? ()
#21 0x0000000000001400 in ?? ()
#22 0x00007ffeefbfd840 in ?? ()
#23 0x000000014562c9a4 in ?? ()
#24 0x00000001460be5e0 in ?? ()
#25 0x0000000000000488 in ?? ()
#26 0x0000000000000000 in ?? ()

Lisp Backtrace:
"write-region" (0xefbfdd58)
"comp-run-async-workers" (0xefbfdf10)
"native--compile-async" (0xefbfe180)
"defalias" (0xefbfe250)
"set-language-environment" (0xefbfeac8)
"set-locale-environment" (0xefbfee88)
"normal-top-level" (0xefbfef30)
(gdb) s
Symbol’s value as variable is void: lock-file-name-transforms
[Inferior 1 (process 36192) exited with code 0377]
(gdb) q
[naofumi@hyperion src ((9ce6541ac9...))]%
------------------------------------------------------------------------

Regards,
--Naofumi