Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Aug 2012 19:13:53 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Juergen Lock <nox@jelal.kn-bremen.de>
Cc:        current@freebsd.org, freebsd-ports@freebsd.org
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)
Message-ID:  <20120805161353.GF2676@deviant.kiev.zoral.com.ua>
In-Reply-To: <201208051531.q75FVJjO087729@triton8.kn-bremen.de>
References:  <20120730191515.GA9678@triton8.kn-bremen.de> <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>

next in thread | previous in thread | raw e-mail | index | archive | help

--l3V33RQEOxIe3sMQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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:
>=20
> 	http://people.freebsd.org/~nox/tmp/vlc-2.0.3-006.patch
>=20
> (If you test the LIVEMEDIA knob you also need this update:
>=20
> 	http://people.freebsd.org/~nox/tmp/livemedia-20120404-001.patch
>=20
> )
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=3D-g

>=20
> In article <20120804110952.4f3a9cfd@ernst.jennejohn.org> you write:
> >On Fri, 3 Aug 2012 18:36:33 +0200
> >Juergen Lock <nox@jelal.kn-bremen.de> 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 <nox@jelal.kn-bremen.de> 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 (cor=
e 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
> >> >=20
> >> > I get exactly the same error with CURRENT amd64.
> >> >=20
> >> 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.
> >>=20
> >
> >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 ...
> >> >=20
> >> > > 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.
> >>=20
> >
> >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 condit=
ions.
> >Type "show copying" to see the conditions.
> >There is absolutely no warranty for GDB.  Type "show warranty" for detai=
ls.
> >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=3D0x80244c198,
> >    psz_file=3D0x802472c00 "../modules//codec/.libs/libfluidsynth_plugin=
.so",
> >    p_handle=3D0x7fffffffd180, lazy=3Dtrue) at posix/plugin.c:62
> >#10 0x0000000800adef4b in module_InitDynamic (obj=3D0x80244c198,
> >    path=3D0x802472c00 "../modules//codec/.libs/libfluidsynth_plugin.so",
> >    fast=3Dtrue) at modules/bank.c:536
> >#11 0x0000000800adede2 in AllocatePluginFile (bank=3D0x7fffffffd490,
> >    abspath=3D0x802472c00 "../modules//codec/.libs/libfluidsynth_plugin.=
so",
> >    relpath=3D0x802472b80 "codec/.libs/libfluidsynth_plugin.so",
> >    st=3D0x7fffffffd210) at modules/bank.c:479
> >#12 0x0000000800adeca3 in AllocatePluginDir (bank=3D0x7fffffffd490, maxd=
epth=3D2,
> >    absdir=3D0x802472b00 "../modules//codec/.libs",
> >    reldir=3D0x802472a80 "codec/.libs") at modules/bank.c:440
> >#13 0x0000000800adecd7 in AllocatePluginDir (bank=3D0x7fffffffd490, maxd=
epth=3D3,
> >    absdir=3D0x802472a00 "../modules//codec", reldir=3D0x8024704f0 "code=
c")
> >    at modules/bank.c:444
> >#14 0x0000000800adecd7 in AllocatePluginDir (bank=3D0x7fffffffd490, maxd=
epth=3D4,
> >    absdir=3D0x802452c20 "../modules/", reldir=3D0x0) at modules/bank.c:=
444
> >#15 0x0000000800ade9b8 in AllocatePluginPath (p_this=3D0x80244c198,
> >    path=3D0x802452c20 "../modules/", mode=3DCACHE_USE) at modules/bank.=
c:353
> >#16 0x0000000800ade823 in AllocateAllPlugins (p_this=3D0x80244c198)
> >    at modules/bank.c:298
> >#17 0x0000000800ade55d in module_LoadPlugins (obj=3D0x80244c198)
> >    at modules/bank.c:189
> >#18 0x0000000800a53e63 in libvlc_InternalInit (p_libvlc=3D0x80244c198, i=
_argc=3D3,
> >    ppsz_argv=3D0x7fffffffd6f0) at libvlc.c:247
> >#19 0x000000080082234d in libvlc_new (argc=3D2, argv=3D0x7fffffffd7a0) a=
t core.c:59
> >#20 0x0000000000400d1c in main (argc=3D2, argv=3D0x7fffffffd858) at cach=
egen.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.
>=20
>  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:
>=20
> /**
>  * 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 =3D lazy ? RTLD_LAZY : RTLD_NOW;
> #elif defined (DL_LAZY)
>     const int flags =3D DL_LAZY;
> #else
>     const int flags =3D 0;
> #endif
>     char *path =3D ToLocale( psz_file );
>=20
>     module_handle_t handle =3D dlopen( path, flags );
>     if( handle =3D=3D NULL )
>     {
>         msg_Warn( p_this, "cannot load module `%s' (%s)", path, dlerror()=
 );
>         LocaleFree( path );
>         return -1;
>     }
>     LocaleFree( path );
>     *p_handle =3D handle;
>     return 0;
> }
>=20
>  Thanx, :)
> 	Juergen

--l3V33RQEOxIe3sMQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (FreeBSD)

iEYEARECAAYFAlAem8EACgkQC3+MBN1Mb4h/9QCg7Iq+v1Yg0TfVEAt7n8NQFfDa
olsAn1zZMurAAPw34FHF5jwTT5U7IzTU
=7pP6
-----END PGP SIGNATURE-----

--l3V33RQEOxIe3sMQ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120805161353.GF2676>