Olaf Mersmann
2010-Feb-19 23:00 UTC
[Rd] Fix for incorrect use of restrict in xz third party code
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 Cheers, Olaf Mersmann
Prof Brian Ripley
2010-Feb-20 07:17 UTC
[Rd] Fix for incorrect use of restrict in xz third party code
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.patchWe 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