<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xine-lib/src/input, branch 1.1.7</title>
<subtitle>xine-lib git mirror
</subtitle>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/'/>
<entry>
<title>Add a comment &amp; changelog entry for the mmap bug fix.</title>
<updated>2007-06-03T02:01:31+00:00</updated>
<author>
<name>Darren Salt</name>
<email>linux@youmustbejoking.demon.co.uk</email>
</author>
<published>2007-06-03T02:01:31+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=f398c68b695ee3dad829d95a724573ca42926205'/>
<id>f398c68b695ee3dad829d95a724573ca42926205</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[patch] Nasty mmap problem with huge files</title>
<updated>2007-06-03T01:43:07+00:00</updated>
<author>
<name>Andrew de Quincey</name>
<email>adq_dvb@lidskialf.net</email>
</author>
<published>2007-06-03T01:43:07+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=a3caa5974f860b9702089c4ffea54e22f658fb49'/>
<id>a3caa5974f860b9702089c4ffea54e22f658fb49</id>
<content type='text'>
Hi, I've been tracking down a very odd bug this afternoon. As it turns
out it is caused by enabling xine's mmap() support for the input_file.c.

I'm running 32 bit linux 2.6.21. The file in question is 0x10e4da000
bytes long (you can probably guess what kind of bug this is by now :)

Anyway, the issue stems from the definition of mmap():

void *mmap(void *start, size_t length, int prot, int flags, int fd,
off_t offset);

compare this to the definition of st_size in struct stat:
off_t     st_size;    /* total size, in bytes */

