{"action":"created","issue":{"url":"https://api.github.com/repos/stan-dev/stan/issues/1974","repository_url":"https://api.github.com/repos/stan-dev/stan","labels_url":"https://api.github.com/repos/stan-dev/stan/issues/1974/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/stan/issues/1974/comments","events_url":"https://api.github.com/repos/stan-dev/stan/issues/1974/events","html_url":"https://github.com/stan-dev/stan/issues/1974","id":167448095,"number":1974,"title":"integer division by zero isn't caught","user":{"login":"bob-carpenter","id":3383807,"avatar_url":"https://avatars.githubusercontent.com/u/3383807?v=3","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":[{"url":"https://api.github.com/repos/stan-dev/stan/labels/Bug","name":"Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"syclik","id":425751,"avatar_url":"https://avatars.githubusercontent.com/u/425751?v=3","gravatar_id":"","url":"https://api.github.com/users/syclik","html_url":"https://github.com/syclik","followers_url":"https://api.github.com/users/syclik/followers","following_url":"https://api.github.com/users/syclik/following{/other_user}","gists_url":"https://api.github.com/users/syclik/gists{/gist_id}","starred_url":"https://api.github.com/users/syclik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syclik/subscriptions","organizations_url":"https://api.github.com/users/syclik/orgs","repos_url":"https://api.github.com/users/syclik/repos","events_url":"https://api.github.com/users/syclik/events{/privacy}","received_events_url":"https://api.github.com/users/syclik/received_events","type":"User","site_admin":false},"assignees":[{"login":"syclik","id":425751,"avatar_url":"https://avatars.githubusercontent.com/u/425751?v=3","gravatar_id":"","url":"https://api.github.com/users/syclik","html_url":"https://github.com/syclik","followers_url":"https://api.github.com/users/syclik/followers","following_url":"https://api.github.com/users/syclik/following{/other_user}","gists_url":"https://api.github.com/users/syclik/gists{/gist_id}","starred_url":"https://api.github.com/users/syclik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syclik/subscriptions","organizations_url":"https://api.github.com/users/syclik/orgs","repos_url":"https://api.github.com/users/syclik/repos","events_url":"https://api.github.com/users/syclik/events{/privacy}","received_events_url":"https://api.github.com/users/syclik/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/stan-dev/stan/milestones/20","html_url":"https://github.com/stan-dev/stan/milestones/v2.10.0++","labels_url":"https://api.github.com/repos/stan-dev/stan/milestones/20/labels","id":1672338,"number":20,"title":"v2.10.0++","description":"Version after v2.10.0.","creator":{"login":"syclik","id":425751,"avatar_url":"https://avatars.githubusercontent.com/u/425751?v=3","gravatar_id":"","url":"https://api.github.com/users/syclik","html_url":"https://github.com/syclik","followers_url":"https://api.github.com/users/syclik/followers","following_url":"https://api.github.com/users/syclik/following{/other_user}","gists_url":"https://api.github.com/users/syclik/gists{/gist_id}","starred_url":"https://api.github.com/users/syclik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syclik/subscriptions","organizations_url":"https://api.github.com/users/syclik/orgs","repos_url":"https://api.github.com/users/syclik/repos","events_url":"https://api.github.com/users/syclik/events{/privacy}","received_events_url":"https://api.github.com/users/syclik/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":13,"state":"open","created_at":"2016-03-29T16:57:05Z","updated_at":"2016-07-25T19:39:47Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-07-25T19:39:46Z","updated_at":"2016-07-25T21:57:38Z","closed_at":null,"body":"#### Summary:\r\n\r\nInteger divide by zero throws an uncaught exception.\r\n\r\n#### Description:\r\n\r\nRunning this crashes RStan:\r\n\r\n```\r\nlibrary(rstan)\r\n\r\nmc <- '\r\nparameters {real theta;}\r\nmodel {\r\n  target += 1/0;\r\n}\r\n'\r\nsm <- stan_model(model_code = mc)\r\npost <- sampling(sm, show_messages = FALSE)\r\n```\r\n\r\nI'm reporting in Stan because in the command refactor, we'll be catching this in Stan itself.\r\n\r\n#### Reproducible Steps:\r\n\r\nSee above.\r\n\r\n#### Current Output:\r\n\r\nCrashes with `Floating point exception: 8\r\n\r\n#### Expected Output:\r\n\r\nInformative error message.\r\n\r\n\r\n#### Additional Information:\r\n\r\nOriginally reported by @davharris on RStan tracker in issue https://github.com/stan-dev/rstan/issues/316\r\n\r\n#### Current Version:\r\nv2.10.0\r\n"},"comment":{"url":"https://api.github.com/repos/stan-dev/stan/issues/comments/235098738","html_url":"https://github.com/stan-dev/stan/issues/1974#issuecomment-235098738","issue_url":"https://api.github.com/repos/stan-dev/stan/issues/1974","id":235098738,"user":{"login":"bob-carpenter","id":3383807,"avatar_url":"https://avatars.githubusercontent.com/u/3383807?v=3","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":"2016-07-25T21:57:38Z","updated_at":"2016-07-25T21:57:38Z","body":"Overload for int and check for zero in denominator?\n\nDo you know what it does throw?  If so, you could catch\nand rethrow.\n\n- Bob\n\n\n> On Jul 25, 2016, at 5:43 PM, Daniel Lee <notifications@github.com> wrote:\n> \n> The problem is in math:\n> https://github.com/stan-dev/math/blob/develop/stan/math/prim/scal/fun/divide.hpp#L25\n> \n> This line has undefined behavior:\n> \n> return std::div(x, y).quot;\n> \n> I didn't realize it threw an exception outside of the stdexcept types. Any suggestions on how to fix this call?\n> \n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n\n"}}
{"actor":{"display_login":"bob-carpenter"}}