Closed johnfrombluff closed 4 years ago
Dear John, thank you very much for your message. I can confirm that there is a problem in Fedora, I managed to reproduce it in a VirtualBox VM on my Mac. Unfortunately, the problem seems to be in the V8 package, a dependency of dagitty. It crashes when executing the underlying JavaScript code generated by dagitty. It should not be possible for the V8 package to crash when executing JavaScript code. I will contact the maintainer of that package, @jeroen with a minimal example and see whether he's willing to investigate this. If not, I'll try to find a workaround.
Best regards Johannes
Dear Johannes,
Thank you very much indeed for your quick and helpful reply. I really appreciate your help, and your amazing package.
Best wishes,
John
This might be an issue with the libv8 that ships with Fedora. We saw this before on MacOS, there is even a special mention of this in the V8 source code. Tracking the problem here: https://github.com/jeroen/V8/issues/65
Some questions: why does dagitty need ICU? Are you doing string operations on characters?
Could you maybe check if the same problem occurs when you run the same js code in nodejs
on the same Fedora version? R and Node share the same V8 engine, so if we can reproduce the problem in nodejs, that makes it easier to explain to the Fedora people.
Hi all, and sorry this took me so long. I was on vacation the past couple of weeks.
I think I have isolated the problem. I am comparing two strings using the "localeCompare" method. This seems to require loading ICU, which then causes a segfault. Minimal example:
V8::new_context()$eval("\"a\".localeCompare(\"b\")")
I could fix this problem of course by working around the localeCompare method somehow but would it be worth fixing it in V8 itself?
Yes I would like to fix this, but the problem is not in the R bindings but in the system provided libv8 and libicu. But this example may make it easier to isolate the problem upstream in Fedora.
It looks like this might not be fixed in Fedora until they upgrade to icu 64 in Fedora 32. So if you can work around it by avoiding localeCompare()
in your code I would highly recommend that.
It seems that this will not be fixed so soon in Fedora. I therefore changed the dagitty code so that it no longer uses localeCompare. It should now work again on Fedora as per the latest commit. Closing this for the moment.
Thanks. For reference, you can track the Fedora issue here: https://bugzilla.redhat.com/show_bug.cgi?id=1755114
I'm experiencing the same under NixOS 20.03. Is this fixed in the current dagitty
master?
Hi, I'm having the exact same error '$ operator is invalid for atomic vectors and have tried uninstalling and reinstalling dagitty, R and RStudio to no avail. Has this been fixed?
Firstly, thank you very much for this great software and web service!
I'm trying to run it on Fedora 30, and get a crash with the error:
Failed to create ICU collator, are ICU data files missing?
I see this error occurs on the package build check on CRAN also.
Stacktrace:
#
Fatal error in , line 0
Failed to create ICU collator, are ICU data files missing?
# # #
FailureMessage Object: 0x7ffeada1b650
==== C stack trace ===============================
caught illegal operation address 0x7fe44b92538d, cause 'illegal operand'
Traceback: 1: context_eval(join(src), private$context) 2: get_str_output(context_eval(join(src), private$context)) 3: ct$eval(paste("global.", name, "=", value)) 4: .jsassign(xv, .jsp("GraphParser.parseGuess(global.", xv, ").toString()")) 5: doTryCatch(return(expr), name, parentenv, handler) 6: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 7: tryCatchList(expr, classes, parentenv, handlers) 8: tryCatch({ .jsassign(xv, as.character(x)) .jsassign(xv, .jsp("GraphParser.parseGuess(global.", xv, ").toString()")) r <- structure(.jsget(xv), class = "dagitty")}, error = function(e) { stop(e)}, finally = { .deleteJSVar(xv)}) 9: dagitty("pdag { I -> B; {A SN PBC} -> I; A <-> {PBC SN} }")