Re: Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly)

2012-08-13 Thread Konstantin Belousov
On Mon, Aug 13, 2012 at 01:13:35AM +0200, Juergen Lock wrote:
 On Sun, Aug 05, 2012 at 07:38:11PM +0200, Juergen Lock wrote:
  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...)
  
 I just learned that the missing piece in reproducing this is the
 pulseaudio knob, now I finally have a bt:
 
 [...]
 Loaded symbols for /libexec/ld-elf.so.1
 #0  symlook_obj (req=0x7fffbf40, obj=0x800640400) at 
 /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3847
 3847for (symnum = obj-buckets[req-hash % obj-nbuckets];
 [New Thread 802406400 (LWP 100159/vlc-cache-gen)]
 (gdb) bt
 #0  symlook_obj (req=0x7fffbf40, obj=0x800640400) at 
 /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3847
 #1  0x000800608ae7 in symlook_list (req=0x7fffc120, objlist=Variable 
 objlist is not available.
 ) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3611
 #2  0x00080060911b in symlook_default (req=0x7fffc1c0, 
 refobj=Variable refobj is not available.
 ) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3569
 #3  0x00080060939d in find_symdef (symnum=15, refobj=0x8006fd000, 
 defobj_out=0x7fffc260, flags=0, cache=0x80061d000, 
 lockstate=0x7fffc300)
 at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:1541
 #4  0x000800603690 in reloc_non_plt (obj=0x8006fd000, obj_rtld=Variable 
 obj_rtld is not available.
 ) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/amd64/reloc.c:204
 #5  0x000800606ae8 in relocate_object (obj=0x8006fd000, bind_now=0 '\0', 
 rtldobj=0x800819d00, flags=0, lockstate=0x7fffc300)
 at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2433
 #6  0x0008006084a8 in dlopen_object (name=0x80243ec80 
 ../modules/access/.libs/libpulsesrc_plugin.so, fd=Variable fd is not 
 available.
 )
 at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2392
 #7  0x000800608f67 in rtld_dlopen (name=0x80243ec80 
 ../modules/access/.libs/libpulsesrc_plugin.so, fd=-1, mode=1)
 at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2761
 #8  0x000800ad377d in vlc_timer_create () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #9  0x000800ab9998 in module_gettext () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #10 0x000800aba0aa in module_list_get () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #11 0x000800ab9db1 in module_list_get () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #12 0x000800ab9db1 in module_list_get () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #13 0x000800aba17d in module_list_get () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #14 0x000800aba631 in module_list_get () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #15 0x000800a52573 in libvlc_InternalInit () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
 #16 0x0008008227a7 in libvlc_new () from 
 /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/lib/.libs/libvlc.so.8
 #17 0x00400cd4 in main ()
 (gdb) p obj-buckets
 $1 = (const Elf_Hashelt *) 0x804de0160
 (gdb) p req-hash % obj-nbuckets
 $2 = 399
 (gdb) p obj-buckets[req-hash % obj-nbuckets] 
 Cannot access memory at address 0x804de079c
 (gdb) p obj-nbuckets
 $3 = 521
Can you show the output of p *obj there ?


pgpv4Ro56CcJv.pgp
Description: PGP signature


Re: Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly)

