`StackOverflowError` with Revise.jl

Hi everyone, I started to use Revise some weeks ago, really awesome to get a faster dev cycle (without julia restarts and re-precompiles all the time)! The problem now is that I always get this warning when working on my module:

┌ Warning: Failed to revise /path/to/some/file.jl: StackOverflowError()

Any ideas why this happens?
Is there a way to find out what exactly is going wrong? The warning message is not very helpful…

https://timholy.github.io/Revise.jl/stable/debugging/

Thanks; I tried to follow the Logging by default instructions, so I put this in my startup.jl:

atreplinit() do repl
    try
        @eval using Revise
        @async Revise.wait_steal_repl_backend()

        # Turn on logging
        @eval Revise.debug_logger()
    catch
        @warn "Error activating Revise.jl."
    end
end

The warning is not shown, so everything seems to work fine. Is this the correct way to enable logging everything?

When I trigger a revision on my module by modifying a file, I get the StackOverflowError-warning but the logs field of the log obtained by Revise.debug_logger() is empty…

I’ve not seen that before. Is that really the only info it prints? is generally an indication that more follows. (It’s a “vertical bracket opener.”)

If you can’t figure it out on your own, please file a Revise issue with a minimal working example demonstrating the error.

1 Like

Sorry, didn’t copy the entire message (and I’m actually on Windows right now):

┌ Warning: Failed to revise C:\path\to\some\file.jl: StackOverflowError()
└ @ Revise C:\path\to\.julia\packages\Revise\RW8TD\src\Revise.jl:546

It’s funny, it worked for 2-3 times during the last 1-2 hours, now the error is here again…
Coming up with a MWE will be very hard since it probably has something to do with the structure and/or contents of my modules…?

Then your best bet is to dev Revise and modify it something like this:

$ git diff src/Revise.jl
diff --git a/src/Revise.jl b/src/Revise.jl
index 49f670b..af69404 100644
--- a/src/Revise.jl
+++ b/src/Revise.jl
@@ -526,7 +526,7 @@ function revise()
             push!(mexsnews, handle_deletions(pkgdata, file)[1])
             push!(finished, (pkgdata, file))
         catch err
-            push!(revision_errors, (basedir(pkgdata), file, err))
+            push!(revision_errors, (basedir(pkgdata), file, err, stacktrace(catch_backtrace())))
         end
     end
     # Do the evaluation
@@ -537,13 +537,14 @@ function revise()
             eval_new!(mexsnew, fi.modexsigs)
             pkgdata.fileinfos[i] = FileInfo(mexsnew, fi)
         catch err
-            push!(revision_errors, (basedir(pkgdata), file, err))
+            push!(revision_errors, (basedir(pkgdata), file, err, stacktrace(catch_backtrace())))
         end
     end
     empty!(revision_queue)
-    for (basedir, file, err) in revision_errors
+    for (basedir, file, err, st) in revision_errors
         fullpath = joinpath(basedir, file)
         @warn "Failed to revise $fullpath: $err"
+        display(st)
     end
     tracking_Main_includes[] && queue_includes(Main)
     nothing

Then you’ll get the stacktrace that caused the error.

1 Like