{"action":"opened","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/2156","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/2156/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/2156/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/2156/events","html_url":"https://github.com/ponylang/ponyc/issues/2156","id":249775078,"number":2156,"title":"Structure finalisers are broken","user":{"login":"Praetonus","id":5193706,"avatar_url":"https://avatars1.githubusercontent.com/u/5193706?v=4","gravatar_id":"","url":"https://api.github.com/users/Praetonus","html_url":"https://github.com/Praetonus","followers_url":"https://api.github.com/users/Praetonus/followers","following_url":"https://api.github.com/users/Praetonus/following{/other_user}","gists_url":"https://api.github.com/users/Praetonus/gists{/gist_id}","starred_url":"https://api.github.com/users/Praetonus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Praetonus/subscriptions","organizations_url":"https://api.github.com/users/Praetonus/orgs","repos_url":"https://api.github.com/users/Praetonus/repos","events_url":"https://api.github.com/users/Praetonus/events{/privacy}","received_events_url":"https://api.github.com/users/Praetonus/received_events","type":"User","site_admin":false},"labels":[{"id":335735910,"url":"https://api.github.com/repos/ponylang/ponyc/labels/bug:%202%20-%20under%20investigation","name":"bug: 2 - under investigation","color":"f9d0c4","default":false},{"id":283122504,"url":"https://api.github.com/repos/ponylang/ponyc/labels/difficulty:%203-%20hard","name":"difficulty: 3- hard","color":"b60205","default":false},{"id":359250022,"url":"https://api.github.com/repos/ponylang/ponyc/labels/needs%20discussion%20during%20sync","name":"needs discussion during sync","color":"5319e7","default":false},{"id":353596942,"url":"https://api.github.com/repos/ponylang/ponyc/labels/priority:%203%20-%20high","name":"priority: 3 - high","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-12T00:17:25Z","updated_at":"2017-08-12T00:17:25Z","closed_at":null,"body":"```pony\r\nstruct Foo\r\n  fun _final() =>\r\n    None\r\n\r\nactor Main\r\n  new create(env: Env) =>\r\n    Foo\r\n```\r\n\r\nThis code results in an invalid access to memory at runtime. This is caused by the mechanism that runs finalisers (`final_small`, `final_small_freed` and `final_large` in `mem/heap.c`), as it assumes that every object has a type descriptor and tries to access the object's finaliser through it. Since structs don't have type descriptors, this can't work with them.\r\n\r\nWe either need to revert to the old finaliser algorithm (using the GC object map) for structs or to come up with a way to store struct finalisers alongside the finaliser bitmap."}}
{"actor":{"display_login":"Praetonus"}}