2012-08-13 Thread Juergen Lock
On Mon, Aug 13, 2012 at 01:30:47PM +0300, Konstantin Belousov wrote:
 On Mon, Aug 13, 2012 at 01:13:35AM +0200, Juergen Lock wrote:
  On Sun, Aug 05, 2012 at 07:38:11PM +0200, Juergen Lock wrote:
   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...)
   
  I just learned that the missing piece in reproducing this is the
  pulseaudio knob, now I finally have a bt:
  
  [...]
  Loaded symbols for /libexec/ld-elf.so.1
  #0  symlook_obj (req=0x7fffbf40, obj=0x800640400) at 
  /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3847
  3847for (symnum = obj-buckets[req-hash % obj-nbuckets];
  [New Thread 802406400 (LWP 100159/vlc-cache-gen)]
  (gdb) bt
  #0  symlook_obj (req=0x7fffbf40, obj=0x800640400) at 
  /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3847
  #1  0x000800608ae7 in symlook_list (req=0x7fffc120, 
  objlist=Variable objlist is not available.
  ) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3611
  #2  0x00080060911b in symlook_default (req=0x7fffc1c0, 
  refobj=Variable refobj is not available.
  ) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3569
  #3  0x00080060939d in find_symdef (symnum=15, refobj=0x8006fd000, 
  defobj_out=0x7fffc260, flags=0, cache=0x80061d000, 
  lockstate=0x7fffc300)
  at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:1541
  #4  0x000800603690 in reloc_non_plt (obj=0x8006fd000, obj_rtld=Variable 
  obj_rtld is not available.
  ) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/amd64/reloc.c:204
  #5  0x000800606ae8 in relocate_object (obj=0x8006fd000, bind_now=0 
  '\0', rtldobj=0x800819d00, flags=0, lockstate=0x7fffc300)
  at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2433
  #6  0x0008006084a8 in dlopen_object (name=0x80243ec80 
  ../modules/access/.libs/libpulsesrc_plugin.so, fd=Variable fd is not 
  available.
  )
  at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2392
  #7  0x000800608f67 in rtld_dlopen (name=0x80243ec80 
  ../modules/access/.libs/libpulsesrc_plugin.so, fd=-1, mode=1)
  at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2761
  #8  0x000800ad377d in vlc_timer_create () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #9  0x000800ab9998 in module_gettext () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #10 0x000800aba0aa in module_list_get () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #11 0x000800ab9db1 in module_list_get () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #12 0x000800ab9db1 in module_list_get () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #13 0x000800aba17d in module_list_get () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #14 0x000800aba631 in module_list_get () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #15 0x000800a52573 in libvlc_InternalInit () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
  #16 0x0008008227a7 in libvlc_new () from 
  /usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/lib/.libs/libvlc.so.8
  #17 0x00400cd4 in main ()
  (gdb) p obj-buckets
  $1 = (const Elf_Hashelt *) 0x804de0160
  (gdb) p req-hash % obj-nbuckets
  $2 = 399
  (gdb) p obj-buckets[req-hash % obj-nbuckets] 
  Cannot access memory at address 0x804de079c
  (gdb) p obj-nbuckets
  $3 = 521
 Can you show the output of p *obj there ?

Here it comes...

#0  symlook_obj (req=0x7fffbf40, obj=0x800640400)
at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3847
3847for (symnum = obj-buckets[req-hash % obj-nbuckets];
[New Thread 802406400 (LWP 100159/vlc-cache-gen)]
(gdb) p *obj
$1 = {magic = 3578837114, version = 1, next = 0x80063f800, 
  path = 0x8006434c0 /usr/local/lib/libgconf-2.so.4, origin_path = 0x0, 
  refcount = 1, dl_refcount = 0, 
  mapbase = 

Re: Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly)

2012-08-12 Thread Juergen Lock
On Sun, Aug 05, 2012 at 07:38:11PM +0200, Juergen Lock wrote:
 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...)
 
I just learned that the missing piece in reproducing this is the
pulseaudio knob, now I finally have a bt:

