{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shiny/issues/1191","repository_url":"https://api.github.com/repos/rstudio/shiny","labels_url":"https://api.github.com/repos/rstudio/shiny/issues/1191/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shiny/issues/1191/comments","events_url":"https://api.github.com/repos/rstudio/shiny/issues/1191/events","html_url":"https://github.com/rstudio/shiny/issues/1191","id":154873562,"number":1191,"title":"catching segfault on exit from shiny apps after upgrade to R 3.3","user":{"login":"nicholasjhirad","id":13593075,"avatar_url":"https://avatars.githubusercontent.com/u/13593075?v=3","gravatar_id":"","url":"https://api.github.com/users/nicholasjhirad","html_url":"https://github.com/nicholasjhirad","followers_url":"https://api.github.com/users/nicholasjhirad/followers","following_url":"https://api.github.com/users/nicholasjhirad/following{/other_user}","gists_url":"https://api.github.com/users/nicholasjhirad/gists{/gist_id}","starred_url":"https://api.github.com/users/nicholasjhirad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicholasjhirad/subscriptions","organizations_url":"https://api.github.com/users/nicholasjhirad/orgs","repos_url":"https://api.github.com/users/nicholasjhirad/repos","events_url":"https://api.github.com/users/nicholasjhirad/events{/privacy}","received_events_url":"https://api.github.com/users/nicholasjhirad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-14T20:14:55Z","updated_at":"2016-05-15T00:40:35Z","closed_at":null,"body":"Getting a segfault on most of my apps **on exit** from the app after the upgrade to 3.3, \r\n\r\nin case it was an issue with my package reinstall, \r\nI tried uninstalling via brew, zeroing out my package directory and \r\nreinstalling. Still getting the same result, \r\nseems to be coming from `httpuv`\r\n\r\n```\r\n> sessionInfo()\r\nR version 3.3.0 (2016-05-03)\r\nPlatform: x86_64-apple-darwin14.5.0 (64-bit)\r\nRunning under: OS X 10.10.5 (Yosemite)\r\n\r\nlocale:\r\n[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8\r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base\r\n\r\nloaded via a namespace (and not attached):\r\n[1] tools_3.3.0\r\n\r\n```\r\n```\r\n\r\nOutput:\r\n> runApp()\r\n\r\nListening on http://127.0.0.1:5154\r\nLoading required package: ggplot2\r\nStackoverflow is a great place to get help:\r\nhttp://stackoverflow.com/tags/ggplot2.\r\n\r\nAttaching package: ‘plotly’\r\n\r\nThe following object is masked from ‘package:ggplot2’:\r\n\r\n    last_plot\r\n\r\nThe following object is masked from ‘package:graphics’:\r\n\r\n    layout\r\n\r\n\r\n *** caught segfault ***\r\naddress 0xfffffffd03b57f5c, cause 'memory not mapped'\r\n\r\nTraceback:\r\n 1: order(x, na.last = na.last, decreasing = decreasing, method = \"radix\")\r\n 2: sort.int(x, na.last = na.last, decreasing = decreasing, ...)\r\n 3: sort.default(as.integer(.callbacks$keys()), decreasing = TRUE)\r\n 4: sort(as.integer(.callbacks$keys()), decreasing = TRUE)\r\n 5: private$closedCallbacks$invoke(onError = printError, ..stacktraceon = TRUE)\r\n 6: shinysession$wsClosed()\r\n 7: handler()\r\n 8: (function (handle) {    ws <- .wsconns[[as.character(handle)]]    ws$.handle <- NULL    rm(list = as.character(handle), pos = .wsconns)    for (handler in ws$.closeCallbacks) {        handler()    }})(\"140537608806768\")\r\n 9: eval(substitute(expr), envir, enclos)\r\n10: evalq((function (handle) {    ws <- .wsconns[[as.character(handle)]]    ws$.handle <- NULL    rm(list = as.character(handle), pos = .wsconns)    for (handler in ws$.closeCallbacks) {        handler()    }})(\"140537608806768\"), <environment>)\r\n11: doTryCatch(return(expr), name, parentenv, handler)\r\n12: tryCatchOne(expr, names, parentenv, handlers[[1L]])\r\n13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])\r\n14: doTryCatch(return(expr), name, parentenv, handler)\r\n15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])\r\n16: tryCatchList(expr, classes, parentenv, handlers)\r\n17: tryCatch(evalq((function (handle) {    ws <- .wsconns[[as.character(handle)]]    ws$.handle <- NULL    rm(list = as.character(handle), pos = .wsconns)    for (handler in ws$.closeCallbacks) {        handler()    }})(\"140537608806768\"), <environment>), error = function (x) x, interrupt = function (x) x)\r\n18: .Call(\"httpuv_run\", PACKAGE = \"httpuv\", timeoutMillis)\r\n19: run(timeoutMs)\r\n20: service(timeout)\r\n21: serviceApp()\r\n22: withCallingHandlers(expr, error = function(e) {    if (is.null(attr(e, \"stack.trace\", exact = TRUE))) {        calls <- sys.calls()        attr(e, \"stack.trace\") <- calls        stop(e)    }})\r\n23: captureStackTraces(while (!.globals$stopped) {    serviceApp()    Sys.sleep(0.001)})\r\n24: ..stacktraceoff..(captureStackTraces(while (!.globals$stopped) {    serviceApp()    Sys.sleep(0.001)}))\r\n25: runApp()\r\n\r\nPossible actions:\r\n1: abort (with core dump, if enabled)\r\n2: normal R exit\r\n3: exit R without saving workspace\r\n4: exit R saving workspace\r\nSelection:\r\n```\r\n\r\nserver.R:\r\n\r\n\r\n```\r\nlibrary(shiny)\r\nlibrary(shinydashboard)\r\nlibrary(data.table)\r\nlibrary(DT)\r\nlibrary(plotly)\r\n\r\n\r\n\r\nfunction(input, output, session) {\r\n\r\n      datastread <- reactiveFileReader(\r\n        1000,session,\r\n         filePath = '../runDailyPull.Rout', \r\n         readFunc = readLines\r\n        )\r\n\r\n      output$OUTTEXT <- renderText({\r\n        paste0(datastread(),collapse = '\\n')\r\n      })\r\n\r\n      output$AudioAlert <- renderUI({\r\n        tags$audio(src = \"wavs/tempwav.wav\", \r\n                           type = \"audio/wav\", \r\n                           autoplay = NA, \r\n                           controls = NA)\r\n      })\r\n      \r\n}\r\n```\r\n\r\n```\r\nui.R:\r\n\r\nlibrary(shiny)\r\nlibrary(shinydashboard)\r\nlibrary(DT)\r\nlibrary(data.table)\r\n\r\nlibrary(plotly)\r\n\r\nFullpage <-\r\n dashboardPage(\r\n   dashboardHeader(disable = TRUE),\r\n   dashboardSidebar(\r\n     disable = TRUE\r\n     ),\r\n   dashboardBody(\r\n     verbatimTextOutput('OUTTEXT')\r\n   )\r\n )\r\n\r\nFullpage\r\n\r\n```\r\n\r\nNotes: \r\n\r\nI switched to a simpler version of the UI.R and still reproduced the crash,\r\n\r\non the server side, I removed each element one-by-one, and strangely removing each reactive element individually fixes the problem, but as a whole it still crashes.\r\n\r\nI deleted the .Rhistory, .RData, and .Rproj folders in case it was something from the old one transferring, still no luck.\r\n\r\nCan anyone reproduce this?\r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/shiny/issues/comments/219259468","html_url":"https://github.com/rstudio/shiny/issues/1191#issuecomment-219259468","issue_url":"https://api.github.com/repos/rstudio/shiny/issues/1191","id":219259468,"user":{"login":"nicholasjhirad","id":13593075,"avatar_url":"https://avatars.githubusercontent.com/u/13593075?v=3","gravatar_id":"","url":"https://api.github.com/users/nicholasjhirad","html_url":"https://github.com/nicholasjhirad","followers_url":"https://api.github.com/users/nicholasjhirad/followers","following_url":"https://api.github.com/users/nicholasjhirad/following{/other_user}","gists_url":"https://api.github.com/users/nicholasjhirad/gists{/gist_id}","starred_url":"https://api.github.com/users/nicholasjhirad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicholasjhirad/subscriptions","organizations_url":"https://api.github.com/users/nicholasjhirad/orgs","repos_url":"https://api.github.com/users/nicholasjhirad/repos","events_url":"https://api.github.com/users/nicholasjhirad/events{/privacy}","received_events_url":"https://api.github.com/users/nicholasjhirad/received_events","type":"User","site_admin":false},"created_at":"2016-05-15T00:40:35Z","updated_at":"2016-05-15T00:40:35Z","body":"https://cran.r-project.org/src/base/NEWS\r\n\r\nSeems like some changes were made to `on.exit()`\r\n\r\nbut debug(on.exit) never seems to trigger, so maybe that's not it either."}}