VLC build often fails with a bus error or segfault in ld.so when running vlc-cache-gen. This program loads/unloads modules (dlopen) to produce a pregenerated list. This used to fail quite often, then I figured out that using LD_PRELOAD to force loading of libgobject-2.0.so worked around this, but more recently it has started failing again whether or not this is done.
Typically it takes me 2 or 3 attempts to get this to work without crashing which is not ideal for bulk builds. I wondered if it was the sdl2 fix in ld.so (which is actually a fix for a similar situation with load/unload), but backing that out doesn't seem to help. Does anyone have an idea what might be up? To replicate cd /usr/ports/x11/vlc make fake cd /usr/ports/pobj/vlc-2.2.1/vlc-2.2.1 PATH="/usr/ports/pobj/vlc-2.2.1/fake-amd64/usr/local/bin:$PATH" LD_LIBRARY_PATH="/usr/ports/pobj/vlc-2.2.1/fake-amd64/usr/local/lib:$LD_LIBRARY_PATH" /usr/ports/pobj/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/vlc-cache-gen -f /usr/ports/pobj/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/plugins repeat the last step until it crashes, e.g. /usr/ports/pobj/vlc-2.2.1/vlc-2.2.1/bin/.libs/vlc-cache-gen:/usr/local/lib/libebml.so.3.0: undefined symbol '_ZNSs4_Rep10_M_destroyERKSaIcE' lazy binding failed! Segmentation fault (core dumped) or Bus error (core dumped) An example backtrace, using ports gdb because base gdb gives "Dwarf Error: Cannot find type of die": $ egdb /usr/obj/ports/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/vlc-cache-gen vlc-cache-gen.core GNU gdb (GDB) 7.10 Copyright (C) 2015 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-unknown-openbsd5.8". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://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 /usr/obj/ports/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/vlc-cache-gen...done. [New process 18294] Core was generated by `vlc-cache-gen'. Program terminated with signal SIGBUS, Bus error. #0 _dl_cache_grpsym_list (object=0xdfe3fdf7000) at /usr/src/libexec/ld.so/library_subr.c:554 554 _dl_link_grpsym(n->data, 0); (gdb) bt #0 _dl_cache_grpsym_list (object=0xdfe3fdf7000) at /usr/src/libexec/ld.so/library_subr.c:554 #1 0x00000dfd96c062ed in _dl_cache_grpsym_list (object=0xdfe3fdf8a00) at /usr/src/libexec/ld.so/library_subr.c:557 #2 0x00000dfd96c062ed in _dl_cache_grpsym_list (object=0xdfe0d967000) at /usr/src/libexec/ld.so/library_subr.c:557 #3 0x00000dfd96c062ed in _dl_cache_grpsym_list (object=0xdfe3fdfb800) at /usr/src/libexec/ld.so/library_subr.c:557 #4 0x00000dfd96c013b6 in _dl_load_dep_libs (object=0xdfe3fdfb800, flags=0, booting=0) at /usr/src/libexec/ld.so/loader.c:348 #5 0x00000dfd96c04159 in dlopen ( libname=0xdfdcb9d8e00 "/usr/obj/ports/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/plugins/video_output/libgl_plugin.so", flags=<optimized out>) at /usr/src/libexec/ld.so/dlfcn.c:106 #6 0x00000dfe0333fef1 in module_Load (p_this=0xdfe4d913650, path=0xdfdcb9d8e00 "/usr/obj/ports/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/plugins/video_output/libgl_plugin.so", p_handle=0x7f7fffff1190, lazy=64) at posix/plugin.c:60 #7 0x00000dfe0332a7f7 in module_InitDynamic (obj=0xdfe4d913650, path=0xdfdcb9d8e00 "/usr/obj/ports/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/plugins/video_output/libgl_plugin.so", fast=<optimized out>) at modules/bank.c:583 #8 0x00000dfe0332ac7e in AllocatePluginFile (bank=<optimized out>, abspath=<optimized out>, relpath=<optimized out>, st=<optimized out>) at modules/bank.c:526 #9 AllocatePluginDir (bank=0x7f7fffff13a8, maxdepth=3, absdir=<optimized out>, reldir=0xdfd6af74c20 "video_output") at modules/bank.c:488 #10 0x00000dfe0332abaf in AllocatePluginDir (bank=0x7f7fffff13a8, maxdepth=4, absdir=<optimized out>, reldir=0x0) at modules/bank.c:492 #11 0x00000dfe0332a98f in AllocatePluginPath (p_this=0xdfe4d913650, path=0xdfdfb3ede40 "/usr/obj/ports/vlc-2.2.1/fake-amd64/usr/local/lib/vlc/plugins", mode=CACHE_RESET) at modules/bank.c:401 #12 0x00000dfe0332a45e in AllocateAllPlugins (p_this=0xdfe4d913650) at modules/bank.c:346 #13 module_LoadPlugins (obj=0xdfe4d913650) at modules/bank.c:184 #14 0x00000dfe032d2efe in libvlc_InternalInit (p_libvlc=0xdfe4d913650, i_argc=4, ppsz_argv=0x7f7fffff1590) at libvlc.c:151 #15 0x00000dfd970d7931 in libvlc_new (argc=<optimized out>, argv=<optimized out>) at core.c:59 #16 0x00000dfb52f010b6 in main (argc=3, argv=0x7f7fffff16a8) at cachegen.c:99