From owner-freebsd-ports@FreeBSD.ORG Sun Aug 5 17:40:33 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B31CB1065670; Sun, 5 Aug 2012 17:40:33 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 054608FC14; Sun, 5 Aug 2012 17:40:32 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 7BEB01E000F2; Sun, 5 Aug 2012 19:40:31 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.4) with ESMTP id q75HcCOp091282; Sun, 5 Aug 2012 19:38:12 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id q75HcBje091281; Sun, 5 Aug 2012 19:38:11 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Sun, 5 Aug 2012 19:38:11 +0200 To: Konstantin Belousov Message-ID: <20120805173811.GA91260@triton8.kn-bremen.de> References: <20120801213128.7956cef34d5f5a5419f78de2@alkumuna.eu> <201208021921.q72JLT4k040018@triton8.kn-bremen.de> <1361725.y2QOXzX10J@pcoliver.heesakkers.info> <20120802205625.GA43980@triton8.kn-bremen.de> <20120803142711.1cb981b3@ernst.jennejohn.org> <501BE795.8070407@gwdg.de> <20120803163633.GA2046@triton8.kn-bremen.de> <20120804110952.4f3a9cfd@ernst.jennejohn.org> <201208051531.q75FVJjO087729@triton8.kn-bremen.de> <20120805161353.GF2676@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120805161353.GF2676@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: current@freebsd.org, Juergen Lock , freebsd-ports@freebsd.org, gljennjohn@googlemail.com Subject: Re: Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2012 17:40:33 -0000 On Sun, Aug 05, 2012 at 07:13:53PM +0300, Konstantin Belousov wrote: > On Sun, Aug 05, 2012 at 05:31:19PM +0200, Juergen Lock wrote: > > Hi kib, -current, seems we have a segfault in rtld when updating > > the multimedia/vlc port from the version currently in ports to the > > 2.0.3 CFT version from here: > > > > http://people.freebsd.org/~nox/tmp/vlc-2.0.3-006.patch > > > > (If you test the LIVEMEDIA knob you also need this update: > > > > http://people.freebsd.org/~nox/tmp/livemedia-20120404-001.patch > > > > ) > Please do two things. > > 1. Provide me the output of readelf -a for the module that was loaded. > > 2. Recompile rtld with debug symbols and redo the build to get the useful > backtrace from core: > cd /usr/src/libexec/rtld-elf > make clean > make all install DEBUG_FLAGS=-g > Ok, someone who got the crash will have to do this as I couln't reproduce it here (sorry forgot to say...) Thanx, :) Juergen > > > > In article <20120804110952.4f3a9cfd@ernst.jennejohn.org> you write: > > >On Fri, 3 Aug 2012 18:36:33 +0200 > > >Juergen Lock wrote: > > > > > >> On Fri, Aug 03, 2012 at 05:00:37PM +0200, Rainer Hurling wrote: > > >> > On 03.08.2012 14:27 (UTC+2), Gary Jennejohn wrote: > > >> > > On Thu, 2 Aug 2012 22:56:26 +0200 > > >> > > Juergen Lock wrote: > > >> > > > > >> > > [trimmed irrelevant content] > > >> > >> Ok I added that check: > > >> > >> > > >> > >> http://people.freebsd.org/~nox/tmp/vlc-2.0.3-005.patch > > >> > >> > > >> > >> Enjoy, :) > > >> > >> > > >> > > > > >> > > AMD64 on HEAD. > > >> > > > > >> > > I always get this error, no matter which patch I use: > > >> > > > > >> > > GEN ../modules/plugins.dat > > >> > > gmake[2]: *** [../modules/plugins.dat] Segmentation fault: 11 (core dumped) > > >> > > gmake[2]: Leaving directory `/usr/ports/multimedia/vlc/work/vlc-2.0.3/bin' > > >> > > gmake[1]: *** [all-recursive] Error 1 > > >> > > gmake[1]: Leaving directory `/usr/ports/multimedia/vlc/work/vlc-2.0.3' > > >> > > gmake: *** [all] Error 2 > > >> > > *** [do-build] Error code 1 > > >> > > > >> > I get exactly the same error with CURRENT amd64. > > >> > > > >> Hm how old are both your installed src and ports? You two are the > > >> first to report this and I just tried to reproduce it on a head > > >> checkout from May 13 and ports from June 18, and couldn't. > > >> > > > > > >I update the ports and source trees almost every day. I do not install > > >new ports binaries unless absolutely necessary, so the ports binaries > > >are pretty much rather old. > > > > > >Just installed a new world/kernel today (updated yesterdya), r239006. > > > > > >> > BTW, mplayer from ports does not build with liveMedia-20120404 ... > > >> > > > >> > > Stop in /usr/ports/multimedia/vlc. > > >> > > *** [build] Error code 1 > > >> > > > > >> > > and there's a work/vlc-2.0.3/bin/vlc-cache-gen.core generated. > > >> > > > > >> > > May be because I have a mix of old and new dependencies, although the vlc > > >> > > port never tries to update any of them. > > >> > > > > >> Well ports never update dependencies themselves, you need to use > > >> tools like portmaster for that. > > >> > > > > > >I avoid using tools whenever possible. Maybe I will have to try > > >portmaster, but I dread seeing 50 ports updated just because I > > >want to update one port. > > > > > >I turned on -g in make.conf and ran vlc-cache-gen in gdb. Here's the > > >result. > > > > > >gdb /usr/ports/multimedia/vlc/work/vlc-2.0.3/bin/.libs/vlc-cache-gen > > >GNU gdb 6.1.1 [FreeBSD] > > >Copyright 2004 Free Software Foundation, Inc. > > >GDB is free software, covered by the GNU General Public License, and you are > > >welcome to change it and/or distribute copies of it under certain conditions. > > >Type "show copying" to see the conditions. > > >There is absolutely no warranty for GDB. Type "show warranty" for details. > > >This GDB was configured as "amd64-marcel-freebsd"... > > >(gdb) r ../modules/ > > >Starting program: /usr/ports/multimedia/vlc/work/vlc-2.0.3/bin/.libs/vlc-cache-gen ../modules/ > > >[New LWP 100125] > > >[New Thread 802406400 (LWP 100125/vlc-cache-gen)] > > > > > >Program received signal SIGSEGV, Segmentation fault. > > >[Switching to Thread 802406400 (LWP 100125/vlc-cache-gen)] > > >0x0000000800606588 in matched_symbol () from /libexec/ld-elf.so.1 > > >(gdb) bt > > >#0 0x0000000800606588 in matched_symbol () from /libexec/ld-elf.so.1 > > >#1 0x00000008006087e4 in symlook_obj () from /libexec/ld-elf.so.1 > > >#2 0x0000000800608ae7 in symlook_list () from /libexec/ld-elf.so.1 > > >#3 0x000000080060911b in symlook_default () from /libexec/ld-elf.so.1 > > >#4 0x000000080060939d in find_symdef () from /libexec/ld-elf.so.1 > > >#5 0x000000080060375b in reloc_non_plt () from /libexec/ld-elf.so.1 > > >#6 0x0000000800606ae8 in relocate_object () from /libexec/ld-elf.so.1 > > >#7 0x00000008006084a8 in dlopen_object () from /libexec/ld-elf.so.1 > > >#8 0x0000000800608f67 in rtld_dlopen () from /libexec/ld-elf.so.1 > > >#9 0x0000000800affe95 in module_Load (p_this=0x80244c198, > > > psz_file=0x802472c00 "../modules//codec/.libs/libfluidsynth_plugin.so", > > > p_handle=0x7fffffffd180, lazy=true) at posix/plugin.c:62 > > >#10 0x0000000800adef4b in module_InitDynamic (obj=0x80244c198, > > > path=0x802472c00 "../modules//codec/.libs/libfluidsynth_plugin.so", > > > fast=true) at modules/bank.c:536 > > >#11 0x0000000800adede2 in AllocatePluginFile (bank=0x7fffffffd490, > > > abspath=0x802472c00 "../modules//codec/.libs/libfluidsynth_plugin.so", > > > relpath=0x802472b80 "codec/.libs/libfluidsynth_plugin.so", > > > st=0x7fffffffd210) at modules/bank.c:479 > > >#12 0x0000000800adeca3 in AllocatePluginDir (bank=0x7fffffffd490, maxdepth=2, > > > absdir=0x802472b00 "../modules//codec/.libs", > > > reldir=0x802472a80 "codec/.libs") at modules/bank.c:440 > > >#13 0x0000000800adecd7 in AllocatePluginDir (bank=0x7fffffffd490, maxdepth=3, > > > absdir=0x802472a00 "../modules//codec", reldir=0x8024704f0 "codec") > > > at modules/bank.c:444 > > >#14 0x0000000800adecd7 in AllocatePluginDir (bank=0x7fffffffd490, maxdepth=4, > > > absdir=0x802452c20 "../modules/", reldir=0x0) at modules/bank.c:444 > > >#15 0x0000000800ade9b8 in AllocatePluginPath (p_this=0x80244c198, > > > path=0x802452c20 "../modules/", mode=CACHE_USE) at modules/bank.c:353 > > >#16 0x0000000800ade823 in AllocateAllPlugins (p_this=0x80244c198) > > > at modules/bank.c:298 > > >#17 0x0000000800ade55d in module_LoadPlugins (obj=0x80244c198) > > > at modules/bank.c:189 > > >#18 0x0000000800a53e63 in libvlc_InternalInit (p_libvlc=0x80244c198, i_argc=3, > > > ppsz_argv=0x7fffffffd6f0) at libvlc.c:247 > > >#19 0x000000080082234d in libvlc_new (argc=2, argv=0x7fffffffd7a0) at core.c:59 > > >#20 0x0000000000400d1c in main (argc=2, argv=0x7fffffffd858) at cachegen.c:107 > > >(gdb) > > > > > >If I remove enough plugins then I can build and install vlc, but the > > >result isn't very useful. > > > > > >The old port builds, installs and works just fine with all the plugins I > > >want to use so I'll stick to it. > > > > I Cc'd -current and kib (who did the majority of the recent rtld commits), > > maybe he has an idea. Seems dlopen() was called from here, > > /usr/ports/multimedia/vlc/work/vlc-2.0.3/src/posix/plugin.c , line 62: > > > > /** > > * Load a dynamically linked library using a system dependent method. > > * > > * \param p_this vlc object > > * \param psz_file library file > > * \param p_handle the module handle returned > > * \return 0 on success as well as the module handle. > > */ > > int module_Load( vlc_object_t *p_this, const char *psz_file, > > module_handle_t *p_handle, bool lazy ) > > { > > #if defined (RTLD_NOW) > > const int flags = lazy ? RTLD_LAZY : RTLD_NOW; > > #elif defined (DL_LAZY) > > const int flags = DL_LAZY; > > #else > > const int flags = 0; > > #endif > > char *path = ToLocale( psz_file ); > > > > module_handle_t handle = dlopen( path, flags ); > > if( handle == NULL ) > > { > > msg_Warn( p_this, "cannot load module `%s' (%s)", path, dlerror() ); > > LocaleFree( path ); > > return -1; > > } > > LocaleFree( path ); > > *p_handle = handle; > > return 0; > > } > > > > Thanx, :) > > Juergen