Bug 17253 - Call stack incorrectly duplicates call to evalq
Summary: Call stack incorrectly duplicates call to evalq
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Language (show other bugs)
Version: R-devel (trunk)
Hardware: x86_64/x64/amd64 (64-bit) OS X Mavericks
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2017-04-04 20:08 UTC by Jonathan
Modified: 2017-04-07 16:43 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan 2017-04-04 20:08:05 UTC
In R 3.4.0 devel, the call frames appear incorrect during invocations of the evalq function. In particular, the call frame following "evalq" appears to just be a copy of the call frame in which evalq was originally invoked. 

For instance, here's what sys.calls() shows in R 3.4.0: 

> evalq(sys.calls())
[[1]]
evalq(sys.calls())

[[2]]
evalq(sys.calls())


In prior releases of R, the callstack showed the call from evalq to eval. Here is output from R 3.3.2:

> evalq(sys.calls())
[[1]]
evalq(sys.calls())

[[2]]
eval(substitute(expr), envir, enclos)

It might also be worth noting that other functions which act on the callstack appear to work as expected. For instance, it's clear that the second function on the stack is eval, not evalq, using sys.function():

> evalq(browser())
Called from: evalq(browser())
Browse[1]> sys.function(1)
function (expr, envir = parent.frame(), enclos = if (is.list(envir) || 
    is.pairlist(envir)) parent.frame() else baseenv()) 
.Internal(eval(substitute(expr), envir, enclos))
<bytecode: 0x7f90ef8278a0>
<environment: namespace:base>
Browse[1]> sys.function(2)
.Primitive("eval")


platform       x86_64-apple-darwin15.6.0                         
arch           x86_64                                            
os             darwin15.6.0                                      
system         x86_64, darwin15.6.0                              
status         Under development (unstable)                      
major          3                                                 
minor          4.0                                               
year           2017                                              
month          03                                                
day            21                                                
svn rev        72380                                             
language       R                                                 
version.string R Under development (unstable) (2017-03-21 r72380)
nickname       Unsuffered Consequences
Comment 1 Tomas Kalibera 2017-04-05 15:18:09 UTC
Thanks for the report. This difference is a byproduct of intentional changes in the call expressions. Note that we had

> evalq()
Error in eval(substitute(expr), envir, enclos) : 
  argument is missing, with no default

but now we have

> evalq()
Error in evalq() : argument is missing, with no default

which seems clearer and more useful. In the sys.calls output, the change is probably a bit confusing, instead. I'll try to handle this as part of other fixes in call expressions that will be necessary in the future.
Comment 2 Martin Maechler 2017-04-07 16:06:11 UTC
Is this the reason why -- for me --  RStudio completely stops working with
R 3.4.0 beta and R-devel ?
(i.e., the main window comes up, including the text menu entries, but it does not even start the "spinning wheel" and the window remains blank (apart from the top menu entries).
Comment 3 Jonathan 2017-04-07 16:43:20 UTC
This bug does break some aspects of RStudio's debugger, but it doesn't cause the behavior you describe. There are a number of known issues with R 3.4.0 and RStudio; the behavior you're describing doesn't sound like something we've fixed (but could be related to the new graphics device version).

We will be releasing a patch build in the next couple of weeks which addresses the R 3.4.0 compatibility issues. If you'd like to try a pre-release build, you can pick one up from here:

https://dailies.rstudio.com/

Make sure to select your platform and then choose a 1.0.x build as the 1.1.x builds aren't from the stable branch.

If the pre-release build still doesn't boot for you, send me an e-mail (jonathan@rstudio.com) with your platform info and we'll take a look.