[Rd] getNativeSymbolInfo("user_unif_rand") returns different results on windows and linux

From: Renaud Gaujoux <renaud_at_mancala.cbio.uct.ac.za>
Date: Tue, 23 Aug 2011 16:40:19 +0200


Hi,

sorry to bump this post but I did not get any reply on this puzzling issue, which looks important though.

While investigating the issue it came out that the value returned by getNativeSymbolInfo('user_unif_rand') (on Windows XP) seems to depend on whether it has already been called on the same symbol (see test code below. Each sequence needs to be run on on a fresh R session).

Things works perfectly under Linux.

Thank you for any explanation on the matter.

Renaud

########## SEQUENCE 1 ##################
library(rstream)
getNativeSymbolInfo('user_unif_rand')
# this returns complete info pointing to rstream's hook #### RESULT
$name
[1] "user_unif_rand"

$address
<pointer: 0x6ee41280>
attr(,"class")
[1] "NativeSymbol"

$package
DLL name: rstream
Filename: C:/Program

         Files/R/R-2.13.1/library/rstream/libs/i386/rstream.dll Dynamic lookup: TRUE

attr(,"class")
[1] "NativeSymbolInfo"

####

# call again getNativeSymbolInfo
getNativeSymbolInfo('user_unif_rand')
# this returns INcomplete info pointing to rstream's hook ### RESULT
$name
[1] "user_unif_rand"

$address
<pointer: 0x6ee41280>
attr(,"class")
[1] "NativeSymbol"

$package
NULL attr(,"class")
[1] "NativeSymbolInfo"

############################


########## SEQUENCE 2 ##################
library(rstream)
library(rlecuyer)
getNativeSymbolInfo('user_unif_rand')
# this returns complete info pointing to relcuyer's hook
########## RESULT ##################

$name
[1] "user_unif_rand"

$address
<pointer: 0x6bb84fb8>
attr(,"class")
[1] "NativeSymbol"

$package
DLL name: rlecuyer
Filename: C:/Program

         Files/R/R-2.13.1/library/rlecuyer/libs/i386/rlecuyer.dll Dynamic lookup: TRUE

attr(,"class")
[1] "NativeSymbolInfo"

############################

########## SEQUENCE 3 ##################
####### Load library that provides a hook for user_unif_rand library(rstream)
getNativeSymbolInfo('user_unif_rand')
# this returns complete info pointing to rstream's hook ## RESULT ##
$name
[1] "user_unif_rand"

$address
<pointer: 0x6ee41280>
attr(,"class")
[1] "NativeSymbol"

$package
DLL name: rstream
Filename: C:/Program

         Files/R/R-2.13.1/library/rstream/libs/i386/rstream.dll Dynamic lookup: TRUE

attr(,"class")
[1] "NativeSymbolInfo"

##

####### Load other library that provides the hook library(rlecuyer)
getNativeSymbolInfo('user_unif_rand')
# this returns INcomplete info pointing to rstream's hook ## RESULT ##
$name
[1] "user_unif_rand"

$address
<pointer: 0x6ee41280>
attr(,"class")
[1] "NativeSymbol"

$package
NULL attr(,"class")
[1] "NativeSymbolInfo"

############################


 > sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_South Africa.1252 LC_CTYPE=English_South
Africa.1252
[3] LC_MONETARY=English_South Africa.1252 LC_NUMERIC=C

[5] LC_TIME=English_South Africa.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rlecuyer_0.3-1 rstream_1.3.1

###

UNIVERSITY OF CAPE TOWN This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:5}}



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 23 Aug 2011 - 14:43:49 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 23 Aug 2011 - 18:30:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive