{"action":"opened","issue":{"url":"https://api.github.com/repos/stan-dev/stan/issues/1443","labels_url":"https://api.github.com/repos/stan-dev/stan/issues/1443/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/stan/issues/1443/comments","events_url":"https://api.github.com/repos/stan-dev/stan/issues/1443/events","html_url":"https://github.com/stan-dev/stan/issues/1443","id":73734374,"number":1443,"title":"sum() seg faults with a 0-sized array","user":{"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},"labels":[{"url":"https://api.github.com/repos/stan-dev/stan/labels/Bug","name":"Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-06T20:53:52Z","updated_at":"2015-05-06T20:53:52Z","closed_at":null,"body":"## Bug Report\r\n\r\n__Version__\r\n\r\n2.6.2\r\n\r\n__Description__\r\n\r\nHere's a simple Stan model that demonstrates behavior:\r\n\r\n```stan\r\ntransformed data {\r\n  real y[0];\r\n  real x;\r\n\r\n  x <- sum(y);\r\n}\r\nparameters {\r\n  real<lower=0, upper=1> theta;\r\n}\r\nmodel {\r\n}\r\n```\r\n\r\n__Steps__\r\n\r\nThat run in CmdStan seg faults. In RStan, R dies.\r\n\r\n__Output__\r\n\r\n```\r\nSegmentation fault: 11\r\n```\r\n\r\n__Expected Output__\r\n\r\nI'm expecting sum() of a 0-length array to be 0.\r\n\r\n__Additional Information__\r\n\r\nThanks, @itsawonderfulwonderful."}}