Re: [Rd] Support for signing R packages with GPG

2016-11-01 Thread Jeroen Ooms
On Tue, Oct 25, 2016 at 7:22 PM, Martyn Plummer  wrote:
> Thanks Jeroen. The R Foundation has recently formed a working group to
> look into package authentication. There are basically two models. One
> is the GPG based model you describe; the other is to use X.509 as
> implemented in the PKI package. It's not yet clear which way to go but
> we are thinking about it.

I look forward to hearing what the working group comes up with. I
suppose if you go with x509, CRAN is going to perform CA duties?

Let me know if I can help with implementation, either via gpg or x509.
I am actively developing the openssl package which includes many more
x509 utilities, supporting all common key types (dsa, rsa, ec),
certificate bundles, ssl, etc. The main difference with PKI is that
openssl uses the native pem/der parsers from libssl which are more
robust and also recognize the less common formats, so that we don't
have to deal with parsing/decoding ASN.1 in R.

I will be happy to adapt/extend it further to fit the needs of the
workgroup and help this move forward.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] BUG?: On Linux setTimeLimit() fails to propagate timeout error when it occurs (works on Windows)

2016-11-01 Thread Henrik Bengtsson
On Mon, Oct 31, 2016 at 9:36 AM,   wrote:
> On Mon, 31 Oct 2016, Henrik Bengtsson wrote:
>
>> Thank you for looking into this Luke.
>>
>> On Thu, Oct 27, 2016 at 9:26 AM,   wrote:
>>>
>>> On unix, unless event polling is enabled Sys.sleep just waits in a
>>> select() call (with a SIGINT handler in place) so the elapsed time
>>> isn't checked until after the select call is complete. Rstudio uses
>>> event polling, and in particular sets R_wait_usec to 1, which
>>> means event and interrupt checks happen during a Sys.seep call.  The R
>>> GUI on macOS doesn't seem to do this (but my lldb skills aren't up to
>>> checking). Now that we have this elapsed time limit mechanism it might
>>> be a good idea to set the default for R_wait_usec to something
>>> reasonable on unix in general. 10 might be a good value.
>>>
>>
>>> A more worrying thing I noticed while looking at this is that blocking
>>> reads on fifos and pipes and probably sockets are not interruptable --
>>> that should probably be looked into.
>
>
> I'll address the sleep issue sometime soon but I won't be able to look
> into the blocking read issue for many months. SOmeone else might have
> a chance to look earlier.

Thanks.

So, if I understand it correctly, my example showing that
setTimeLimit() doesn't work properly on Linux was unfortunately
misleading, mainly due to me choosing Sys.sleep() and it does indeed
work in most cases (except connections).  For example, this works

slowfcn <- function(time) { t0 <- Sys.time(); while(Sys.time() - t0 <
time) Sys.sleep(0.1); TRUE }
setTimeLimit(elapsed = 1.0)
system.time(slowfcn(3))
## Error in Sys.sleep(0.1) : reached elapsed time limit
## Timing stopped at: 0.004 0 1.008

> But for the situation you describe below using setTimeLimit doesn't
> seem like the right approach. The parallel code is not written for
> situations that need this kind of fault tolerance; it is not robust to
> user interrupts and would not be to timer interrupts either. If you
> are concerned that some potential workers might not be available then
> you would be better checking that with a ping or simple ssh commend
> first before starting a cluster on the available nodes.

Yes, true. I didn't want to sidetrack the discussion too much, but
I've started to make some standalone improvements based on
parallel:::newPSOCKnode() & parallel:::.slaveRSOCK(), e.g. more
control options for launching remote workers, say, over SSH with
reverse tunneling (no need for port forwarding) and then running
Rscript within a Docker container, e.g.

https://github.com/HenrikBengtsson/future/blob/develop/R/makeClusterPSOCK.R
https://github.com/HenrikBengtsson/future/blob/develop/incl/makeClusterPSOCK.R

This part is fully backward compatible with makePSOCKcluster() and
could be eventually be implemented in parallel itself.  The next level
up could be to make the worker loop to handle connection-setup
timeouts and similar.

By now I'm fairly ok with testing and validating remote SSH access
etc, but I think it's possible to make exception handling a little bit
more automatic and informative, particularly the part detecting when
the connection and worker setup actually never happens.  For a
newcomer, it can be quite a challenge to troubleshoot why the setup of
remote workers doesn't work.

Thanks,

Henrik

>
> Best,
>
> luke
>
>
>>
>> This is actually related to the use case where I want to use
>> setTimeLimit().  When using parallel:::newPSOCKnode(), there's a
>> 30-day timeout associated with the socket connection.  Now, this long
>> timeout is needed in order for long-running tasks to not to timeout
>> the master-worker connection.   However, when it comes to the actual
>> setup of the connection, then it would be able to detect connection
>> issues earlier than that.  For example, if the socket connection
>> cannot be established within 60 seconds, then it is very likely that
>> the worker machine couldn't be reached, especially for connecting to
>> remote machines over SSH.
>>
>> The current code of parallel:::newPSOCKnode() basically does:
>>
>> system("ssh remote.server.org Rscript -e > back>", wait = FALSE)
>> con <- socketConnection("localhost", port = 11000, server = TRUE,
>> blocking = TRUE, open = "a+b", timeout = 30*24*60*60)
>>
>> If the remote SSH system call fails to reach or set up the worker, the
>> following call to socketConnection() will sit there and wait for 30
>> days.  Ideally one could solve this as:
>>
>> system("ssh remote.server.org Rscript -e > back>", wait = FALSE)
>> setTimeLimit(elapsed=60)
>> con <- socketConnection("localhost", port = 11000, server = TRUE,
>> blocking = TRUE, open = "a+b", timeout = 30*24*60*60)
>>
>> Thanks,
>>
>> Henrik
>>
>>>
>>> Best,
>>>
>>> luke
>>>
>>>
>>> On Wed, 26 Oct 2016, peter dalgaard wrote:
>>>
 Spencer also had tools and rsconnect loaded (via a namespace) but it
 doesn't seem to make a difference for me if I load them. It also doesn't
 seem to matter for me whether it is 

[Rd] as.formula("x") error on C stack limit

2016-11-01 Thread András Tajti
Dear all,
I tried to run as.formula("x") and got an error message "Error: C stack
usage  7971120 is too close to the limit" whether x exists or not. This is
not the case in as.formula("y"), where "object 'y'  not found" is the error
message if y not exists, or "invalid formula" error or a formula depending
on y. Can anyone confirm this is not my special problem, or if it is, why
it can happen?

Thank you:
András

Below the output of sessionInfo():

R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=hu_HU.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=hu_HU.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=hu_HU.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=hu_HU.UTF-8 LC_IDENTIFICATION=C

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

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] as.formula("x") error on C stack limit

2016-11-01 Thread William Dunlap via R-devel
Another example uses formula.character's other arguments:
> as.formula("env")
Error: object of type 'special' is not subsettable
> as.formula("...")
Error in eval(expr, envir, enclos) : '...' used in an incorrect context


It may happen for the same reason that the following does not give an error:
> y <- "response ~ pred1 + pred2"
> as.formula("y")
response ~ pred1 + pred2

and that the followings give a somewhat surprising result

> f <- function(x) { y <- "foo ~ bar" ; as.formula(x) }
> f("y")
response ~ pred1 + pred2


The character method for formula works well if its 'x' argument looks like
a formula, but it doesn't act consistently otherwise.



Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Tue, Nov 1, 2016 at 12:54 PM, András Tajti  wrote:

> Dear all,
> I tried to run as.formula("x") and got an error message "Error: C stack
> usage  7971120 is too close to the limit" whether x exists or not. This is
> not the case in as.formula("y"), where "object 'y'  not found" is the error
> message if y not exists, or "invalid formula" error or a formula depending
> on y. Can anyone confirm this is not my special problem, or if it is, why
> it can happen?
>
> Thank you:
> András
>
> Below the output of sessionInfo():
>
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 14.04.5 LTS
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>  [3] LC_TIME=hu_HU.UTF-8LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=hu_HU.UTF-8LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=hu_HU.UTF-8   LC_NAME=C
>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
> [11] LC_MEASUREMENT=hu_HU.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> [[alternative HTML version deleted]]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] as.formula("x") error on C stack limit

2016-11-01 Thread András Tajti
Thank you for the exhausting answer.

Is it possible to add a note to the help page regarding the conclusion (or
even the edge cases)?

is it possible to add any validation for x in formula.character?

On 1 November 2016 at 21:48, William Dunlap  wrote:

> Another example uses formula.character's other arguments:
> > as.formula("env")
> Error: object of type 'special' is not subsettable
> > as.formula("...")
> Error in eval(expr, envir, enclos) : '...' used in an incorrect context
>
>
> It may happen for the same reason that the following does not give an
> error:
> > y <- "response ~ pred1 + pred2"
> > as.formula("y")
> response ~ pred1 + pred2
>
> and that the followings give a somewhat surprising result
>
> > f <- function(x) { y <- "foo ~ bar" ; as.formula(x) }
> > f("y")
> response ~ pred1 + pred2
> 
>
> The character method for formula works well if its 'x' argument looks like
> a formula, but it doesn't act consistently otherwise.
>
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Tue, Nov 1, 2016 at 12:54 PM, András Tajti  wrote:
>
>> Dear all,
>> I tried to run as.formula("x") and got an error message "Error: C stack
>> usage  7971120 is too close to the limit" whether x exists or not. This is
>> not the case in as.formula("y"), where "object 'y'  not found" is the
>> error
>> message if y not exists, or "invalid formula" error or a formula depending
>> on y. Can anyone confirm this is not my special problem, or if it is, why
>> it can happen?
>>
>> Thank you:
>> András
>>
>> Below the output of sessionInfo():
>>
>> R version 3.3.1 (2016-06-21)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>> Running under: Ubuntu 14.04.5 LTS
>>
>> locale:
>>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>>  [3] LC_TIME=hu_HU.UTF-8LC_COLLATE=en_US.UTF-8
>>  [5] LC_MONETARY=hu_HU.UTF-8LC_MESSAGES=en_US.UTF-8
>>  [7] LC_PAPER=hu_HU.UTF-8   LC_NAME=C
>>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=hu_HU.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats graphics  grDevices utils datasets  methods   base
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] Running package tests and not stop on first fail

2016-11-01 Thread Jan Gorecki
Hello community/devs,
Is there an option to run package tests during R CMD check and not stop on
first error? I know that testing frameworks (testhat and others) can do
that but asking about just R and base packages. Currently when package
check runs test scripts in ./tests directory it will stop after first fail.
Do you think it could be optionally available to continue to run tests
after failures?
Regards,
Jan Gorecki

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel