pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/53319: text relocations fixes for multimedia/mplayer others



The following reply was made to PR pkg/53319; it has been noted by GNATS.

From: "John D. Baker" <jdbaker%mylinuxisp.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/53319: text relocations fixes for multimedia/mplayer others
Date: Fri, 29 Jun 2018 15:57:19 -0500 (CDT)

 On my i386-8.0_RC2 system, mplayer built from recent pkgsrc-HEAD (in the
 freeze before pkgsrc-2018Q2) fails to run as follows:
 
   $ mplayer
   mplayer: text relocations
   mplayer: Cannot write-enable text segment: Permission denied
 
 Running mplayer through 'ktruss' ends with:
 
 [...]
   1541      1 mplayer  open("/usr/local/lib/libcrypt.so.1", 0, 0xbfb613cc) Err#2 ENOENT
   1541      1 mplayer  open("/lib/libcrypt.so.1", 0, 0xbfb613cc) = 3
   1541      1 mplayer  __fstat50(0x3, 0xbfb613cc)  = 0
   1541      1 mplayer  mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xaade5000
   1541      1 mplayer  munmap(0xaade5000, 0x1000)  = 0
   1541      1 mplayer  mmap(0, 0xb000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xaaddb000
   1541      1 mplayer  mmap(0xaade1000, 0x2000, 0x3, 0x12, 0x3, 0, 0x5000, 0) = 0xaade1000
   1541      1 mplayer  mmap(0xaade3000, 0x3000, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xaade3000
   1541      1 mplayer  close(0x3)                  = 0
   1541      1 mplayer  write(0x2, 0xbfb619ec, 0x19) = 25
        "mplayer: text relocations"
   1541      1 mplayer  write(0x2, 0xbac88872, 0x1) = 1
        "\n"
   1541      1 mplayer  mprotect(0x26000, 0x2c9000, 0x3) Err#13 EACCES
   1541      1 mplayer  write(0x2, 0xbfb61a00, 0x3c) = 60
        "mplayer: Cannot write-enable text segment: Permission denied"
   1541      1 mplayer  write(0x2, 0xbac88872, 0x1) = 1
        "\n"
   1541      1 mplayer  exit(0x1)
 
 which seems to indicate an issue with "/lib/libcrypt.so.1", or that
 something wants to mmap it writable...
 
 Even built with the "debug" option, running mplayer under 'gdb' is
 not particularly informative:
 
 [...]
 Reading symbols from mplayer...done.
 (gdb) run
 Starting program: /usr/pkg/bin/mplayer 
 /usr/pkg/bin/mplayer: text relocations
 
 Program received signal SIGSEGV, Segmentation fault.
 _rtld_relocate_plt_lazy (obj=obj@entry=0xb48d7000)
     at /x/netbsd-8/src/libexec/ld.elf_so/arch/i386/mdreloc.c:210
 210			*where += (Elf_Addr)obj->relocbase;
 (gdb) bt
 #0  _rtld_relocate_plt_lazy (obj=obj@entry=0xb48d7000)
     at /x/netbsd-8/src/libexec/ld.elf_so/arch/i386/mdreloc.c:210
 #1  0xbb24c515 in _rtld_relocate_objects (first=0xb48d7000, 
     bind_now=bind_now@entry=false)
     at /x/netbsd-8/src/libexec/ld.elf_so/reloc.c:213
 #2  0xbb24ae89 in _rtld (sp=<optimized out>, relocbase=3139731456)
     at /x/netbsd-8/src/libexec/ld.elf_so/rtld.c:694
 #3  0xbb2484aa in .rtld_start () from /usr/libexec/ld.elf_so
 (gdb) list
 205			Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
 206	
 207			assert(ELF_R_TYPE(rel->r_info) == R_TYPE(JMP_SLOT));
 208	
 209			/* Just relocate the GOT slots pointing into the PLT */
 210			*where += (Elf_Addr)obj->relocbase;
 211			rdbg(("fixup !main in %s --> %p", obj->path, (void *)*where));
 212		}
 213	
 214		return 0;
 (gdb) continue
 Continuing.
 
 Program terminated with signal SIGSEGV, Segmentation fault.
 The program no longer exists.
 (gdb) quit
 
 
 As some have noted, other ffmpeg3 users work OK on i386 (notably firefox).
 
 The previous addendum to this PR indicated a problem and a solution, but
 that scenario does not seem to exist in my case.
 
 Any clues?  'mplayer' is the last show-stopper keeping me from using
 netbsd-8 on my i386 systems.
 
 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645
 


Home | Main Index | Thread Index | Old Index