stan-dev / stan-dev/rstan

Restoring workspace containing stanfit object destabilizes R

Open
#273 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

Restoring a workspace containing a stanfit object destabilizes R when a namespace that was available when the object was created is not available when the workspace is restored.

Description:

I'm working in a package in RStudio, call it Foo, and in my environment I have an object w2b that contains several stanfit objects within it (84 in total). I quit my R session and save my workspace. Later, I reopen the package, which restores the workspace, and see this message:

"Warning: namespace 'Foo" is not available and has been replaced by .GlobalEnv when processing object 'w2b'."

And now I find that various functions such as chol(), eigen(), determinant() no longer work. determinant(diag(2)) either crashes the system or returns NULL.

If I remove the object w2b from the environment, quit my R session (saving the workspace), and restart R, reopening the package Foo again, everything is fine.

Reproducible Steps:
Current Output:
Expected Output:
RStan Version:

2.9.0

R Version:

3.2.2

Operating System:

Windows 7

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names no files, tests, or entry points. Start by reproducing workspace restoration with a stanfit object while its original namespace is unavailable, then verify that restoring the workspace leaves functions such as chol(), eigen(), and determinant() working without a crash or NULL result.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.