(lldb) target create "nextstep/Emacs.app/Contents/MacOS/Emacs" Traceback (most recent call last): File "", line 1, in File "/opt/brew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in import weakref File "/opt/brew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in from _weakref import ( ImportError: cannot import name _remove_dead_weakref Current executable set to 'nextstep/Emacs.app/Contents/MacOS/Emacs' (x86_64). (lldb) b emacs.c:848 Breakpoint 1: where = Emacs`main + 1489 at emacs.c:848, address = 0x000000010014f431 (lldb) run -Q Process 97130 launched: '/Users/kostya/Downloads/emacs-master.git/nextstep/Emacs.app/Contents/MacOS/Emacs' (x86_64) Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x000000010014f431 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:848 845 if (getrlimit (RLIMIT_STACK, &rlim) == 0 846 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= LONG_MAX) 847 { -> 848 rlim_t lim = rlim.rlim_cur; 849 850 /* Approximate the amount regex-emacs.c needs per unit of 851 emacs_re_max_failures, then add 33% to cover the size of the Target 0: (Emacs) stopped. (lldb) e lim (rlim_t) $0 = 0 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f43f Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:854 851 emacs_re_max_failures, then add 33% to cover the size of the 852 smaller stacks that regex-emacs.c successively allocates and 853 discards on its way to the maximum. */ -> 854 int min_ratio = 20 * sizeof (char *); 855 int ratio = min_ratio + min_ratio / 3; 856 857 /* Extra space to cover what we're likely to use for other Target 0: (Emacs) stopped. (lldb) e lim (rlim_t) $1 = 67104768 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f449 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:855 852 smaller stacks that regex-emacs.c successively allocates and 853 discards on its way to the maximum. */ 854 int min_ratio = 20 * sizeof (char *); -> 855 int ratio = min_ratio + min_ratio / 3; 856 857 /* Extra space to cover what we're likely to use for other 858 reasons. For example, a typical GC might take 30K stack Target 0: (Emacs) stopped. (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f478 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:860 857 /* Extra space to cover what we're likely to use for other 858 reasons. For example, a typical GC might take 30K stack 859 frames. */ -> 860 int extra = (30 * 1000) * 50; 861 862 bool try_to_grow_stack = true; 863 #ifndef CANNOT_DUMP Target 0: (Emacs) stopped. (lldb) e min_ratio (int) $2 = 160 (lldb) e ratio (int) $3 = 213 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f482 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:862 859 frames. */ 860 int extra = (30 * 1000) * 50; 861 -> 862 bool try_to_grow_stack = true; 863 #ifndef CANNOT_DUMP 864 try_to_grow_stack = !noninteractive || initialized; 865 #endif Target 0: (Emacs) stopped. (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f489 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:864 861 862 bool try_to_grow_stack = true; 863 #ifndef CANNOT_DUMP -> 864 try_to_grow_stack = !noninteractive || initialized; 865 #endif 866 867 if (try_to_grow_stack) Target 0: (Emacs) stopped. (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f4bd Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:867 864 try_to_grow_stack = !noninteractive || initialized; 865 #endif 866 -> 867 if (try_to_grow_stack) 868 { 869 rlim_t newlim = emacs_re_max_failures * ratio + extra; 870 Target 0: (Emacs) stopped. (lldb) e try_to_grow_stack (bool) $4 = true (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f4d1 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:869 866 867 if (try_to_grow_stack) 868 { -> 869 rlim_t newlim = emacs_re_max_failures * ratio + extra; 870 871 /* Round the new limit to a page boundary; this is needed 872 for Darwin kernel 15.4.0 (see Bug#23622) and perhaps Target 0: (Emacs) stopped. (lldb) e emacs_re_max_failures (size_t) $5 = 6500256977556508423 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f4f0 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:878 875 RLIM_INFINITY etc. since in practice when they are 876 nonnegative they are so large that the code does the 877 right thing anyway. */ -> 878 long pagesize = getpagesize (); 879 newlim += pagesize - 1; 880 if (0 <= rlim.rlim_max && rlim.rlim_max < newlim) 881 newlim = rlim.rlim_max; Target 0: (Emacs) stopped. (lldb) e newlim (rlim_t) $6 = 10020000 (lldb) e emacs_re_max_failures (size_t) $7 = 6500256977556508423 (lldb) e ratio (int) $8 = 213 (lldb) e emacs_re_max_failures * ratio (unsigned long) $9 = 1048930691319922899 (lldb) e emacs_re_max_failures * ratio + extra (unsigned long) $10 = 1048930691321422899 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f503 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:879 876 nonnegative they are so large that the code does the 877 right thing anyway. */ 878 long pagesize = getpagesize (); -> 879 newlim += pagesize - 1; 880 if (0 <= rlim.rlim_max && rlim.rlim_max < newlim) 881 newlim = rlim.rlim_max; 882 newlim -= newlim % pagesize; Target 0: (Emacs) stopped. (lldb) e pagesize (long) $11 = 4096 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f51c Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:880 877 right thing anyway. */ 878 long pagesize = getpagesize (); 879 newlim += pagesize - 1; -> 880 if (0 <= rlim.rlim_max && rlim.rlim_max < newlim) 881 newlim = rlim.rlim_max; 882 newlim -= newlim % pagesize; 883 Target 0: (Emacs) stopped. (lldb) e newlim (rlim_t) $12 = 10024095 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f54b Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:882 879 newlim += pagesize - 1; 880 if (0 <= rlim.rlim_max && rlim.rlim_max < newlim) 881 newlim = rlim.rlim_max; -> 882 newlim -= newlim % pagesize; 883 884 if (pagesize <= newlim - lim) 885 { Target 0: (Emacs) stopped. (lldb) e rlim.rlim_max (rlim_t) $13 = 67104768 (lldb) e newlim (rlim_t) $14 = 10024095 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f56e Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:884 881 newlim = rlim.rlim_max; 882 newlim -= newlim % pagesize; 883 -> 884 if (pagesize <= newlim - lim) 885 { 886 rlim.rlim_cur = newlim; 887 if (setrlimit (RLIMIT_STACK, &rlim) == 0) Target 0: (Emacs) stopped. (lldb) e newlim (rlim_t) $15 = 10022912 (lldb) e newlim - lim (unsigned long long) $16 = 18446744073652469760 (lldb) e lim (rlim_t) $17 = 67104768 (lldb) e newlim (rlim_t) $18 = 10022912 (lldb) e pagesize (long) $19 = 4096 (lldb) e newlim (rlim_t) $20 = 10022912 (lldb) e lim (rlim_t) $21 = 67104768 (lldb) e newlim - lim (unsigned long long) $22 = 18446744073652469760 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f598 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:886 883 884 if (pagesize <= newlim - lim) 885 { -> 886 rlim.rlim_cur = newlim; 887 if (setrlimit (RLIMIT_STACK, &rlim) == 0) 888 lim = newlim; 889 } Target 0: (Emacs) stopped. (lldb) e newlim (rlim_t) $23 = 10022912 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f5a6 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:887 884 if (pagesize <= newlim - lim) 885 { 886 rlim.rlim_cur = newlim; -> 887 if (setrlimit (RLIMIT_STACK, &rlim) == 0) 888 lim = newlim; 889 } 890 } Target 0: (Emacs) stopped. (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f5b4 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:888 885 { 886 rlim.rlim_cur = newlim; 887 if (setrlimit (RLIMIT_STACK, &rlim) == 0) -> 888 lim = newlim; 889 } 890 } 891 /* If the stack is big enough, let regex-emacs.c more of it before Target 0: (Emacs) stopped. (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f5c2 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:889 886 rlim.rlim_cur = newlim; 887 if (setrlimit (RLIMIT_STACK, &rlim) == 0) 888 lim = newlim; -> 889 } 890 } 891 /* If the stack is big enough, let regex-emacs.c more of it before 892 falling back to heap allocation. */ Target 0: (Emacs) stopped. (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f5c7 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:890 887 if (setrlimit (RLIMIT_STACK, &rlim) == 0) 888 lim = newlim; 889 } -> 890 } 891 /* If the stack is big enough, let regex-emacs.c more of it before 892 falling back to heap allocation. */ 893 emacs_re_safe_alloca = max Target 0: (Emacs) stopped. (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f5cc Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:893 890 } 891 /* If the stack is big enough, let regex-emacs.c more of it before 892 falling back to heap allocation. */ -> 893 emacs_re_safe_alloca = max 894 (min (lim - extra, SIZE_MAX) * (min_ratio / ratio), 895 MAX_ALLOCA); 896 } Target 0: (Emacs) stopped. (lldb) e emacs_re_safe_alloca (ptrdiff_t) $24 = 4435280473597425792 (lldb) n Process 97130 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = step over frame #0: 0x000000010014f701 Emacs`main(argc=2, argv=0x00007ffeefbff518) at emacs.c:899 896 } 897 #endif /* HAVE_SETRLIMIT and RLIMIT_STACK and not CYGWIN */ 898 -> 899 clearerr_unlocked (stdin); 900 901 emacs_backtrace (-1); 902 Target 0: (Emacs) stopped. (lldb) e emacs_re_safe_alloca (ptrdiff_t) $25 = 4435280473597425792 (lldb) c Process 97130 resuming 2018-10-02 15:38:55.115287-0700 Emacs[97130:1949757] MessageTracer: Falling back to default whitelist 2018-10-02 15:38:55.225413-0700 Emacs[97130:2016511] flock failed to lock maps file: errno = 35 2018-10-02 15:38:55.227137-0700 Emacs[97130:2016511] flock failed to lock maps file: errno = 35 Process 97130 exited with status = 0 (0x00000000)