{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/WSL/issues/3618","repository_url":"https://api.github.com/repos/Microsoft/WSL","labels_url":"https://api.github.com/repos/Microsoft/WSL/issues/3618/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/WSL/issues/3618/comments","events_url":"https://api.github.com/repos/Microsoft/WSL/issues/3618/events","html_url":"https://github.com/Microsoft/WSL/issues/3618","id":370739599,"node_id":"MDU6SXNzdWUzNzA3Mzk1OTk=","number":3618,"title":"pthread_cond_wait() call crashes when debugging with gdb on 1809","user":{"login":"psolstice","id":14033990,"node_id":"MDQ6VXNlcjE0MDMzOTkw","avatar_url":"https://avatars0.githubusercontent.com/u/14033990?v=4","gravatar_id":"","url":"https://api.github.com/users/psolstice","html_url":"https://github.com/psolstice","followers_url":"https://api.github.com/users/psolstice/followers","following_url":"https://api.github.com/users/psolstice/following{/other_user}","gists_url":"https://api.github.com/users/psolstice/gists{/gist_id}","starred_url":"https://api.github.com/users/psolstice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psolstice/subscriptions","organizations_url":"https://api.github.com/users/psolstice/orgs","repos_url":"https://api.github.com/users/psolstice/repos","events_url":"https://api.github.com/users/psolstice/events{/privacy}","received_events_url":"https://api.github.com/users/psolstice/received_events","type":"User","site_admin":false},"labels":[{"id":353748836,"node_id":"MDU6TGFiZWwzNTM3NDg4MzY=","url":"https://api.github.com/repos/Microsoft/WSL/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-16T18:23:22Z","updated_at":"2018-10-25T06:56:57Z","closed_at":null,"author_association":"NONE","body":"When debugging multithreaded application program randomly aborts with this backtrace:\r\n```\r\n#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51\r\n#1  0x00007ffffea90801 in __GI_abort () at abort.c:79\r\n#2  0x00007ffffead95e5 in __libc_message (action=(do_abort | do_backtrace), fmt=0x7ffffec06796 \"%s\",\r\n    fmt=0x7ffffec06796 \"%s\", action=(do_abort | do_backtrace)) at ../sysdeps/posix/libc_fatal.c:181\r\n#3  0x00007ffffead992a in __GI___libc_fatal (\r\n    message=message@entry=0x7fffff1f4180 \"The futex facility returned an unexpected error code.\")\r\n    at ../sysdeps/posix/libc_fatal.c:191\r\n#4  0x00007fffff1edaea in futex_fatal_error () at ../sysdeps/nptl/futex-internal.h:200\r\n#5  futex_wake (private=<optimized out>, processes_to_wake=<optimized out>, futex_word=<optimized out>)\r\n    at ../sysdeps/unix/sysv/linux/futex-internal.h:247\r\n#6  __condvar_confirm_wakeup (private=<optimized out>, cond=<optimized out>) at pthread_cond_wait.c:55\r\n#7  __pthread_cond_wait_common (abstime=0x0, mutex=0x8202040 <m>, cond=0x8202080 <cond>) at pthread_cond_wait.c:419\r\n#8  __pthread_cond_wait (cond=0x8202080 <cond>, mutex=0x8202040 <m>) at pthread_cond_wait.c:655\r\n```\r\n\r\nIt's likely that `lll__futex_wake` syscall returns -ETIMEDOUT (-110) which is not expected return value.\r\nThis breaks development of many C/C++ projects on WSL.\r\n\r\nWindows version: [Version 10.0.17763.55]\r\n```\r\n$ lsb_release -a\r\nNo LSB modules are available.\r\nDistributor ID: Ubuntu\r\nDescription:    Ubuntu 18.04.1 LTS\r\nRelease:        18.04\r\nCodename:       bionic\r\n```\r\n\r\nTo reproduce I created a simple program that switches between 20 threads. Steps:\r\n1. Install g++ and gdb:\r\n```\r\nsudo apt install g++ gdb\r\n```\r\n\r\n2. Extract sample program (cond_test.cpp)\r\n[cond_test.zip](https://github.com/Microsoft/WSL/files/2484507/cond_test.zip)\r\n\r\n3. Compile it and run under gdb\r\n\r\n```\r\ng++ -g -o cond_test cond_test.cpp -lpthread\r\ngdb ./cond_test\r\n```\r\n\r\n4. In gdb\r\n```\r\nbreak threadProc\r\nrun\r\n… (breakpoint hits)\r\ncont\r\ncont\r\n```\r\nafter few `cont`s (usually 4-5) program aborts. Tried this on several systems.\r\n\r\nMy theory is `futex_wake` tries to wake a thread suspended by debugger and fails. I have never encountered it in version 1803 so I suspect it's a regression.\r\n\r\nIn some cases this bug can be triggered without using debugger as shown in issue #3587 which produces similar backtrace."},"comment":{"url":"https://api.github.com/repos/Microsoft/WSL/issues/comments/432936429","html_url":"https://github.com/Microsoft/WSL/issues/3618#issuecomment-432936429","issue_url":"https://api.github.com/repos/Microsoft/WSL/issues/3618","id":432936429,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjkzNjQyOQ==","user":{"login":"therealkenc","id":7049700,"node_id":"MDQ6VXNlcjcwNDk3MDA=","avatar_url":"https://avatars1.githubusercontent.com/u/7049700?v=4","gravatar_id":"","url":"https://api.github.com/users/therealkenc","html_url":"https://github.com/therealkenc","followers_url":"https://api.github.com/users/therealkenc/followers","following_url":"https://api.github.com/users/therealkenc/following{/other_user}","gists_url":"https://api.github.com/users/therealkenc/gists{/gist_id}","starred_url":"https://api.github.com/users/therealkenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealkenc/subscriptions","organizations_url":"https://api.github.com/users/therealkenc/orgs","repos_url":"https://api.github.com/users/therealkenc/repos","events_url":"https://api.github.com/users/therealkenc/events{/privacy}","received_events_url":"https://api.github.com/users/therealkenc/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T06:56:57Z","updated_at":"2018-10-25T06:56:57Z","author_association":"COLLABORATOR","body":"> This will be worth trying on 18267. It may be related to a zombie-related bug we recently fixed.\r\n\r\nAlas, no. Still repros on 18267. That `pthread_join(t, nullptr)` seems sound enough and there shouldn't be any walking dead."}}
{"actor":{"display_login":"therealkenc"}}