Subject: 23.0.60; configure using faulty defaults, causing failure to build temacs?

From: Peter Dyballa <[email-masked]>
Date: Sun, 3 Aug 2008 16:02:01 +0200

Hello!

I tried to find out how it comes that Mac OS X framworks are getting  
used. They are introduced from Fink's libotf.pc and freetype2.pc.  
Resetting PKG_CONFIG_PATH I could avoid using the two PC files.  
Temacs was built:

	gcc -I/sw/include -L/sw/lib -prebind -Xlinker -headerpad -Xlinker  
690 -multiply_defined suppress -L/sw/lib/ncurses -L/sw/lib -L/usr/ 
local/lib -L/usr/X11R6/lib -L/usr/X11R6/lib -o temacs pre-crt0.o  
dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o  
coding.o category.o ccl.o character.o chartab.o cm.o term.o  
terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o fontset.o  
xsmfns.o fringe.o image.o dbusbind.o emacs.o keyboard.o macros.o  
keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o  
fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o  
search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o  
eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexmacosx.o  
bytecode.o process.o callproc.o region-cache.o sound.o atimer.o  
doprnt.o strftime.o intervals.o textprop.o composite.o md5.o xfont.o  
ftfont.o xftfont.o ftxfont.o terminfo.o lastfile.o widget.o ../lwlib/ 
liblw.a -L/usr/X11R6/lib -lXaw3d -lXmu -lXt -lSM -lICE -lXext -ltiff - 
ljpeg -lpng -lz -lm -lgif -lXpm -lX11 -L/sw/lib/fontconfig2/lib -L/ 
usr/X11R6/lib -lXft -lfreetype -lXrender -lfontconfig -L/sw/lib - 
lrsvg-2 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 - 
lintl -liconv -L/sw/lib -ldbus-1 -lresolv -lncurses

(and also in another try without -L/sw/lib/fontconfig2/lib).

Temacs died both times with:

	cd ../lisp; make -k update-subdirs
	wd=.../emacs/lisp; subdirs=`(cd $wd; find . -type d -print)`; for  
file in $subdirs; do case $file in */Old | */RCS | */CVS | */CVS/* |  
*/.* | */.*/* | */=* ) ;; *) wins="$wins $wd/$file" ;; esac; done; \
	for file in $wins; do \
	   .../emacs/lisp/../update-subdirs $file; \
	done;
	`/bin/pwd`/temacs --batch --load loadup bootstrap
	make[1]: *** [bootstrap-emacs] Bus error
	make[1]: Target `all' not remade because of errors.
	make: *** [src] Error 2
	make: Target `all' not remade because of errors.

Both times temacs was using these libraries:

	/sw/lib/libdbus-1.3.dylib (compatibility version 6.0.0, current  
version 6.0.0)
	/sw/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 1201.0.0,  
current version 1201.10.0)
	/sw/lib/libgif.4.dylib (compatibility version 6.0.0, current version  
6.4.0)
	/sw/lib/libglib-2.0.0.dylib (compatibility version 1401.0.0, current  
version 1401.6.0)
	/sw/lib/libgmodule-2.0.0.dylib (compatibility version 1401.0.0,  
current version 1401.6.0)
	/sw/lib/libgobject-2.0.0.dylib (compatibility version 1401.0.0,  
current version 1401.6.0)
	/sw/lib/libiconv.2.dylib (compatibility version 7.0.0, current  
version 7.0.0)
	/sw/lib/libintl.3.dylib (compatibility version 8.0.0, current  
version 8.3.0)
	/sw/lib/libjpeg.62.dylib (compatibility version 63.0.0, current  
version 63.0.0)
	/sw/lib/libpng12.0.dylib (compatibility version 30.0.0, current  
version 30.0.0)
	/sw/lib/librsvg-2.2.dylib (compatibility version 23.0.0, current  
version 23.0.0)
	/sw/lib/libtiff.3.dylib (compatibility version 12.0.0, current  
version 12.2.0)
	/sw/lib/libXaw3d.7.dylib (compatibility version 7.0.0, current  
version 7.0.0)
	/sw/lib/ncurses/libncurses.5.dylib (compatibility version 5.0.0,  
current version 5.0.0)
	/usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version  
92.0.0)
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current  
version 369.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
version 88.1.11)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version  
1.2.3)
	/usr/X11R6/lib/libfontconfig.1.dylib (compatibility version 1.0.0,  
current version 1.0.0)
	/usr/X11R6/lib/libfreetype.6.dylib (compatibility version 6.3.0,  
current version 6.3.0)
	/usr/X11R6/lib/libICE.6.dylib (compatibility version 6.3.0, current  
version 6.3.0)
	/usr/X11R6/lib/libSM.6.dylib (compatibility version 6.0.0, current  
version 6.0.0)
	/usr/X11R6/lib/libX11.6.dylib (compatibility version 6.2.0, current  
version 6.2.0)
	/usr/X11R6/lib/libXext.6.dylib (compatibility version 6.4.0, current  
version 6.4.0)
	/usr/X11R6/lib/libXft.2.dylib (compatibility version 2.1.0, current  
version 2.1.0)
	/usr/X11R6/lib/libXmu.6.dylib (compatibility version 6.2.0, current  
version 6.2.0)
	/usr/X11R6/lib/libXpm.4.dylib (compatibility version 4.11.0, current  
version 4.11.0)
	/usr/X11R6/lib/libXrender.1.dylib (compatibility version 1.2.0,  
current version 1.2.0)
	/usr/X11R6/lib/libXt.6.dylib (compatibility version 6.0.0, current  
version 6.0.0)

I loaded temacs into gdb, set its arguments to '-batch --load loadup  
bootstrap' and let it run:

Starting program: .../emacs/src/temacs --batch --load loadup bootstrap
Reading symbols for shared libraries ..++++++++++++ 
+................................................+.++.+ 
+................+++....+.....+.........++ done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000c
0x900038cc in malloc_zone_malloc ()

'bt full' gives:

#0  0x900038cc in malloc_zone_malloc ()
No symbol table info available.
#1  0x0023ecf0 in unexec_malloc (size=20) at unexmacosx.c:1266
	ptr = <value temporarily unavailable, due to optimizations>
#2  0x001c558c in xmalloc (size=20) at alloc.c:762
	val = <value temporarily unavailable, due to optimizations>
#3  0x00144950 in sort_args (argc=5, argv=0xbfffe4c0) at emacs.c:1820
	new = <value temporarily unavailable, due to optimizations>
	options = <value temporarily unavailable, due to optimizations>
	priority = <value temporarily unavailable, due to optimizations>
	to = <value temporarily unavailable, due to optimizations>
	incoming_used = <value temporarily unavailable, due to optimizations>
	from = <value temporarily unavailable, due to optimizations>
	i = <value temporarily unavailable, due to optimizations>
#4  0x00146138 in main (argc=0, argv=0xbfffe4c0) at emacs.c:820
	dummy = 0
	stack_bottom_variable = -113 '\217'
	do_initial_setlocale = <value temporarily unavailable, due to  
optimizations>
	skip_args = 0
	rlim = {
   rlim_cur = -4611716942191919099,
   rlim_max = -8070424312546335528
}
	no_loadup = <value temporarily unavailable, due to optimizations>
	junk = 0x0

Xbacktrace just brings the GDB prompt. I'll try without optimisation  
(-O0) again!

--
Greetings

   Pete

November, n.:
         The eleventh twelfth of a weariness.
                 – Ambrose Bierce, "The Devil's Dictionary"