[...]
Loaded symbols for /libexec/ld-elf.so.1
#0  symlook_obj (req=0x7fffbf40, obj=0x800640400) at 
/d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3847
3847for (symnum = obj-buckets[req-hash % obj-nbuckets];
[New Thread 802406400 (LWP 100159/vlc-cache-gen)]
(gdb) bt
#0  symlook_obj (req=0x7fffbf40, obj=0x800640400) at 
/d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3847
#1  0x000800608ae7 in symlook_list (req=0x7fffc120, objlist=Variable 
objlist is not available.
) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3611
#2  0x00080060911b in symlook_default (req=0x7fffc1c0, refobj=Variable 
refobj is not available.
) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:3569
#3  0x00080060939d in find_symdef (symnum=15, refobj=0x8006fd000, 
defobj_out=0x7fffc260, flags=0, cache=0x80061d000, lockstate=0x7fffc300)
at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:1541
#4  0x000800603690 in reloc_non_plt (obj=0x8006fd000, obj_rtld=Variable 
obj_rtld is not available.
) at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/amd64/reloc.c:204
#5  0x000800606ae8 in relocate_object (obj=0x8006fd000, bind_now=0 '\0', 
rtldobj=0x800819d00, flags=0, lockstate=0x7fffc300)
at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2433
#6  0x0008006084a8 in dlopen_object (name=0x80243ec80 
../modules/access/.libs/libpulsesrc_plugin.so, fd=Variable fd is not 
available.
)
at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2392
#7  0x000800608f67 in rtld_dlopen (name=0x80243ec80 
../modules/access/.libs/libpulsesrc_plugin.so, fd=-1, mode=1)
at /d3t/d3t/home/nox/src10b/src/libexec/rtld-elf/rtld.c:2761
#8  0x000800ad377d in vlc_timer_create () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#9  0x000800ab9998 in module_gettext () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#10 0x000800aba0aa in module_list_get () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#11 0x000800ab9db1 in module_list_get () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#12 0x000800ab9db1 in module_list_get () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#13 0x000800aba17d in module_list_get () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#14 0x000800aba631 in module_list_get () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#15 0x000800a52573 in libvlc_InternalInit () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/src/.libs/libvlccore.so.6
#16 0x0008008227a7 in libvlc_new () from 
/usr/ports/multimedia/vlc-203a/work/vlc-2.0.3/lib/.libs/libvlc.so.8
#17 0x00400cd4 in main ()
(gdb) p obj-buckets
$1 = (const Elf_Hashelt *) 0x804de0160
(gdb) p req-hash % obj-nbuckets
$2 = 399
(gdb) p obj-buckets[req-hash % obj-nbuckets] 
Cannot access memory at address 0x804de079c
(gdb) p obj-nbuckets
$3 = 521
(gdb) l
2761return (dlopen_object(name, fd, obj_main, lo_flags,
2762  mode  (RTLD_MODEMASK | RTLD_GLOBAL), NULL));
2763}
2764
2765static void
2766dlopen_cleanup(Obj_Entry *obj)
2767{
2768
2769obj-dl_refcount--;
2770unref_dag(obj);
(gdb) l 3840
3835 * performed with the obj-valid_hash_sysv assignment.
3836 */
3837static int
3838symlook_obj1_sysv(SymLook *req, const Obj_Entry *obj)
3839{
3840unsigned long symnum;
3841Sym_Match_Result matchres;
3842
3843matchres.sym_out = NULL;
3844matchres.vsymp = NULL;
(gdb) l
3845matchres.vcount = 0;
3846
3847for (symnum = obj-buckets[req-hash % obj-nbuckets];
3848symnum != STN_UNDEF; symnum = obj-chains[symnum]) {
3849  

Re: Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly)

2012-08-12 Thread Alexander Kabaev
On Mon, 13 Aug 2012 01:13:35 +0200
Juergen Lock n...@jelal.kn-bremen.de wrote:

 On Sun, Aug 05, 2012 at 07:38:11PM +0200, Juergen Lock wrote:
  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...)
  
 I just learned that the missing piece in reproducing this is the
 pulseaudio knob, now I finally have a bt:


obj-nbuckets in core seems to disagree with that readelf thinks it
should be (521 != 67). Could you please make the tarball of all the VLC
libraries involved? Send the link to me and kib@, please. At the very
least, can I lay my hands on libpulsesrc_plugin.so binary?

-- 
Alexander Kabaev


signature.asc
Description: PGP signature


Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly)

2012-08-05 Thread Juergen Lock
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

)

In article 20120804110952.4f3a9...@ernst.jennejohn.org you write:
On Fri, 3 Aug 2012 18:36:33 +0200
Juergen Lock n...@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 n...@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 (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)]
0x000800606588 in matched_symbol () from /libexec/ld-elf.so.1
(gdb) bt
#0  0x000800606588 in matched_symbol () from /libexec/ld-elf.so.1
#1  0x0008006087e4 in symlook_obj () from /libexec/ld-elf.so.1
#2  0x000800608ae7 in symlook_list () from /libexec/ld-elf.so.1
#3  0x00080060911b in symlook_default () from /libexec/ld-elf.so.1
#4  0x00080060939d in find_symdef () from /libexec/ld-elf.so.1
#5  0x00080060375b in reloc_non_plt () from /libexec/ld-elf.so.1
#6  0x000800606ae8 in relocate_object () from /libexec/ld-elf.so.1
#7  0x0008006084a8 in dlopen_object () from /libexec/ld-elf.so.1
#8  0x000800608f67 in rtld_dlopen () from /libexec/ld-elf.so.1
#9  0x000800affe95 in module_Load (p_this=0x80244c198,
psz_file=0x802472c00 ../modules//codec/.libs/libfluidsynth_plugin.so,
p_handle=0x7fffd180, lazy=true) at posix/plugin.c:62
#10 0x000800adef4b in module_InitDynamic (obj=0x80244c198,
path=0x802472c00 ../modules//codec/.libs/libfluidsynth_plugin.so,
fast=true) at modules/bank.c:536
#11 0x000800adede2 in AllocatePluginFile (bank=0x7fffd490,
abspath=0x802472c00 ../modules//codec/.libs/libfluidsynth_plugin.so,
relpath=0x802472b80 codec/.libs/libfluidsynth_plugin.so,
st=0x7fffd210) at modules/bank.c:479
#12 0x000800adeca3 in AllocatePluginDir (bank=0x7fffd490, maxdepth=2,
absdir=0x802472b00 ../modules//codec/.libs,
reldir=0x802472a80 codec/.libs) at modules/bank.c:440
#13 0x000800adecd7 in AllocatePluginDir (bank=0x7fffd490, maxdepth=3,
absdir=0x802472a00 ../modules//codec, reldir=0x8024704f0 codec)
at modules/bank.c:444
#14 0x000800adecd7 in AllocatePluginDir (bank=0x7fffd490, maxdepth=4,

Re: Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly)

2012-08-05 Thread Konstantin Belousov
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

 
 In article 20120804110952.4f3a9...@ernst.jennejohn.org you write:
 On Fri, 3 Aug 2012 18:36:33 +0200
 Juergen Lock n...@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 n...@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 (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)]
 0x000800606588 in matched_symbol () from /libexec/ld-elf.so.1
 (gdb) bt
 #0  0x000800606588 in matched_symbol () from /libexec/ld-elf.so.1
 #1  0x0008006087e4 in symlook_obj () from /libexec/ld-elf.so.1
 #2  0x000800608ae7 in symlook_list () from /libexec/ld-elf.so.1
 #3  0x00080060911b in symlook_default () from /libexec/ld-elf.so.1
 #4  0x00080060939d in find_symdef () from /libexec/ld-elf.so.1
 #5  0x00080060375b in reloc_non_plt () from /libexec/ld-elf.so.1
 #6  0x000800606ae8 in relocate_object () from /libexec/ld-elf.so.1
 #7  0x0008006084a8 in dlopen_object () from /libexec/ld-elf.so.1
 #8  0x000800608f67 in rtld_dlopen () from /libexec/ld-elf.so.1
 #9  0x000800affe95 in module_Load (p_this=0x80244c198,
 psz_file=0x802472c00 ../modules//codec/.libs/libfluidsynth_plugin.so,
 p_handle=0x7fffd180, lazy=true) at posix/plugin.c:62
 #10 0x000800adef4b in module_InitDynamic (obj=0x80244c198,
 path=0x802472c00 ../modules//codec/.libs/libfluidsynth_plugin.so,
 fast=true) at modules/bank.c:536
 #11 0x000800adede2 in AllocatePluginFile (bank=0x7fffd490,
 abspath=0x802472c00 ../modules//codec/.libs/libfluidsynth_plugin.so,
 relpath=0x802472b80 codec/.libs/libfluidsynth_plugin.so,
 st=0x7fffd210) at 

Re: Segfault in rtld - dlopen RTLD_LAZY (was: Re: CFT: vlc 2.0.3 - want to know where it works and where only partly)

2012-08-05 Thread Juergen Lock
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.4f3a9...@ernst.jennejohn.org you write:
  On Fri, 3 Aug 2012 18:36:33 +0200
  Juergen Lock n...@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 n...@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 (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)]
  0x000800606588 in matched_symbol () from /libexec/ld-elf.so.1
  (gdb) bt
  #0  0x000800606588 in matched_symbol () from /libexec/ld-elf.so.1
  #1  0x0008006087e4 in symlook_obj () from /libexec/ld-elf.so.1
  #2  0x000800608ae7 in symlook_list () from /libexec/ld-elf.so.1
  #3  0x00080060911b in symlook_default () from /libexec/ld-elf.so.1
  #4  0x00080060939d in find_symdef () from /libexec/ld-elf.so.1
  #5  0x00080060375b in reloc_non_plt () from /libexec/ld-elf.so.1
  #6  0x000800606ae8 in relocate_object () from /libexec/ld-elf.so.1
  #7  0x0008006084a8 in dlopen_object () from /libexec/ld-elf.so.1
  #8  0x000800608f67 in rtld_dlopen () from /libexec/ld-elf.so.1
  #9  0x000800affe95 in module_Load (p_this=0x80244c198,
  psz_file=0x802472c00 ../modules//codec/.libs/libfluidsynth_plugin.so,
  p_handle=0x7fffd180, lazy=true) at posix/plugin.c:62
  #10 0x000800adef4b in module_InitDynamic (obj=0x80244c198,
  path=0x802472c00