From ripley at stats.ox.ac.uk  Fri Mar 14 20:00:52 2014
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 14 Mar 2014 19:00:52 +0000
Subject: [Rd] Conditional jump or move depends on uninitialised value(s)
In-Reply-To: <20140314175625.11267aj8gcymx4co@www.staffmail.ed.ac.uk>
References: <20140314175625.11267aj8gcymx4co@www.staffmail.ed.ac.uk>
Message-ID: <532351E4.7080006@stats.ox.ac.uk>

On 14/03/2014 17:56, Jarrod Hadfield wrote:
> Hi,
>
> I'm using valgrind to check over some C/C++ code for an R library. I'm

R package?

> getting the report (see below), but can't track down the uninitialised
> value(s). I tried using  --track-origins=yes in valgrind which gives:
>
> ==28258==  Uninitialised value was created by a stack allocation
> ==28258==    at 0xEE33D98: ??? (in /usr/lib64/R/lib/libRlapack.so)
>
> I presume the problem is an uninitialised value being used in my code,
> rather than in libRlapack, but there is a better way of tracking down
> where it is?

You need debug symbols.  Maybe available for your unstated platform, or 
build a version of R with an internal LAPACK.

I doubt this is you: 'Writing R Extensions' has

'Note that memory access errors may be seen with LAPACK, BLAS and 
Java-using packages: some at least of these seem to be intentional, and 
some are related to passing characters to Fortran.'

Also, it is entirely possible that this is a non-current version of 
LAPACK: quite a few things like this have been plugged recently.  For 
example, Fedora currently has 3.4.2 and 3.5.0 has been out for a lot 
longer than Fedora 20.

>
> Cheers,
>
> Jarrod
>
>> R -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes"
>
> ==28258== Conditional jump or move depends on uninitialised value(s)
> ==28258==    at 0xEE87208: dstemr_ (in /usr/lib64/R/lib/libRlapack.so)
> ==28258==    by 0xEE7F39B: dsyevr_ (in /usr/lib64/R/lib/libRlapack.so)
> ==28258==    by 0x15B23BD9: ??? (in /usr/lib64/R/modules/lapack.so)
> ==28258==    by 0x15B28397: ??? (in /usr/lib64/R/modules/lapack.so)
> ==28258==    by 0x35CA4BFEAC: ??? (in /usr/lib64/R/lib/libR.so)
> ==28258==    by 0x35CA4C8A1F: Rf_eval (in /usr/lib64/R/lib/libR.so)
> ==28258==    by 0x35CA4BB310: Rf_applyClosure (in /usr/lib64/R/lib/libR.so)
> ==28258==    by 0x35CA4C58F9: ??? (in /usr/lib64/R/lib/libR.so)
> ==28258==    by 0x35CA4C8A1F: Rf_eval (in /usr/lib64/R/lib/libR.so)
> ==28258==    by 0x35CA4BB310: Rf_applyClosure (in /usr/lib64/R/lib/libR.so)
> ==28258==    by 0x35CA4C8ACC: Rf_eval (in /usr/lib64/R/lib/libR.so)
> ==28258==    by 0x35CA4CAEE7: ??? (in /usr/lib64/R/lib/libR.so)
> ==28258==  Uninitialised value was created by a stack allocation
> ==28258==    at 0xEE33D98: ??? (in /usr/lib64/R/lib/libRlapack.so)
>
>


-- 
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] Conditional jump or move depends on uninitialised value(s)
Prof Brian Ripley