Skip to content
Prev 13469 / 21307 Next

[Bioc-devel] Error: node stack overflow

Great, thanks!

I was curious and did:

hpages at spectre:~/svn/R/R-3-5-branch$ svn diff -r 74669:74674 
src/library/methods/R/methodsTable.R
Index: src/library/methods/R/methodsTable.R
===================================================================
--- src/library/methods/R/methodsTable.R	(revision 74669)
+++ src/library/methods/R/methodsTable.R	(revision 74674)
@@ -697,7 +697,7 @@

  .findNextFromTable <- function(method, f, optional, envir, prev = 
character())
  {
-    fdef <- getGeneric(f)
+    fdef <- getGeneric(f, where=envir)
      env <- environment(fdef)
  ##    target <- method at target
      n <- get(".SigLength", envir = env)

That was it? Whao! Probably one of the best illustration I've seen
that a hard-to-reproduce bug doesn't necessarily require a complex
or sophisticated fix ;-) I'm not implying that the fix was easy here,
a proper fix can be hard to figure out even if it's simple.

BTW, before the fix, the 'envir' argument was ignored so I wonder if
a static code analysis tool couldn't have detected this...

H.
On 04/30/2018 03:26 PM, Michael Lawrence wrote: