From ripley at stats.ox.ac.uk  Sat Feb 20 08:17:14 2010
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 20 Feb 2010 07:17:14 +0000 (GMT)
Subject: [Rd] Fix for incorrect use of restrict in xz third party code
In-Reply-To: <1266619960-sup-1764@bloxx.local>
References: <1266619960-sup-1764@bloxx.local>
Message-ID: <alpine.LFD.2.00.1002200711230.25269@gannet.stats.ox.ac.uk>

On Sat, 20 Feb 2010, Olaf Mersmann wrote:

> Hello,
>
> the included XZ Utils source code contains an incorrect use of the
> restrict keyword. This leads to data corruption under certain
> circumstances. For a short discussion of the problem see
>
>  http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/3306733
>
> This was fixed in the XZ Utils git repository in commit
>
>  commit 49cfc8d392cf535f8dd10233225b1fc726fec9ef
>  Author: Lasse Collin <lasse.collin at tukaani.org>
>  Date:   Tue Sep 15 21:07:23 2009 +0300
>
>    Fix incorrect use of "restrict".
>
> Since then, there has not been a proper release of the XZ Utils so I
> have applied said patch to the sources included in R and added a note
> to the R_changes file in the src/extra/xz/ directory detailing the
> changes.
>
> This 'bug' is only triggered if the Intel C or gcc 4.4 is used to
> compile R and the included liblzma is used instead of a system wide
> one, so it might not be worth the trouble of patching the sources
> instead of waiting for a new release. If anyone wants to apply a fix,
> I have prepared a patch with all the changes which can be found here
>
>  http://www.statistik.tu-dortmund.de/~olafm/temp/xz_restrict.patch

We had been waiting for xz 5.000, but decided to go with 4.999 
for R 2.10.0 as it was so long a-coming -- and are still waiting.

We do use the included sources on several platforms, and with gcc 
4.4.4 on 64-bit Windows, so I will patch this, thank you.

>
> Cheers,
> Olaf Mersmann

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Fix for incorrect use of restrict in xz third party code
Prof Brian Ripley