{"action":"created","issue":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/573","repository_url":"https://api.github.com/repos/android-ndk/ndk","labels_url":"https://api.github.com/repos/android-ndk/ndk/issues/573/labels{/name}","comments_url":"https://api.github.com/repos/android-ndk/ndk/issues/573/comments","events_url":"https://api.github.com/repos/android-ndk/ndk/issues/573/events","html_url":"https://github.com/android-ndk/ndk/issues/573","id":275799300,"node_id":"MDU6SXNzdWUyNzU3OTkzMDA=","number":573,"title":"Miscompilation of exception handling with NDK r16 using -Oz","user":{"login":"b-spencer","id":8192579,"node_id":"MDQ6VXNlcjgxOTI1Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/8192579?v=4","gravatar_id":"","url":"https://api.github.com/users/b-spencer","html_url":"https://github.com/b-spencer","followers_url":"https://api.github.com/users/b-spencer/followers","following_url":"https://api.github.com/users/b-spencer/following{/other_user}","gists_url":"https://api.github.com/users/b-spencer/gists{/gist_id}","starred_url":"https://api.github.com/users/b-spencer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b-spencer/subscriptions","organizations_url":"https://api.github.com/users/b-spencer/orgs","repos_url":"https://api.github.com/users/b-spencer/repos","events_url":"https://api.github.com/users/b-spencer/events{/privacy}","received_events_url":"https://api.github.com/users/b-spencer/received_events","type":"User","site_admin":false},"labels":[{"id":401624399,"node_id":"MDU6TGFiZWw0MDE2MjQzOTk=","url":"https://api.github.com/repos/android-ndk/ndk/labels/clang","name":"clang","color":"c5def5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/android-ndk/ndk/milestones/13","html_url":"https://github.com/android-ndk/ndk/milestone/13","labels_url":"https://api.github.com/repos/android-ndk/ndk/milestones/13/labels","id":2808957,"node_id":"MDk6TWlsZXN0b25lMjgwODk1Nw==","number":13,"title":"r18","description":"","creator":{"login":"DanAlbert","id":315852,"node_id":"MDQ6VXNlcjMxNTg1Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/315852?v=4","gravatar_id":"","url":"https://api.github.com/users/DanAlbert","html_url":"https://github.com/DanAlbert","followers_url":"https://api.github.com/users/DanAlbert/followers","following_url":"https://api.github.com/users/DanAlbert/following{/other_user}","gists_url":"https://api.github.com/users/DanAlbert/gists{/gist_id}","starred_url":"https://api.github.com/users/DanAlbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanAlbert/subscriptions","organizations_url":"https://api.github.com/users/DanAlbert/orgs","repos_url":"https://api.github.com/users/DanAlbert/repos","events_url":"https://api.github.com/users/DanAlbert/events{/privacy}","received_events_url":"https://api.github.com/users/DanAlbert/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":14,"state":"open","created_at":"2017-10-03T01:14:04Z","updated_at":"2018-06-21T23:12:42Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2017-11-21T17:33:41Z","updated_at":"2018-06-21T23:12:42Z","closed_at":"2018-06-21T23:12:42Z","author_association":"NONE","body":"#### Description\r\n\r\nWhen using Android NDK r16, C++ code that throws an exception does not always work.  Our analysis so far points to an error in the exception handling tables when compiled with `-Oz`.  The same code works as expected with NDK r15c or when `-Os` is used instead of `-Oz`.\r\n\r\nI have prepared a repository that demonstrates the issue.  This repository also includes a PDF that details the exact nature of this specific miscompilation.\r\n\r\nhttps://github.com/b-spencer/android-ndk-r16-miscompilation\r\n\r\nOutput with r15c or r16 with `-Os`:\r\n```\r\nbytes: 8080\r\nexpected1\r\nbytes: 8080\r\nexpected2\r\n```\r\n\r\nOutput with r16 with `-Oz` (the default):\r\n```\r\nbytes: 8080\r\nexpected1\r\nbytes: fa33\r\n$$$$$$$$$$$$$$$$ FAILED\r\nexpected2\r\n```\r\n\r\n#### Environment Details\r\n\r\n* NDK Version: 16.0.4442984\r\n* Clang Version: Android clang version 5.0.300080  (based on LLVM 5.0.300080)\r\n* Build sytem: ndk-build\r\n* Host OS: Linux Debian 9\r\n* Compiler: clang\r\n* ABI: armeabi\r\n* STL: c++_shared\r\n* NDK API level: android-24\r\n* Device API level: android-24\r\n"},"comment":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/comments/399271839","html_url":"https://github.com/android-ndk/ndk/issues/573#issuecomment-399271839","issue_url":"https://api.github.com/repos/android-ndk/ndk/issues/573","id":399271839,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTI3MTgzOQ==","user":{"login":"rprichard","id":1572855,"node_id":"MDQ6VXNlcjE1NzI4NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/1572855?v=4","gravatar_id":"","url":"https://api.github.com/users/rprichard","html_url":"https://github.com/rprichard","followers_url":"https://api.github.com/users/rprichard/followers","following_url":"https://api.github.com/users/rprichard/following{/other_user}","gists_url":"https://api.github.com/users/rprichard/gists{/gist_id}","starred_url":"https://api.github.com/users/rprichard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rprichard/subscriptions","organizations_url":"https://api.github.com/users/rprichard/orgs","repos_url":"https://api.github.com/users/rprichard/repos","events_url":"https://api.github.com/users/rprichard/events{/privacy}","received_events_url":"https://api.github.com/users/rprichard/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T23:12:42Z","updated_at":"2018-06-21T23:12:42Z","author_association":"NONE","body":"I retested https://github.com/rprichard/android-ndk-r16-miscompilation, and it passed now. The upstream bug was fixed in https://reviews.llvm.org/rL321996. It's included in the r18 canary clang (4751641 based on r328903).\r\n\r\nThe NDK build systems still default to -Os rather than -Oz. Should we switch it back?"}}
{"actor":{"display_login":"rprichard"}}