On my machine (in input_file.c) sizeof(size_t) ==4, whilst
sizeof(off_t) == 8. However the compiler doesn't generate a warning
when the following is done in xine's code:

     if ( (this-&gt;mmap_base = mmap(NULL, sbuf.st_size, PROT_READ,
MAP_SHARED, this-&gt;fh, 0)) != (void*)-1

So it silently truncates the upper part of the length. Obviously you
cannot mmap() a file that large into (32 bit) memory anyway, but as it turns
out, mmapping() 0xe4da000 succeeds, which causes... problems.

The patch (against xine-lib 1.1.6) does two things:
* Check that the length will not be truncated, while still allowing
for mmap()s of large files under 64 bit OSes.
* A correctness fix: if mmap() fails, this-&gt;mmap_base will be set to
0xffffffff. Later on when the file is closed, this means it was
attempting to do munmap(0xffffffff).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Hi, I've been tracking down a very odd bug this afternoon. As it turns
out it is caused by enabling xine's mmap() support for the input_file.c.

I'm running 32 bit linux 2.6.21. The file in question is 0x10e4da000
bytes long (you can probably guess what kind of bug this is by now :)

Anyway, the issue stems from the definition of mmap():

void *mmap(void *start, size_t length, int prot, int flags, int fd,
off_t offset);

compare this to the definition of st_size in struct stat:
off_t     st_size;    /* total size, in bytes */

On my machine (in input_file.c) sizeof(size_t) ==4, whilst
sizeof(off_t) == 8. However the compiler doesn't generate a warning
when the following is done in xine's code:

     if ( (this-&gt;mmap_base = mmap(NULL, sbuf.st_size, PROT_READ,
MAP_SHARED, this-&gt;fh, 0)) != (void*)-1

So it silently truncates the upper part of the length. Obviously you
cannot mmap() a file that large into (32 bit) memory anyway, but as it turns
out, mmapping() 0xe4da000 succeeds, which causes... problems.

The patch (against xine-lib 1.1.6) does two things:
* Check that the length will not be truncated, while still allowing
for mmap()s of large files under 64 bit OSes.
* A correctness fix: if mmap() fails, this-&gt;mmap_base will be set to
0xffffffff. Later on when the file is closed, this means it was
attempting to do munmap(0xffffffff).
</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [xine-devel] vcd plugin - sigsegv in 1.1.6 and 1.1(.7)</title>
<updated>2007-05-26T21:12:24+00:00</updated>
<author>
<name>Manfred Tremmel</name>
<email>Manfred.Tremmel@iiv.de</email>
</author>
<published>2007-05-26T21:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=6687a340feb300841f5885a993cfd20a7604178b'/>
<id>6687a340feb300841f5885a993cfd20a7604178b</id>
<content type='text'>
 development branche
Am Samstag, 26. Mai 2007 17:48 schrieb Darren Salt:

&gt; Could you also try not reverting that and instead applying one or
&gt; both of the attached patches? Both playback and eject need to be
&gt; tested. You should use the drive's eject button, though there's no
&gt; harm in also checking xine-lib's eject code.

Ok, here's a modified patch, a combination of your two patches, with a
little fix. It works fine here, pressing the vcd button on xine-ui
starts playing vcd's directly and when pressing the stop button, I can
eject the CD by pressing the eject button on the cd drive.

I hope it's ok for you.

--
Machs gut    | http://www.iivs.de/schwinde/buerger/tremmel/
             | http://packman.links2linux.de/
Manfred      | http://www.knightsoft-net.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 development branche
Am Samstag, 26. Mai 2007 17:48 schrieb Darren Salt:

&gt; Could you also try not reverting that and instead applying one or
&gt; both of the attached patches? Both playback and eject need to be
&gt; tested. You should use the drive's eject button, though there's no
&gt; harm in also checking xine-lib's eject code.

Ok, here's a modified patch, a combination of your two patches, with a
little fix. It works fine here, pressing the vcd button on xine-ui
starts playing vcd's directly and when pressing the stop button, I can
eject the CD by pressing the eject button on the cd drive.

I hope it's ok for you.

--
Machs gut    | http://www.iivs.de/schwinde/buerger/tremmel/
             | http://packman.links2linux.de/
Manfred      | http://www.knightsoft-net.de
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert comments (and the occasional string where it doesn't matter) to UTF-8.</title>
<updated>2007-05-16T23:24:21+00:00</updated>
<author>
<name>Darren Salt</name>
<email>linux@youmustbejoking.demon.co.uk</email>
</author>
<published>2007-05-16T23:24:21+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=5f170aeb405f44ce67bf8827494c2a933b3e3241'/>
<id>5f170aeb405f44ce67bf8827494c2a933b3e3241</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>v4l: replace faulty use of xprintf with lprintf.</title>
<updated>2007-05-16T16:37:06+00:00</updated>
<author>
<name>Simon Farnsworth</name>
<email>simon.farnsworth@onelan.co.uk</email>
</author>
<published>2007-05-16T16:37:06+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=fd15adf6069b03be949c7c8d7e0f743b9ee6b90b'/>
<id>fd15adf6069b03be949c7c8d7e0f743b9ee6b90b</id>
<content type='text'>
The current input_v4l in xine-lib 1.1.6 is inherently buggy (it will
deference an invalid pointer in extract_mrl if the MRL contains a V4L input
name or frequency).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current input_v4l in xine-lib 1.1.6 is inherently buggy (it will
deference an invalid pointer in extract_mrl if the MRL contains a V4L input
name or frequency).
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Remove packet count from demux_ts, to remove a long delay</title>
<updated>2007-05-02T16:31:11+00:00</updated>
<author>
<name>Simon Farnsworth</name>
<email>simon.farnsworth@onelan.co.uk</email>
</author>
<published>2007-05-02T16:31:11+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=f7bd2c6ee4e3f066248e087cbf5f97a21103ebd1'/>
<id>f7bd2c6ee4e3f066248e087cbf5f97a21103ebd1</id>
<content type='text'>
The attached patch applies after my logging patches (I can regenerate if
needed).

demux_ts attempted to read packets from the input 200 times before
giving up. When playing a local file, this is harmless, as it will hit
EOF 200 times; however, input_dvb waits 5 seconds for packets on each
call to read, resulting in a 1000 second delay if tuning fails.

Remove the counting of input packets, and add a comment to read() in
input_plugin.h, to indicate that we expect inputs to try and return some
data when read() is called. This fixes the delay, and makes it clear to
future maintainers that they shouldn't expect to loop like this.
--
Simon Farnsworth
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The attached patch applies after my logging patches (I can regenerate if
needed).

demux_ts attempted to read packets from the input 200 times before
giving up. When playing a local file, this is harmless, as it will hit
EOF 200 times; however, input_dvb waits 5 seconds for packets on each
call to read, resulting in a 1000 second delay if tuning fails.

Remove the counting of input packets, and add a comment to read() in
input_plugin.h, to indicate that we expect inputs to try and return some
data when read() is called. This fixes the delay, and makes it clear to
future maintainers that they shouldn't expect to loop like this.
--
Simon Farnsworth
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Enhance logging in demux_ts, input_dvb and video_out_xv</title>
<updated>2007-05-02T16:23:48+00:00</updated>
<author>
<name>Simon Farnsworth</name>
<email>simon.farnsworth@onelan.co.uk</email>
</author>
<published>2007-05-02T16:23:48+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=84133d2fad4c392de75d41d88a19850734ea5523'/>
<id>84133d2fad4c392de75d41d88a19850734ea5523</id>
<content type='text'>
The three attached patches (against 1.1.6) each increase the amount of
debug logging in their respective components. We've found the extra
logging useful when trying to track down faults.

I've split this into three patches to make it easier to apply only some
of our changes.
--
Comments welcome,

Simon Farnsworth
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The three attached patches (against 1.1.6) each increase the amount of
debug logging in their respective components. We've found the extra
logging useful when trying to track down faults.

I've split this into three patches to make it easier to apply only some
of our changes.
--
Comments welcome,

Simon Farnsworth
</pre>
</div>
</content>
</entry>
<entry>
<title>Correct the dvba:// MRL / tuner mismatch message.</title>
<updated>2007-05-13T02:38:43+00:00</updated>
<author>
<name>Darren Salt</name>
<email>linux@youmustbejoking.demon.co.uk</email>
</author>
<published>2007-05-13T02:38:43+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=0f6bdecec4561e7475c31ef8434785d9855001bc'/>
<id>0f6bdecec4561e7475c31ef8434785d9855001bc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Throw a XINE_MSG_PERMISSION_ERROR error when HTTP returns a 401 status</title>
<updated>2007-05-11T15:27:50+00:00</updated>
<author>
<name>hadess@cookie.hadess.net</name>
<email>none@none</email>
</author>
<published>2007-05-11T15:27:50+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=cbdad87eb7b57d4da0fd679f9b86c6f0aeacd5b3'/>
<id>cbdad87eb7b57d4da0fd679f9b86c6f0aeacd5b3</id>
<content type='text'>
Patch from Dmitri Fedortchenko &lt;dimo &lt;at&gt; angelhill.net&gt;, required
for upstream Totem bug:
http://bugzilla.gnome.org/show_bug.cgi?id=418316
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Patch from Dmitri Fedortchenko &lt;dimo &lt;at&gt; angelhill.net&gt;, required
for upstream Totem bug:
http://bugzilla.gnome.org/show_bug.cgi?id=418316
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix building of CDDA input on FreeBSD, the NetBSD patch broke it as sys/scsiio.h is not present on FreeBSD.</title>
<updated>2007-05-04T14:45:59+00:00</updated>
<author>
<name>Diego 'Flameeyes' Pettenò</name>
<email>flameeyes@gmail.com</email>
</author>
<published>2007-05-04T14:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://vdr-projects.e-tobi.net/git/xine-lib/commit/?id=103cacaacde15ad95564e3327c88ec135c91b230'/>
<id>103cacaacde15ad95564e3327c88ec135c91b230</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
