-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
very weird bug in library.dynam2 when interaction with DLL and RJSONIO import #427
Comments
Thanks! I've had that problem too, but never managed to get to the source. Given that it only seems to occur with RJSONIO, I'd wonder if something there is set up incorrectly in the NAMESPACE or dynamic function registration. |
Does the same error happen when you do it the non-devtools way?
|
I read that jsonlite was a fork of RJSONIO. I pushed a new test (bug1a.R) and it does not crash at all. So there seems indeed to be a very nasty business with RJSONIO. |
I've basically abandoned RSJONIO because of this problem. It doesn't seem worth the effort to figure out exactly what's going wrong. |
but you still use it in shiny right ? 'cause we had the problem recently. |
You'll have to take that up with the shiny maintainers ;) |
I did a bit more investigating of this issue. The reason it doesn't cause a problem with First modify pkgdll to have an .onUnload <- function (libpath) {
library.dynam.unload("pkgdll", libpath)
} Then install pkgdll, and run the following. You'll get the same error: library(devtools)
library(methods)
install('pkgdll')
library(pkgdll)
load_all('rjsonioUser/')
rjson(1:10)
cat('######################## after first call\n')
unloadNamespace('pkgdll')
library(pkgdll)
cat('=============================before call2\n')
rjson(1:10)
# Error in .Call("R_fromJSON", content, as.integer(sum(simplify)), nullValue, :
# "R_fromJSON" not resolved from current namespace (RJSONIO)
cat('#############################after call2\n') I suspect it has something to do with R trying to unload a DLL that wasn't the last one loaded. If, after loading the packages, you run If you want to trace into the problem, you can do: dllinfo <- dyn.load(dllfile) Before you run that line, you can do In short, it looks like the problem is some interaction between R and RJSONIO. The reason you don't get it when you do |
Hello,
I've painfully managed to narrow a long-standing bug affecting my code, and to make a reproducible example.
The Context:
The problem:
reloading pkgdll makes rjsonioUser crash.
This bug only happens in R >=3, not in R 2.15.3
and with the github master and CRAN version of devtoos, on linux and osX.
The reproducible example is here: https://github.com/kforner/devtools_dll_bug.git
There are scripts called bugN.R that exemplify the bug.
They do deeper and deeper into the problem, starting from load_all to finish with dyn.load(), which is an internal function.
Run them like: Rscript bug1.R
The error message is:
Error in .Call("R_fromJSON", content, as.integer(sum(simplify)), nullValue, : "R_fromJSON" not resolved from current namespace (RJSONIO) Calls: rjson ... fromJSON -> fromJSON -> fromJSON -> fromJSON -> .Call Execution halted
I do not know if it is related to RJSONIO.
I can try to help, but I'm currently stuck, don't know what to investigate.
Karl Forner
The text was updated successfully, but these errors were encountered: