Subject: bug#36758: 27.0.50; Mac OS/Lucid/X11: crash with libharfbuzz

From: YAMAMOTO Mitsuharu <[email-masked]>
Date: Mon, 22 Jul 2019 20:13:55 +0900

On Mon, 22 Jul 2019 19:52:07 +0900,
Simon Leinen wrote:
> 
> YAMAMOTO Mitsuharu writes:
> > Thanks.  I rather suspect it has something to do with the versions of
> > Harbuzz.  Could you try to see if the following test program crash on
> > your side?
> 
> > /* cc -g hb-ot-test.c `pkg-config freetype2 harfbuzz --cflags --libs` */
> 
> No, that runs fine (return code 0) and outputs
> 
>   HarfBuzz Version: 2.5.3
>   GSUB script_count = 1
>   GPOS script_count = 1
> 
> : leinen@macsl[leinen]; objdump -macho -dylibs-used /var/tmp/a.out
> /var/tmp/a.out:
> 	/usr/local/opt/freetype/lib/libfreetype.6.dylib (compatibility version 24.0.0, current version 24.1.0)
> 	/usr/local/opt/harfbuzz/lib/libharfbuzz.0.dylib (compatibility version 20504.0.0, current version 20504.0.0)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
> 
> This is the same version of libharfbuzz that my Emacs binary uses:
> 
> : leinen@macsl[leinen]; objdump -macho -dylibs-used /var/tmp/emacs/gbuild/src/emacs
(snip)
> 	/opt/X11/lib/libfreetype.6.dylib (compatibility version 19.0.0, current version 19.6.0)

I noticed the versions of libfreetype are different between the test
program and Emacs.  What happens if you link the test program with the
latter one using the environment variable DYLD_LIBRARY_PATH ?

  $ DYLD_LIBRARY_PATH=/opt/X11/lib ./a.out

				     YAMAMOTO Mitsuharu
				[email-masked]