Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#562 closed defect (invalid)

Windows codecs can't be loaded under some conditions.

Reported by: uleysky@… Owned by: reimar
Priority: normal Component: core
Version: 1.0pre8 Severity: minor
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

I have a AMD64 system and try to build 32-bit version of mplayer to play some
files what need windows codecs. But mplayer refuse to load these codecs. After
some investigation of sources I found that problem is in function VirtualAlloc.
This simple patch resolve problem for me:

diff -urNd MPlayer-1.0pre8/loader/ext.c MPlayer-1.0pre8-michael/loader/ext.c
--- MPlayer-1.0pre8/loader/ext.c 2006-08-22 22:27:21.257096672 +1100
+++ MPlayer-1.0pre8-michael/loader/ext.c 2006-08-22 22:28:31.370437824
+1100
@@ -525,7 +525,7 @@

}

}

  • answer=mmap(address, size, PROT_READ | PROT_WRITE | PROT_EXEC,

+ answer=mmap(address, size, PROT_READ | PROT_WRITE,

MAP_PRIVATE, fd, 0);

answer=FILE_dommap(-1, address, 0, size, 0, 0,
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE);

With flag PROT_EXEC mmap returns (void *) -1 with errno==EPERM. Without
PROT_EXEC all works fine, but I don't sure what this is right solution.
About my system:
kernel 2.6.17
glibc 2.4 (32- and 64-bit versions)
gcc 4.1.0 (also two versions)
mplayer was configured with
options: --prefix=/opt/32 --enable-menu --enable-joystick --charset=CP1251 --language=ru,en --with-codecsdir=/opt/32/lib/codecs

Change History (5)

comment:1 by reimar, 18 years ago

The right solution is to set your permissions correctly, probably via "chmod a+x
/opt/32/lib/codecs/*", your "fix" should cause crashes with all systems that
respect "no-execute" memory permissions.

comment:2 by uleysky@…, 18 years ago

(In reply to comment #1)

The right solution is to set your permissions correctly, probably via "chmod

a+x

/opt/32/lib/codecs/*", your "fix" should cause crashes with all systems that
respect "no-execute" memory permissions.

Chmod 755 /opt/32/lib/codecs/* was first thing what I do after seeing
PROT_EXEC. Partition definitely have exec rights because mplayer binary also
reside on it and running without problem :). I understand that my configuration
is specific, but I think we must determine real reasons of this "bug". May be
this is glibc or kernel bug.

comment:3 by reimar, 18 years ago

I think I know the problem then (and I think there is a mostly correct fix
available as part of the MacIntel patches). Try chmod a+rwx /dev/zero .

comment:4 by uleysky@…, 18 years ago

I set permissions 777 on /dev/zero and 755 on codecs files. Mplayer still
unable load codecs. This is definitely very strange. But RealPlayer codecs in
*.so form work normally.

comment:5 by uleysky@…, 18 years ago

Resolution: invalid
Status: newclosed

/dev was mounted with noexec option.

Note: See TracTickets for help on using tickets.