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

From: Renaud Gaujoux <renaud_at_mancala.cbio.uct.ac.za>
Date: Wed, 17 Aug 2011 18:12:24 +0200


Hi,

When loading a package that provides the user-supplied RNG hook user_unif_rand, calling getNativeSymbolInfo("user_unif_rand") returns informations about the loaded symbol.
I am using this to identify which package currently provides the RNG hook. The results are the same on windows and linux if only one library provides the hook.

If one loads a second package that provides this hook, then on linux (Ubuntu 10.10), calling again getNativeSymbolInfo("user_unif_rand") returns the latest symbol information (which I presume is the correct result).
On windows (XP and Vista) however the symbol information does not change (same pointer address) and the package data is NULL. See results for both systems below. I tested this with R 2.12.1, 2.13.0 and 2.13.1 on Windows.

Is this a normal behaviour for dll loaded on Windows? Thank you.

Renaud

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

# LINUX
#####################

 > library(rlecuyer)
 > getNativeSymbolInfo("user_unif_rand")
$name

[1] "user_unif_rand"

$address

<pointer: 0x7ff55acffed0>
attr(,"class")
[1] "NativeSymbol"

$package

DLL name: rlecuyer
Filename:
/home/renaud/R/x86_64-pc-linux-gnu-library/2.12/rlecuyer/libs/rlecuyer.so Dynamic lookup: TRUE

attr(,"class")
[1] "NativeSymbolInfo"
 > library(rstream)
 > getNativeSymbolInfo("user_unif_rand")
$name

[1] "user_unif_rand"

$address

<pointer: 0x7ff55aaf58c0>
attr(,"class")
[1] "NativeSymbol"

$package

DLL name: rstream
Filename:
/home/renaud/R/x86_64-pc-linux-gnu-library/2.12/rstream/libs/rstream.so Dynamic lookup: TRUE

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

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

# WINDOWS
#####################

 > library(rlecuyer)
 > getNativeSymbolInfo("user_unif_rand")
$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"
 > library(rstream)
 > getNativeSymbolInfo("user_unif_rand")
$name

[1] "user_unif_rand"

$address

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

$package

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

###
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 Wed 17 Aug 2011 - 16:15:37 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