Open cooljeanius opened 6 years ago
Fuller output including text printed while dumping:
Loading /Users/ericgallager/emacs/lisp/site-init.el (source)...
Dumping under names emacs and emacs-24.3.50
--- List of All Regions ---
address size prot maxp
0 0x1000 none none
0x1000 0x225000 r x rwx
0x226000 0x1b2000 rw rwx
0x3d8000 0x51000 rw rwx
0x429000 0xc0000 r rwx
0x4e9000 0x8000 r x rwx
0x4f1000 0x1000 rw rwx
0x4f2000 0x3000 r rwx
0x4f5000 0x21000 r x rwx
0x516000 0x1000 rw rwx
0x517000 0x1000 rw rwx
0x518000 0x7000 r rwx
0x51f000 0x1a8000 r x rwx
0x6c7000 is above 0x59e000; we must now be into the shared libraries.
--- List of Regions to be Dumped ---
address size prot maxp
0 0x1000 none none
0x1000 0x225000 r x rwx
0x226000 0x203000 rw rwx
0x429000 0xc0000 r rwx
0x4e9000 0x8000 r x rwx
0x4f1000 0x1000 rw rwx
0x4f2000 0x3000 r rwx
0x4f5000 0x21000 r x rwx
0x516000 0x2000 rw rwx
0x518000 0x7000 r rwx
0x51f000 0x1a8000 r x rwx
--- Header Information ---
Magic = 0xfeedface (32-bit)
CPUType = 7 (i.e. "i386")
CPUSubType = 3 (more specifically, "Intel 80x86")
FileType = 0x2 (demand-paged executable file)
NCmds = 51
SizeOfCmds = 4092
Flags = 0x01000085
Highest address of load commands in input file: 0x4e9000
Lowest offset of all sections in __TEXT segment: 0x2160
--- List of Load Commands in Input File ---
# cmd cmdnum cmdsize segname address size
0 LC_SEGMENT (0x00000001) 56 __PAGEZERO 0 0x1000
1 LC_SEGMENT (0x00000001) 532 __TEXT 0x1000 0x225000
__text 0x3160 0x20242e (flags: 0x80000400)
__text_startup 0x205590 0x19e2 (flags: 0x80000400)
__text_cold 0x206f72 0x8e (flags: 0x80000400)
__symbol_stub 0x207000 0x11fa (flags: 0x80000408)
__stub_helper 0x2081fc 0x1e02 (flags: 0x80000400)
__cstring 0x20a000 0x1a7b7 (flags: 0x2)
__const 0x2247c0 0x1838 (flags: 0)
2 LC_SEGMENT (0x00000001) 940 __DATA 0x226000 0x203000
__dyld 0x226000 0x8 (flags: 0)
__nl_symbol_ptr 0x226008 0x910 (flags: 0x6)
__la_symbol_ptr 0x226918 0xbfc (flags: 0x7)
__data 0x227520 0x1ae760 (flags: 0)
__static_data 0x3d5c80 0x26 (flags: 0)
__const 0x3d5cc0 0x20f8 (flags: 0)
__bss3 0x3d7db8 0x30 (flags: 0x1)
__bss5 0x3d7e00 0x4b340 (flags: 0x1)
__pu_bss2 0x423140 0x830 (flags: 0x1)
__pu_bss5 0x423980 0x2194 (flags: 0x1)
__pu_bss3 0x425b18 0x408 (flags: 0x1)
__common 0x425f20 0x34 (flags: 0x1)
__bss2 0x425f54 0x25f0 (flags: 0x1)
3 LC_SEGMENT (0x00000001) 56 __LINKEDIT 0x429000 0xc0000
4 LC_DYLD_INFO_ONLY (0x80000022) 48
5 LC_SYMTAB (0x00000002) 24
6 LC_DYSYMTAB (0x0000000b) 80
7 LC_LOAD_DYLINKER (0x0000000e) 28
8 LC_UUID (0x0000001b) 24
9 LC_VERSION_MIN_MACOSX (0x00000024) 16
10 LC_UNIXTHREAD (0x00000005) 80
11 LC_LOAD_DYLIB (0x0000000c) 48
12 LC_LOAD_DYLIB (0x0000000c) 52
13 LC_LOAD_DYLIB (0x0000000c) 52
14 LC_LOAD_DYLIB (0x0000000c) 48
15 LC_LOAD_DYLIB (0x0000000c) 48
16 LC_LOAD_DYLIB (0x0000000c) 52
17 LC_LOAD_DYLIB (0x0000000c) 52
18 LC_LOAD_DYLIB (0x0000000c) 48
19 LC_LOAD_DYLIB (0x0000000c) 56
20 LC_LOAD_DYLIB (0x0000000c) 48
21 LC_LOAD_DYLIB (0x0000000c) 56
22 LC_LOAD_DYLIB (0x0000000c) 56
23 LC_LOAD_DYLIB (0x0000000c) 56
24 LC_LOAD_DYLIB (0x0000000c) 56
25 LC_LOAD_DYLIB (0x0000000c) 56
26 LC_LOAD_DYLIB (0x0000000c) 56
27 LC_LOAD_DYLIB (0x0000000c) 56
28 LC_LOAD_DYLIB (0x0000000c) 60
29 LC_LOAD_DYLIB (0x0000000c) 56
30 LC_LOAD_DYLIB (0x0000000c) 52
31 LC_LOAD_DYLIB (0x0000000c) 52
32 LC_LOAD_DYLIB (0x0000000c) 60
33 LC_LOAD_DYLIB (0x0000000c) 56
34 LC_LOAD_DYLIB (0x0000000c) 52
35 LC_LOAD_DYLIB (0x0000000c) 104
36 LC_LOAD_DYLIB (0x0000000c) 52
37 LC_LOAD_DYLIB (0x0000000c) 52
38 LC_LOAD_DYLIB (0x0000000c) 60
39 LC_LOAD_DYLIB (0x0000000c) 60
40 LC_LOAD_DYLIB (0x0000000c) 60
41 LC_LOAD_DYLIB (0x0000000c) 48
42 LC_LOAD_DYLIB (0x0000000c) 60
43 LC_LOAD_DYLIB (0x0000000c) 52
44 LC_LOAD_DYLIB (0x0000000c) 68
45 LC_LOAD_DYLIB (0x0000000c) 72
46 LC_LOAD_DYLIB (0x0000000c) 48
47 LC_LOAD_DYLIB (0x0000000c) 60
48 LC_LOAD_DYLIB (0x0000000c) 56
49 LC_LOAD_DYLIB (0x0000000c) 56
50 LC_FUNCTION_STARTS (0x00000026) 16
0xc6fc080 (sz: 0x3f1c/ 0x3f20) (0 to go in this loop)
0xc600000 (sz: 0x40831/ 0xfc080) (0 to go in this loop)
0xcff8000 (sz: 0x5036/ 0x7f98) (0 to go in this loop)
0xc800000 (sz: 0x501bff/0x7f8000) (0 to go in this loop)
0xc54a000 (sz: 0/ 0x1000) (0 to go in this loop)
Region 1: removed 1000 zerod bytes from filesize
Page ( 0x1000) aligning region @0xc600000 size from 0xfc080 to 0xfd000
Page ( 0x1000) aligning region @0xc6fc000 size from 0x3fa0 to 0x4000
Region 4: removed 2f6401 zerod bytes from filesize
Page ( 0x1000) aligning region @0xcff8000 size from 0x7f98 to 0x8000
Region 5: removed 2000 zerod bytes from filesize
--- Load Commands written to Output File ---
Writing segment __PAGEZERO @ 0 ( 0/ 0x1000 @ 0)
Writing segment __TEXT @ 0 (0x225000/ 0x225000 @ 0x1000)
Writing segment __DATA @ 0x225000 (0x203000/ 0x203000 @ 0x226000)
section __dyld at 0x225000 - 0x225008 (sz: 0x8), with type 0x00 (regular)
section __nl_symbol_ptr at 0x225008 - 0x225918 (sz: 0x910), with type 0x06 (non-lazy symbol pointers)
section __la_symbol_ptr at 0x225918 - 0x226514 (sz: 0xbfc), with type 0x07 (lazy symbol pointers)
section __data at 0x226520 - 0x3d4c80 (sz: 0x1ae760), with type 0x00 (regular)
section __static_data at 0x3d4c80 - 0x3d4ca6 (sz: 0x26), with type 0x00 (regular)
section __const at 0x3d4cc0 - 0x3d6db8 (sz: 0x20f8), with type 0x00 (regular)
section __bss3 at 0x3d6db8 - 0x3d6de8 (sz: 0x30), with type 0x01 (zerofill)
section __bss5 at 0x3d6e00 - 0x422140 (sz: 0x4b340), with type 0x01 (zerofill)
section __pu_bss2 at 0x422140 - 0x422970 (sz: 0x830), with type 0x01 (zerofill)
section __pu_bss5 at 0x422980 - 0x424b14 (sz: 0x2194), with type 0x01 (zerofill)
section __pu_bss3 at 0x424b18 - 0x424f20 (sz: 0x408), with type 0x01 (zerofill)
section __common at 0x424f20 - 0x424f54 (sz: 0x34), with type 0x01 (zerofill)
section __bss2 at 0x424f54 - 0x427544 (sz: 0x25f0), with type 0x01 (zerofill)
Section sizes in this segment added up to 0x2024f2, which is less than its vmsize of 0x203000.
Writing segment __DATA @ 0x428000 ( 0/ 0x1000 @ 0xc54a000)
Writing segment __DATA @ 0x428000 ( 0xfd000/ 0xfd000 @ 0xc600000)
Writing segment __DATA @ 0x525000 ( 0x4000/ 0x4000 @ 0xc6fc000)
Writing segment __DATA @ 0x529000 (0x501bff/ 0x7f8000 @ 0xc800000)
Writing segment __DATA @ 0xa2b000 ( 0x6000/ 0x8000 @ 0xcff8000)
Total filesize of new __DATA segments written: 6327295
Writing segment __LINKEDIT @ 0xa31000 ( 0xbfb94/ 0xc0000 @ 0x429000)
Writing LC_DYLD_INFO_ONLY (0x80000022) command ( 5)
Writing LC_SYMTAB command ( 6)
Writing LC_DYSYMTAB command ( 7)
Writing LC_LOAD_DYLINKER (0x0000000e) command ( 8)
Writing LC_UUID (0x0000001b) command ( 9)
Writing LC_VERSION_MIN_MACOSX (0x00000024) command (10)
Writing LC_UNIXTHREAD (0x00000005) command (11)
Writing LC_LOAD_DYLIB (0x0000000c) command (12)
Writing LC_LOAD_DYLIB (0x0000000c) command (13)
Writing LC_LOAD_DYLIB (0x0000000c) command (14)
Writing LC_LOAD_DYLIB (0x0000000c) command (15)
Writing LC_LOAD_DYLIB (0x0000000c) command (16)
Writing LC_LOAD_DYLIB (0x0000000c) command (17)
Writing LC_LOAD_DYLIB (0x0000000c) command (18)
Writing LC_LOAD_DYLIB (0x0000000c) command (19)
Writing LC_LOAD_DYLIB (0x0000000c) command (20)
Writing LC_LOAD_DYLIB (0x0000000c) command (21)
Writing LC_LOAD_DYLIB (0x0000000c) command (22)
Writing LC_LOAD_DYLIB (0x0000000c) command (23)
Writing LC_LOAD_DYLIB (0x0000000c) command (24)
Writing LC_LOAD_DYLIB (0x0000000c) command (25)
Writing LC_LOAD_DYLIB (0x0000000c) command (26)
Writing LC_LOAD_DYLIB (0x0000000c) command (27)
Writing LC_LOAD_DYLIB (0x0000000c) command (28)
Writing LC_LOAD_DYLIB (0x0000000c) command (29)
Writing LC_LOAD_DYLIB (0x0000000c) command (30)
Writing LC_LOAD_DYLIB (0x0000000c) command (31)
Writing LC_LOAD_DYLIB (0x0000000c) command (32)
Writing LC_LOAD_DYLIB (0x0000000c) command (33)
Writing LC_LOAD_DYLIB (0x0000000c) command (34)
Writing LC_LOAD_DYLIB (0x0000000c) command (35)
Writing LC_LOAD_DYLIB (0x0000000c) command (36)
Writing LC_LOAD_DYLIB (0x0000000c) command (37)
Writing LC_LOAD_DYLIB (0x0000000c) command (38)
Writing LC_LOAD_DYLIB (0x0000000c) command (39)
Writing LC_LOAD_DYLIB (0x0000000c) command (40)
Writing LC_LOAD_DYLIB (0x0000000c) command (41)
Writing LC_LOAD_DYLIB (0x0000000c) command (42)
Writing LC_LOAD_DYLIB (0x0000000c) command (43)
Writing LC_LOAD_DYLIB (0x0000000c) command (44)
Writing LC_LOAD_DYLIB (0x0000000c) command (45)
Writing LC_LOAD_DYLIB (0x0000000c) command (46)
Writing LC_LOAD_DYLIB (0x0000000c) command (47)
Writing LC_LOAD_DYLIB (0x0000000c) command (48)
Writing LC_LOAD_DYLIB (0x0000000c) command (49)
Writing LC_LOAD_DYLIB (0x0000000c) command (50)
Writing LC_FUNCTION_STARTS (0x00000026) command (51)
4144 unused bytes follow Mach-O header
returning to loadup.el; 46012 pure bytes used while dumping
emacs -> bootstrap-emacs
if test "x/opt/local/bin/machocheck" != "x"; then \
/opt/local/bin/machocheck -progress bootstrap-emacs; \
fi
ok: bootstrap-emacs
if test "xdsymutil" != "x"; then \
dsymutil bootstrap-emacs; \
fi
Compiling some files earlier to speed up further compilation.
cd ../lisp; make compile-first EMACS="../src/bootstrap-emacs"
Compiling /Users/ericgallager/emacs/lisp/emacs-lisp/macroexp.el to /Users/ericgallager/emacs/lisp/emacs-lisp/macroexp.elc
EMACSLOADPATH='.' '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval "(setq max-lisp-eval-depth 2200)" --eval '(setq load-prefer-newer t)' \
-f batch-byte-compile /Users/ericgallager/emacs/lisp/emacs-lisp/macroexp.el
make[2]: *** [/Users/ericgallager/emacs/lisp/emacs-lisp/macroexp.elc] Segmentation fault
make[1]: *** [bootstrap-emacs] Error 2
make: *** [src] Error 2
Crash log from the shell doesn't tell much: sh_2018-01-22-184255_Eric-Gallagers-MacBook-Pro.crash.txt
issue #2 might need fixing first actually
currently I'm waiting on macports/macports-ports#18956 to be merged so that I can check out the ld64 sources for some isemacsvalid
updates... can someone please help?
(just phrasing that as a question so that I can add the "question" tag)
currently I'm waiting on macports/macports-ports#18956 to be merged so that I can check out the ld64 sources for some
isemacsvalid
updates... can someone please help? (just phrasing that as a question so that I can add the "question" tag)
OK so that PR is now merged, so I've updated the machochecker sources for isemacsvalid
, and it looks like the current issue isn't actually with the executable being invalid after all, but rather a legit code error that's probably due to malloc
/free
getting redefined somewhere:
Running ./temacs for bootstrapping
emacs.c, line 728: Hello.
unexmacosx.c, line 2280: zone created: 0x105537000.
In sort_args: pointers to attempt to free: options: 0x1068040c8, new: 0x106804098, and priority: 0x1068040e8.
temacs(53296,0x10e6cae00) malloc: *** error for object 0x1068040c8: pointer being freed was not allocated
temacs(53296,0x10e6cae00) malloc: *** set a breakpoint in malloc_error_break to debug
/bin/sh: line 1: 53296 Abort trap: 6 ./temacs --batch --load loadup bootstrap
make[1]: *** [bootstrap-emacs] Error 1
make: *** [src] Error 2
...but the pointer in question (options
), was actually created by xnmalloc
earlier in the function, so idk what it's talking about when it says it wasn't allocated:
https://github.com/cooljeanius/emacs/blob/ab9e250ae4db0857d26a6af0bb4c41e04355b7e9/src/emacs.c#L1876
trying to bootstrap results in:
When debugging in gdb, the debugger can't handle it either:
The odd thing is, though, that machocheck/isemacsvalid says the executable is okay...
...so, I'm not sure if the error is coming from the darwin
arch
executable, or darwin's libc, or the shell, or what. I've tried building my own gdb with--disable-arch-for-exec
but that has its own issues...(Note: I formerly had a bounty for this on BountySource, but then I deleted my BountySource account due to bad interactions with them on Twitter, so now if you are interested in a bounty, contact me separately to find a way to do it outside of their system)