{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/WSL/issues/3589","repository_url":"https://api.github.com/repos/Microsoft/WSL","labels_url":"https://api.github.com/repos/Microsoft/WSL/issues/3589/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/WSL/issues/3589/comments","events_url":"https://api.github.com/repos/Microsoft/WSL/issues/3589/events","html_url":"https://github.com/Microsoft/WSL/issues/3589","id":366454588,"node_id":"MDU6SXNzdWUzNjY0NTQ1ODg=","number":3589,"title":"LeakSanitizer leads to the program exiting with an error code with no output when leaks are present","user":{"login":"zeux","id":1106629,"node_id":"MDQ6VXNlcjExMDY2Mjk=","avatar_url":"https://avatars2.githubusercontent.com/u/1106629?v=4","gravatar_id":"","url":"https://api.github.com/users/zeux","html_url":"https://github.com/zeux","followers_url":"https://api.github.com/users/zeux/followers","following_url":"https://api.github.com/users/zeux/following{/other_user}","gists_url":"https://api.github.com/users/zeux/gists{/gist_id}","starred_url":"https://api.github.com/users/zeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeux/subscriptions","organizations_url":"https://api.github.com/users/zeux/orgs","repos_url":"https://api.github.com/users/zeux/repos","events_url":"https://api.github.com/users/zeux/events{/privacy}","received_events_url":"https://api.github.com/users/zeux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-03T17:50:10Z","updated_at":"2018-10-03T17:50:10Z","closed_at":null,"author_association":"NONE","body":"In Windows October 2018 update (1809, build 17763.1) leak sanitizer no longer produces a visible error in the output (#3053). However, if the program has any leaks, the program exits with code 1 but doesn't produce any output.\r\n\r\nI suspect that in a successful execution (with no leaks), leak sanitizer still fails to run correctly, but the output is suppressed. I may be wrong since it's hard to analyze the behavior considering that leak sanitizer doesn't guarantee that it works under strace.\r\n\r\nSTR:\r\nCompile the following code with `clang++ -fsanitize=address` and run:\r\n\r\n```\r\nint main()\r\n{\r\n    new int;\r\n}\r\n```\r\n\r\nRunning the program produces no output, but the exit code is 1. strace gives the following result:\r\n\r\n```\r\nprctl(PR_SET_PTRACER, 467)              = 0\r\nfutex(0x7ffff8e66960, FUTEX_WAKE, 1)    = 1\r\nwait4(467, NULL, __WALL, NULL)          = -1 ECHILD (No child processes)\r\nmunmap(0x7fc5323f0000, 2101248)         = 0\r\ngetpid()                                = 466\r\nwrite(2, \"==466==LeakSanitizer has encountered a fatal error.\\n\", 52) = -1 EBADF (Bad file descriptor)\r\nwrite(2, \"ReportFile::Write() can't output requested buffer!\\n\", 51) = -1 EBADF (Bad file descriptor)\r\nexit_group(1)                           = ?\r\n+++ exited with 1 +++\r\n```\r\n\r\nI suspect that the root cause is that wait4 on the pid that was set as ptracer fails."}}
{"actor":{"display_login":"zeux"}}