From schlather at math.uni-goettingen.de  Tue Jan 27 16:20:07 2009
From: schlather at math.uni-goettingen.de (schlather at math.uni-goettingen.de)
Date: Tue, 27 Jan 2009 16:20:07 +0100 (CET)
Subject: [Rd] uninitialised value in R (PR#13476)
Message-ID: <20090127152007.9980A282EFF8@mail.pubhealth.ku.dk>


Hi,

I get an "Conditional jump or move depends on uninitialised value(s)"
from valgrind when using 'solve' in combination with some simple
C-code. (I did not use other functions of R besides 'solve'.)

In detail: running

R --vanilla -d "valgrind --tool=memcheck --memcheck:leak-check=yes
--num-callers=20 "

and calling

.Call("XXX")
nd <- 3
solve(diag(nd) , as.vector(1:nd))
.Call("XXX")

gives the above valgrind message for the second call of "XXX".
Without "solve" in the middle, there is no message
from valgrind.

Best regards,
Martin


/////////////////////////////// C source file u.cc
#include "u.h"

SEXP XXX() {
  SEXP ans;
  PROTECT (ans = allocVector(INTSXP, 1));
  INTEGER(ans)[0] = 1;
  UNPROTECT(1);
  return ans;
}


/////////////////////////////// header file u.h
#ifndef RFsimu_public_H
#define RFsimu_public_H 1

#include <R.h>
#include <Rinternals.h>
#include <Rmath.h>
#include <Rdefines.h>

extern "C" SEXP XXX();


#endif /* RF_simu_PUBLIC_H*/






--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = Under development (unstable)
 major = 2
 minor = 9.0
 year = 2009
 month = 01
 day = 13
 svn rev = 47573
 language = R
 version.string = R version 2.9.0 Under development (unstable)
(2009-01-13 r47573)

Locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices,
package:utils, package:datasets, package:methods, Autoloads, package:base

-- 
Prof. Dr. Martin Schlather
Institut f?r Mathematische Stochastik & Zentrum f?r Statistik
Georg-August-Universit?t G?ttingen
Goldschmidtstr. 7, 5.111
D -- 37077 G?ttingen

schlather at math.uni-goettingen.de
http://www.stochastik.math.uni-goettingen.de/~schlather
http://zfs.uni-goettingen.de/
phone: +49 (0)551 39 17 2131       fax : +49 (0)551 39 13 505



[Rd] uninitialised value in R (PR#13476)
schlather at math.uni-goettingen.de