Skip to content

shiny::reactiveValues() causes infinite loop #117

Closed

Description

@hadley
library(shiny)
waldo::compare(reactiveValues(), reactiveValues())
# ... eventually
Error in is_namespaced_call(x) : node stack overflow

Activity

  1. hadley commented on Mar 9, 2022

    @hadley
    MemberAuthor

    Traceback

    ....
    12: compare_by_name(x, y, paths, opts)
    11: compare_structure(x_fields, y_fields, paths, opts = opts)
    10: compare_structure(x = extract_fun(x, idx[[i]]), y = extract_fun(y, 
            idx[[i]]), paths = c(x_paths[[i]], y_paths[[i]]), opts = opts)
    9: compare_by_name(x, y, paths, opts)
    8: compare_structure(x_fields, y_fields, paths, opts = opts)
    7: compare_structure(x = extract_fun(x, idx[[i]]), y = extract_fun(y, 
           idx[[i]]), paths = c(x_paths[[i]], y_paths[[i]]), opts = opts)
    6: compare_by_name(x, y, paths, opts)
    5: compare_structure(x_fields, y_fields, paths, opts = opts)
    4: compare_structure(x = extract_fun(x, idx[[i]]), y = extract_fun(y, 
           idx[[i]]), paths = c(x_paths[[i]], y_paths[[i]]), opts = opts)
    3: compare_by_name(x, y, paths, opts)
    2: compare_structure(x, y, paths = c(x_arg, y_arg), opts = opts)
    1: waldo::compare(reactiveValues(), reactiveValues())
    
  2. hadley commented on Mar 9, 2022

    @hadley
    MemberAuthor

    Inspect the paths reveals the problem:

    "new$impl$.allValuesDeps$self$self$self"
  3. hadley commented on Mar 10, 2022

    @hadley
    MemberAuthor

    Oh because R6 classes are special cased to compare by value, but don't check if they've already seen the environment.

  4. added a commit that references this issue on Mar 10, 2022
    5c6e1c1
  5. added a commit that references this issue on Mar 10, 2022
    51c2158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions