{"action":"created","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/2609","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/2609/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/2609/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/2609/events","html_url":"https://github.com/ponylang/ponyc/issues/2609","id":307343330,"number":2609,"title":"SIGSEGV when accessing tuple element from partial function","user":{"login":"king1600","id":10788293,"avatar_url":"https://avatars2.githubusercontent.com/u/10788293?v=4","gravatar_id":"","url":"https://api.github.com/users/king1600","html_url":"https://github.com/king1600","followers_url":"https://api.github.com/users/king1600/followers","following_url":"https://api.github.com/users/king1600/following{/other_user}","gists_url":"https://api.github.com/users/king1600/gists{/gist_id}","starred_url":"https://api.github.com/users/king1600/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/king1600/subscriptions","organizations_url":"https://api.github.com/users/king1600/orgs","repos_url":"https://api.github.com/users/king1600/repos","events_url":"https://api.github.com/users/king1600/events{/privacy}","received_events_url":"https://api.github.com/users/king1600/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-21T17:23:19Z","updated_at":"2018-03-21T19:57:11Z","closed_at":null,"author_association":"NONE","body":"The segfault occurs regardless of the --debug flag.\r\nCompiler version: `0.21.3-98ce091 [release]`\r\n  * (native windows binary) `llvm 3.9.1 -- msvc-15-x64`\r\n  * (windows 10 WSL) ` llvm 3.9.1 -- gcc (Ubuntu/Linaro 6.3.0-18ubuntu2~14.04) 6.3.0 20170519`\r\n### The bugged code:\r\n```pony\r\nactor Main\r\n  new create(env: Env) =>\r\n    try _bug()?._2 as Bool end\r\n\r\n  fun _bug(): (USize, (Bool | None)) ? =>\r\n    match \"bug\"\r\n    | \"bug\" => (0, true)\r\n    | \"anything\" => (0, None)\r\n    else error end \r\n```\r\n### The segfault\r\n```\r\n0x000000000040441e in Main_tag_create_oo (this=0x7ffffe7ce400, env=0x7ffffe7cdc00) at main.pony:3\r\n3           try _bug()?._2 as Bool end\r\n```\r\ngdb backtrace:\r\n```\r\n#0  0x000000000040441e in Main_tag_create_oo (this=0x7ffffe7ce400, env=0x7ffffe7cdc00) at main.pony:3\r\n#1  0x0000000000402760 in Main_Dispatch ()\r\n#2  0x000000000040ec72 in ponyint_actor_run ()\r\n#3  0x00000000004070ad in run_thread ()\r\n#4  0x00007fffff1e76ba in start_thread (arg=0x7ffff5fb0700) at pthread_create.c:333\r\n#5  0x00007ffffeae741d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109\r\n```\r\n\r\nI do not currently have a proposed solution but the bug itself seems simple to reproduce."},"comment":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/comments/375075511","html_url":"https://github.com/ponylang/ponyc/issues/2609#issuecomment-375075511","issue_url":"https://api.github.com/repos/ponylang/ponyc/issues/2609","id":375075511,"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},"created_at":"2018-03-21T19:57:11Z","updated_at":"2018-03-21T19:57:11Z","author_association":"OWNER","body":"This is a bug in the union-to-tuple cast code generation."}}
{"actor":{"display_login":"Praetonus"}}