{"action":"created","issue":{"url":"https://api.github.com/repos/stan-dev/stan/issues/2576","repository_url":"https://api.github.com/repos/stan-dev/stan","labels_url":"https://api.github.com/repos/stan-dev/stan/issues/2576/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/stan/issues/2576/comments","events_url":"https://api.github.com/repos/stan-dev/stan/issues/2576/events","html_url":"https://github.com/stan-dev/stan/issues/2576","id":339641266,"node_id":"MDU6SXNzdWUzMzk2NDEyNjY=","number":2576,"title":"Segfault in optimizing for simple exponential model","user":{"login":"bob-carpenter","id":3383807,"node_id":"MDQ6VXNlcjMzODM4MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/3383807?v=4","gravatar_id":"","url":"https://api.github.com/users/bob-carpenter","html_url":"https://github.com/bob-carpenter","followers_url":"https://api.github.com/users/bob-carpenter/followers","following_url":"https://api.github.com/users/bob-carpenter/following{/other_user}","gists_url":"https://api.github.com/users/bob-carpenter/gists{/gist_id}","starred_url":"https://api.github.com/users/bob-carpenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bob-carpenter/subscriptions","organizations_url":"https://api.github.com/users/bob-carpenter/orgs","repos_url":"https://api.github.com/users/bob-carpenter/repos","events_url":"https://api.github.com/users/bob-carpenter/events{/privacy}","received_events_url":"https://api.github.com/users/bob-carpenter/received_events","type":"User","site_admin":false},"labels":[{"id":64229981,"node_id":"MDU6TGFiZWw2NDIyOTk4MQ==","url":"https://api.github.com/repos/stan-dev/stan/labels/algorithm","name":"algorithm","color":"fad8c7","default":false},{"id":55965401,"node_id":"MDU6TGFiZWw1NTk2NTQwMQ==","url":"https://api.github.com/repos/stan-dev/stan/labels/bug","name":"bug","color":"e11d21","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/stan-dev/stan/milestones/29","html_url":"https://github.com/stan-dev/stan/milestone/29","labels_url":"https://api.github.com/repos/stan-dev/stan/milestones/29/labels","id":2747006,"node_id":"MDk6TWlsZXN0b25lMjc0NzAwNg==","number":29,"title":"2.17.1++","description":"","creator":{"login":"seantalts","id":805356,"node_id":"MDQ6VXNlcjgwNTM1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/805356?v=4","gravatar_id":"","url":"https://api.github.com/users/seantalts","html_url":"https://github.com/seantalts","followers_url":"https://api.github.com/users/seantalts/followers","following_url":"https://api.github.com/users/seantalts/following{/other_user}","gists_url":"https://api.github.com/users/seantalts/gists{/gist_id}","starred_url":"https://api.github.com/users/seantalts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seantalts/subscriptions","organizations_url":"https://api.github.com/users/seantalts/orgs","repos_url":"https://api.github.com/users/seantalts/repos","events_url":"https://api.github.com/users/seantalts/events{/privacy}","received_events_url":"https://api.github.com/users/seantalts/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":23,"state":"open","created_at":"2017-09-06T02:58:43Z","updated_at":"2018-07-09T23:28:07Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-07-09T23:27:12Z","updated_at":"2018-07-09T23:29:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"_From @NathanWycoff on July 9, 2018 17:0_\n\nThis issue ported over from [here](http://discourse.mc-stan.org/t/segfault-in-simple-exponential-model/4776).\r\n\r\nHello everyone,\r\n\r\nI want to first thank the developers for an awesome software package that has helped me extensively in several projects.\r\n\r\nThis bug doesn't really affect me, but I felt like I should report it anyways. With a specific model/data combination and a specific random seed, I observe a segfault when invoking the optimizing function. The model is rather simple.\r\n\r\nSteps to reproduce:\r\n1) Please find the model attached [exp_model.txt](https://github.com/stan-dev/rstan/files/2177192/exp_model.txt)\r\n2) Please find an R script attached [breaks_stan.txt](https://github.com/stan-dev/rstan/files/2177185/breaks_stan.txt). Rename these if necessary (not sure why github won't accept R/stan files).\r\n3) Modify line 36 of the R file to point to where exp_model.stan lives on disk.\r\n4) Run the R file in its entirety. This is important to advance PRNG to the point of failure. This involves sampling from the posterior, but it terminates in less than half a second on my machine. \r\n\r\nBug Description:\r\nPosterior sampling from the model works fine. Afterwards, when trying to find the optimum, it will print the initial loglikelihood, then R will freeze for about half a minute before this message appears (the shrug emoji is just my replacement for the standard prompt):\r\n\r\n```\r\n\r\n    ¯\\_(ツ)_/¯ optimizing(mod, data = stan_dat)\r\n    Initial log joint probability = -8.18984\r\n\r\n     *** caught segfault ***\r\n    address 0x256b38fff, cause 'memory not mapped'\r\n\r\n    Traceback:\r\n     1: .External(list(name = \"CppMethod__invoke_notvoid\", address = <pointer: 0x7fdbf945fd70>,     dll = list(name = \"Rcpp\", path = \"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/libs/Rcpp.so\",         dynamicLookup = TRUE, handle = <pointer: 0x7fdbf9708d90>,         info = <pointer: 0x7fdbf986aa20>), numParameters = -1L),     <pointer: 0x7fdbf97fb9b0>, <pointer: 0x7fdbf9739640>, .pointer,     ...)\r\n     2: sampler$call_sampler(c(args, dotlist))\r\n     3: .local(object, ...)\r\n     4: optimizing(mod, data = stan_dat)\r\n     5: optimizing(mod, data = stan_dat)\r\n\r\n    Possible actions:\r\n    1: abort (with core dump, if enabled)\r\n    2: normal R exit\r\n    3: exit R without saving workspace\r\n    4: exit R saving workspace\r\n```\r\n\r\nThis only seems to occur for a specific PRNG state.\r\n\r\nFacts about the platform this was discovered on:\r\n\r\nOS: Mac OS High Sierra 10.13.2\r\n\r\nR: R version 3.4.3 (2017-11-30) -- \"Kite-Eating Tree\"\r\nCopyright (C) 2017 The R Foundation for Statistical Computing\r\nPlatform: x86_64-apple-darwin15.6.0 (64-bit)\r\n\r\nrstan (Version 2.17.3, GitRev: 2e1f913d3ca3)\r\n\r\nR was executed directly from a bash terminal.\n\n_Copied from original issue: stan-dev/rstan#545_"},"comment":{"url":"https://api.github.com/repos/stan-dev/stan/issues/comments/403651411","html_url":"https://github.com/stan-dev/stan/issues/2576#issuecomment-403651411","issue_url":"https://api.github.com/repos/stan-dev/stan/issues/2576","id":403651411,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzY1MTQxMQ==","user":{"login":"bob-carpenter","id":3383807,"node_id":"MDQ6VXNlcjMzODM4MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/3383807?v=4","gravatar_id":"","url":"https://api.github.com/users/bob-carpenter","html_url":"https://github.com/bob-carpenter","followers_url":"https://api.github.com/users/bob-carpenter/followers","following_url":"https://api.github.com/users/bob-carpenter/following{/other_user}","gists_url":"https://api.github.com/users/bob-carpenter/gists{/gist_id}","starred_url":"https://api.github.com/users/bob-carpenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bob-carpenter/subscriptions","organizations_url":"https://api.github.com/users/bob-carpenter/orgs","repos_url":"https://api.github.com/users/bob-carpenter/repos","events_url":"https://api.github.com/users/bob-carpenter/events{/privacy}","received_events_url":"https://api.github.com/users/bob-carpenter/received_events","type":"User","site_admin":false},"created_at":"2018-07-09T23:29:20Z","updated_at":"2018-07-09T23:29:20Z","author_association":"CONTRIBUTOR","body":"Thanks for reporting.  This one should be easy to track down.\n"}}
{"actor":{"display_login":"bob-carpenter"}}