R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
129 stars 15 forks source link

Error, segfaualt and exit #92

Closed samtrek closed 3 months ago

samtrek commented 3 months ago

Seems the new update broke something, the error output is given below

caught segfault address (nil), cause 'memory not mapped'

Traceback: 1: fun(libname, pkgname) 2: doTryCatch(return(expr), name, parentenv, hand ler) 3: tryCatchOne(expr, names, parentenv, handlers[[ 1L]]) 4: tryCatchList(expr, classes, parentenv, handler s) 5: tryCatch(fun(libname, pkgname), error = identi ty) 6: runHook(".onAttach", ns, dirname(nspath), nsna me) 7: attachNamespace(ns, pos = pos, deps, exclude, include.only) 8: doTryCatch(return(expr), name, parentenv, hand ler) 9: tryCatchOne(expr, names, parentenv, handlers[[ 1L]]) 10: tryCatchList(expr, classes, parentenv, handler s) 11: tryCatch({ attr(package, "LibPath") <- whic h.lib.loc ns <- loadNamespace(package, lib.loc) env <- attachNamespace(ns, pos = pos, deps, ex clude, include.only)}, error = function(e) { P <- if (!is.null(cc <- conditionCall(e))) p aste(" in", deparse(cc)[1L]) else "" msg <- gettextf("package or namespace load failed for %s% s:\n %s", sQuote(package), P, conditionMes sage(e)) if (logical.return && !quietly)
message(paste("Error:", msg), domain = NA) el se stop(msg, call. = FALSE, domain = NA)}) 12: library(package, lib.loc = lib.loc, character. only = TRUE, logical.return = TRUE, warn.confl icts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include.only = i nclude.only, attach.required = attach.required) 13: doTryCatch(return(expr), name, parentenv, hand ler) 14: tryCatchOne(expr, names, parentenv, handlers[[ 1L]]) 15: tryCatchList(expr, classes, parentenv, handler s) 16: tryCatch(library(package, lib.loc = lib.loc, c haracter.only = TRUE, logical.return = TRUE, w arn.conflicts = warn.conflicts, quietly = quietly, mask.ok = mask.ok, exclude = exclude, include .only = include.only, attach.required = attach .required), error = function(e) e) 17: require(pkg, quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE) 18: .First.sys()

Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace

jalvesaq commented 3 months ago

How can we replicate it? Was it during startup? After you loaded a package?

jalvesaq commented 3 months ago

I uninstalled cmp-r and I can replicate the bug.

samtrek commented 3 months ago

I updated cmp-r to the latest version 28e63f8 (checked my update log), then opened a new .r file, nvimcom started building and then the above error came up, can the new error be due to doc_width, closed and exited from both nvim and nvim.r, opened a a .r file in a new nvim window and the same error keeps popping up.

samtrek commented 3 months ago

I uninstalled cmp-r and I can replicate the bug.

yes seems it is the source of the error. because there was no update from r.nvim

jalvesaq commented 3 months ago

This is the easiest kind of bug to fix...

jalvesaq commented 3 months ago

I misunderstood the man page of atoi: "atoi() does not detect errors". I assumed it would return 0 in any invalid case.

samtrek commented 3 months ago

This is the easiest kind of bug to fix...

yes it was a quick one, thank you for your efforts