example fails during R CMD CHECK but works interactively?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

example fails during R CMD CHECK but works interactively?

Charles Determan
Greetings,

I am collaborating with developing the bigmemory package and have run in to
a strange problem when we run R CMD CHECK.  For some reason that isn't
clear to us one of the examples crashes stating:

Error:  memory could not be allocated for instance of type big.matrix

You can see the output on the Travis CI page at
https://travis-ci.org/kaneplusplus/bigmemory where the error starts at line
1035.  This is completely reproducible when running
devtools::check(args='--as-cran') locally.  The part that is confusing is
that the calls work perfectly when called interactively.

Hadley comments on the 'check' page of his R packages website (
http://r-pkgs.had.co.nz/check.html) regarding test failing following R CMD
check:

Occasionally you may have a problem where the tests pass when run
interactively with devtools::test(), but fail when in R CMD check. This
usually indicates that you’ve made a faulty assumption about the testing
environment, and it’s often hard to figure it out.

Any thoughts on how to troubleshoot this problem?  I have no idea what
assumption we could have made.

Regards,
Charles

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

Dan Tenenbaum-2


----- Original Message -----

> From: "Charles Determan" <[hidden email]>
> To: [hidden email]
> Sent: Wednesday, May 13, 2015 11:31:36 AM
> Subject: [Rd] example fails during R CMD CHECK but works interactively?
>
> Greetings,
>
> I am collaborating with developing the bigmemory package and have run
> in to
> a strange problem when we run R CMD CHECK.  For some reason that
> isn't
> clear to us one of the examples crashes stating:
>
> Error:  memory could not be allocated for instance of type big.matrix
>
> You can see the output on the Travis CI page at
> https://travis-ci.org/kaneplusplus/bigmemory where the error starts
> at line
> 1035.  This is completely reproducible when running
> devtools::check(args='--as-cran') locally.  The part that is
> confusing is
> that the calls work perfectly when called interactively.
>
> Hadley comments on the 'check' page of his R packages website (
> http://r-pkgs.had.co.nz/check.html) regarding test failing following
> R CMD
> check:
>
> Occasionally you may have a problem where the tests pass when run
> interactively with devtools::test(), but fail when in R CMD check.
> This
> usually indicates that you’ve made a faulty assumption about the
> testing
> environment, and it’s often hard to figure it out.
>
> Any thoughts on how to troubleshoot this problem?  I have no idea
> what
> assumption we could have made.

Note that R CMD check runs R with environment variables set as follows (at least on my system; you can check $R_HOME/bin/check to see what it does on yours):

 R_DEFAULT_PACKAGES= LC_COLLATE=C

So try staring R like this:

 R_DEFAULT_PACKAGES= LC_COLLATE=C  R

And see if that reproduces the test failure. The locale setting could affect tests of sort order, and the default package setting could potentially affect other things.

Dan



>
> Regards,
> Charles
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

Charles Determan
Thank you Dan but it isn't my tests that are failing (all of them pass
without problem) but one of the examples from the inst/examples directory.
I did try, however, to start R with the environmental variables as you
suggest but it had no effect on my tests.

Charles

On Wed, May 13, 2015 at 1:51 PM, Dan Tenenbaum <[hidden email]>
wrote:

>
>
> ----- Original Message -----
> > From: "Charles Determan" <[hidden email]>
> > To: [hidden email]
> > Sent: Wednesday, May 13, 2015 11:31:36 AM
> > Subject: [Rd] example fails during R CMD CHECK but works interactively?
> >
> > Greetings,
> >
> > I am collaborating with developing the bigmemory package and have run
> > in to
> > a strange problem when we run R CMD CHECK.  For some reason that
> > isn't
> > clear to us one of the examples crashes stating:
> >
> > Error:  memory could not be allocated for instance of type big.matrix
> >
> > You can see the output on the Travis CI page at
> > https://travis-ci.org/kaneplusplus/bigmemory where the error starts
> > at line
> > 1035.  This is completely reproducible when running
> > devtools::check(args='--as-cran') locally.  The part that is
> > confusing is
> > that the calls work perfectly when called interactively.
> >
> > Hadley comments on the 'check' page of his R packages website (
> > http://r-pkgs.had.co.nz/check.html) regarding test failing following
> > R CMD
> > check:
> >
> > Occasionally you may have a problem where the tests pass when run
> > interactively with devtools::test(), but fail when in R CMD check.
> > This
> > usually indicates that you’ve made a faulty assumption about the
> > testing
> > environment, and it’s often hard to figure it out.
> >
> > Any thoughts on how to troubleshoot this problem?  I have no idea
> > what
> > assumption we could have made.
>
> Note that R CMD check runs R with environment variables set as follows (at
> least on my system; you can check $R_HOME/bin/check to see what it does on
> yours):
>
>  R_DEFAULT_PACKAGES= LC_COLLATE=C
>
> So try staring R like this:
>
>  R_DEFAULT_PACKAGES= LC_COLLATE=C  R
>
> And see if that reproduces the test failure. The locale setting could
> affect tests of sort order, and the default package setting could
> potentially affect other things.
>
> Dan
>
>
>
> >
> > Regards,
> > Charles
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

Charles Determan
Does anyone else have any thoughts about troubleshooting the R CMD check
environment?

Charles

On Wed, May 13, 2015 at 1:57 PM, Charles Determan <[hidden email]>
wrote:

> Thank you Dan but it isn't my tests that are failing (all of them pass
> without problem) but one of the examples from the inst/examples directory.
> I did try, however, to start R with the environmental variables as you
> suggest but it had no effect on my tests.
>
> Charles
>
> On Wed, May 13, 2015 at 1:51 PM, Dan Tenenbaum <[hidden email]>
> wrote:
>
>>
>>
>> ----- Original Message -----
>> > From: "Charles Determan" <[hidden email]>
>> > To: [hidden email]
>> > Sent: Wednesday, May 13, 2015 11:31:36 AM
>> > Subject: [Rd] example fails during R CMD CHECK but works interactively?
>> >
>> > Greetings,
>> >
>> > I am collaborating with developing the bigmemory package and have run
>> > in to
>> > a strange problem when we run R CMD CHECK.  For some reason that
>> > isn't
>> > clear to us one of the examples crashes stating:
>> >
>> > Error:  memory could not be allocated for instance of type big.matrix
>> >
>> > You can see the output on the Travis CI page at
>> > https://travis-ci.org/kaneplusplus/bigmemory where the error starts
>> > at line
>> > 1035.  This is completely reproducible when running
>> > devtools::check(args='--as-cran') locally.  The part that is
>> > confusing is
>> > that the calls work perfectly when called interactively.
>> >
>> > Hadley comments on the 'check' page of his R packages website (
>> > http://r-pkgs.had.co.nz/check.html) regarding test failing following
>> > R CMD
>> > check:
>> >
>> > Occasionally you may have a problem where the tests pass when run
>> > interactively with devtools::test(), but fail when in R CMD check.
>> > This
>> > usually indicates that you’ve made a faulty assumption about the
>> > testing
>> > environment, and it’s often hard to figure it out.
>> >
>> > Any thoughts on how to troubleshoot this problem?  I have no idea
>> > what
>> > assumption we could have made.
>>
>> Note that R CMD check runs R with environment variables set as follows
>> (at least on my system; you can check $R_HOME/bin/check to see what it does
>> on yours):
>>
>>  R_DEFAULT_PACKAGES= LC_COLLATE=C
>>
>> So try staring R like this:
>>
>>  R_DEFAULT_PACKAGES= LC_COLLATE=C  R
>>
>> And see if that reproduces the test failure. The locale setting could
>> affect tests of sort order, and the default package setting could
>> potentially affect other things.
>>
>> Dan
>>
>>
>>
>> >
>> > Regards,
>> > Charles
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > ______________________________________________
>> > [hidden email] mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-devel
>> >
>>
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

hadley wickham
Make the example print out Sys.getenv() and then manually inspect?

Otherwise, you'll need to debug the code by adding print statements.
Something clearly is not as you expect, so you need carefully
empirically verify your assumptions about the inputs to and
environment of the function.

Hadley

On Fri, May 15, 2015 at 7:05 AM, Charles Determan <[hidden email]> wrote:

> Does anyone else have any thoughts about troubleshooting the R CMD check
> environment?
>
> Charles
>
> On Wed, May 13, 2015 at 1:57 PM, Charles Determan <[hidden email]>
> wrote:
>
>> Thank you Dan but it isn't my tests that are failing (all of them pass
>> without problem) but one of the examples from the inst/examples directory.
>> I did try, however, to start R with the environmental variables as you
>> suggest but it had no effect on my tests.
>>
>> Charles
>>
>> On Wed, May 13, 2015 at 1:51 PM, Dan Tenenbaum <[hidden email]>
>> wrote:
>>
>>>
>>>
>>> ----- Original Message -----
>>> > From: "Charles Determan" <[hidden email]>
>>> > To: [hidden email]
>>> > Sent: Wednesday, May 13, 2015 11:31:36 AM
>>> > Subject: [Rd] example fails during R CMD CHECK but works interactively?
>>> >
>>> > Greetings,
>>> >
>>> > I am collaborating with developing the bigmemory package and have run
>>> > in to
>>> > a strange problem when we run R CMD CHECK.  For some reason that
>>> > isn't
>>> > clear to us one of the examples crashes stating:
>>> >
>>> > Error:  memory could not be allocated for instance of type big.matrix
>>> >
>>> > You can see the output on the Travis CI page at
>>> > https://travis-ci.org/kaneplusplus/bigmemory where the error starts
>>> > at line
>>> > 1035.  This is completely reproducible when running
>>> > devtools::check(args='--as-cran') locally.  The part that is
>>> > confusing is
>>> > that the calls work perfectly when called interactively.
>>> >
>>> > Hadley comments on the 'check' page of his R packages website (
>>> > http://r-pkgs.had.co.nz/check.html) regarding test failing following
>>> > R CMD
>>> > check:
>>> >
>>> > Occasionally you may have a problem where the tests pass when run
>>> > interactively with devtools::test(), but fail when in R CMD check.
>>> > This
>>> > usually indicates that you’ve made a faulty assumption about the
>>> > testing
>>> > environment, and it’s often hard to figure it out.
>>> >
>>> > Any thoughts on how to troubleshoot this problem?  I have no idea
>>> > what
>>> > assumption we could have made.
>>>
>>> Note that R CMD check runs R with environment variables set as follows
>>> (at least on my system; you can check $R_HOME/bin/check to see what it does
>>> on yours):
>>>
>>>  R_DEFAULT_PACKAGES= LC_COLLATE=C
>>>
>>> So try staring R like this:
>>>
>>>  R_DEFAULT_PACKAGES= LC_COLLATE=C  R
>>>
>>> And see if that reproduces the test failure. The locale setting could
>>> affect tests of sort order, and the default package setting could
>>> potentially affect other things.
>>>
>>> Dan
>>>
>>>
>>>
>>> >
>>> > Regards,
>>> > Charles
>>> >
>>> >       [[alternative HTML version deleted]]
>>> >
>>> > ______________________________________________
>>> > [hidden email] mailing list
>>> > https://stat.ethz.ch/mailman/listinfo/r-devel
>>> >
>>>
>>
>>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



--
http://had.co.nz/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

Dirk Eddelbuettel

On 15 May 2015 at 07:13, Hadley Wickham wrote:
| Make the example print out Sys.getenv() and then manually inspect?

On the systems I use    system("env")     is more efficient as it gets you
all at once.
 
| Otherwise, you'll need to debug the code by adding print statements.
| Something clearly is not as you expect, so you need carefully
| empirically verify your assumptions about the inputs to and
| environment of the function.

Exactly. No magic here, just plainstaken debugging.

As an old ~/.signature of mine said: "In theory, theory and practice are the
same. In practie, they are not."  Assumptions are good.  We all get a good
laugh out of them after the fact.

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

Martin Morgan-2
In reply to this post by Charles Determan
On 05/15/2015 05:05 AM, Charles Determan wrote:
> Does anyone else have any thoughts about troubleshooting the R CMD check
> environment?

In the pkg.Rcheck directory there is a file pkg-Ex.R.

LANGUAGE=en _R_CHECK_INTERNALS2_=1 $(R_HOME)/bin/R --vanilla pkge-Ex.R

followed by the usual strategy of bisecting the file into smaller chunks that
still reproduce the example.

(this is based on my parsing of the complicated source, most relevant at

   https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L2467

and

   https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L36

)

Martin

>
> Charles
>
> On Wed, May 13, 2015 at 1:57 PM, Charles Determan <[hidden email]>
> wrote:
>
>> Thank you Dan but it isn't my tests that are failing (all of them pass
>> without problem) but one of the examples from the inst/examples directory.
>> I did try, however, to start R with the environmental variables as you
>> suggest but it had no effect on my tests.
>>
>> Charles
>>
>> On Wed, May 13, 2015 at 1:51 PM, Dan Tenenbaum <[hidden email]>
>> wrote:
>>
>>>
>>>
>>> ----- Original Message -----
>>>> From: "Charles Determan" <[hidden email]>
>>>> To: [hidden email]
>>>> Sent: Wednesday, May 13, 2015 11:31:36 AM
>>>> Subject: [Rd] example fails during R CMD CHECK but works interactively?
>>>>
>>>> Greetings,
>>>>
>>>> I am collaborating with developing the bigmemory package and have run
>>>> in to
>>>> a strange problem when we run R CMD CHECK.  For some reason that
>>>> isn't
>>>> clear to us one of the examples crashes stating:
>>>>
>>>> Error:  memory could not be allocated for instance of type big.matrix
>>>>
>>>> You can see the output on the Travis CI page at
>>>> https://travis-ci.org/kaneplusplus/bigmemory where the error starts
>>>> at line
>>>> 1035.  This is completely reproducible when running
>>>> devtools::check(args='--as-cran') locally.  The part that is
>>>> confusing is
>>>> that the calls work perfectly when called interactively.
>>>>
>>>> Hadley comments on the 'check' page of his R packages website (
>>>> http://r-pkgs.had.co.nz/check.html) regarding test failing following
>>>> R CMD
>>>> check:
>>>>
>>>> Occasionally you may have a problem where the tests pass when run
>>>> interactively with devtools::test(), but fail when in R CMD check.
>>>> This
>>>> usually indicates that you’ve made a faulty assumption about the
>>>> testing
>>>> environment, and it’s often hard to figure it out.
>>>>
>>>> Any thoughts on how to troubleshoot this problem?  I have no idea
>>>> what
>>>> assumption we could have made.
>>>
>>> Note that R CMD check runs R with environment variables set as follows
>>> (at least on my system; you can check $R_HOME/bin/check to see what it does
>>> on yours):
>>>
>>>   R_DEFAULT_PACKAGES= LC_COLLATE=C
>>>
>>> So try staring R like this:
>>>
>>>   R_DEFAULT_PACKAGES= LC_COLLATE=C  R
>>>
>>> And see if that reproduces the test failure. The locale setting could
>>> affect tests of sort order, and the default package setting could
>>> potentially affect other things.
>>>
>>> Dan
>>>
>>>
>>>
>>>>
>>>> Regards,
>>>> Charles
>>>>
>>>>        [[alternative HTML version deleted]]
>>>>
>>>> ______________________________________________
>>>> [hidden email] mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>>
>>>
>>
>>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

Dirk Eddelbuettel
In reply to this post by Dirk Eddelbuettel

On 15 May 2015 at 07:47, Dirk Eddelbuettel wrote:
|
| On 15 May 2015 at 07:13, Hadley Wickham wrote:
| | Make the example print out Sys.getenv() and then manually inspect?
|
| On the systems I use    system("env")     is more efficient as it gets you
| all at once.

Ahh, yes, and I have since been told (thanks, Hadley) that Sys.getenv() does
just that -- and I remain a big fan of how R generally abstracts the OS away.

Dirk

--
http://dirk.eddelbuettel.com | @eddelbuettel | [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: example fails during R CMD CHECK but works interactively?

Martyn Plummer-3
In reply to this post by Charles Determan
The error can be reproduced by running the bigmemory-Ex.R script which
you can find in the bigmemory.Rcheck directory, either in batch mode or
via source() in an interactive session.

It seems that you have underlying memory allocation problems. I can get
the script to running by adding gc() calls when necessary (i.e. when a
failure is reported, add gc() just before this point in the script and
rerun).

Martyn

On Fri, 2015-05-15 at 07:05 -0500, Charles Determan wrote:

> Does anyone else have any thoughts about troubleshooting the R CMD check
> environment?
>
> Charles
>
> On Wed, May 13, 2015 at 1:57 PM, Charles Determan <[hidden email]>
> wrote:
>
> > Thank you Dan but it isn't my tests that are failing (all of them pass
> > without problem) but one of the examples from the inst/examples directory.
> > I did try, however, to start R with the environmental variables as you
> > suggest but it had no effect on my tests.
> >
> > Charles
> >
> > On Wed, May 13, 2015 at 1:51 PM, Dan Tenenbaum <[hidden email]>
> > wrote:
> >
> >>
> >>
> >> ----- Original Message -----
> >> > From: "Charles Determan" <[hidden email]>
> >> > To: [hidden email]
> >> > Sent: Wednesday, May 13, 2015 11:31:36 AM
> >> > Subject: [Rd] example fails during R CMD CHECK but works interactively?
> >> >
> >> > Greetings,
> >> >
> >> > I am collaborating with developing the bigmemory package and have run
> >> > in to
> >> > a strange problem when we run R CMD CHECK.  For some reason that
> >> > isn't
> >> > clear to us one of the examples crashes stating:
> >> >
> >> > Error:  memory could not be allocated for instance of type big.matrix
> >> >
> >> > You can see the output on the Travis CI page at
> >> > https://travis-ci.org/kaneplusplus/bigmemory where the error starts
> >> > at line
> >> > 1035.  This is completely reproducible when running
> >> > devtools::check(args='--as-cran') locally.  The part that is
> >> > confusing is
> >> > that the calls work perfectly when called interactively.
> >> >
> >> > Hadley comments on the 'check' page of his R packages website (
> >> > http://r-pkgs.had.co.nz/check.html) regarding test failing following
> >> > R CMD
> >> > check:
> >> >
> >> > Occasionally you may have a problem where the tests pass when run
> >> > interactively with devtools::test(), but fail when in R CMD check.
> >> > This
> >> > usually indicates that you’ve made a faulty assumption about the
> >> > testing
> >> > environment, and it’s often hard to figure it out.
> >> >
> >> > Any thoughts on how to troubleshoot this problem?  I have no idea
> >> > what
> >> > assumption we could have made.
> >>
> >> Note that R CMD check runs R with environment variables set as follows
> >> (at least on my system; you can check $R_HOME/bin/check to see what it does
> >> on yours):
> >>
> >>  R_DEFAULT_PACKAGES= LC_COLLATE=C
> >>
> >> So try staring R like this:
> >>
> >>  R_DEFAULT_PACKAGES= LC_COLLATE=C  R
> >>
> >> And see if that reproduces the test failure. The locale setting could
> >> affect tests of sort order, and the default package setting could
> >> potentially affect other things.
> >>
> >> Dan
> >>
> >>
> >>
> >> >
> >> > Regards,
> >> > Charles
> >> >
> >> >       [[alternative HTML version deleted]]
> >> >
> >> > ______________________________________________
> >> > [hidden email] mailing list
> >> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >> >
> >>
> >
> >
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel