{"action":"created","issue":{"url":"https://api.github.com/repos/BOINC/boinc/issues/1530","repository_url":"https://api.github.com/repos/BOINC/boinc","labels_url":"https://api.github.com/repos/BOINC/boinc/issues/1530/labels{/name}","comments_url":"https://api.github.com/repos/BOINC/boinc/issues/1530/comments","events_url":"https://api.github.com/repos/BOINC/boinc/issues/1530/events","html_url":"https://github.com/BOINC/boinc/issues/1530","id":151084563,"number":1530,"title":"boinc crashes when directory cannot be opened","user":{"login":"jengelh","id":8861948,"avatar_url":"https://avatars.githubusercontent.com/u/8861948?v=3","gravatar_id":"","url":"https://api.github.com/users/jengelh","html_url":"https://github.com/jengelh","followers_url":"https://api.github.com/users/jengelh/followers","following_url":"https://api.github.com/users/jengelh/following{/other_user}","gists_url":"https://api.github.com/users/jengelh/gists{/gist_id}","starred_url":"https://api.github.com/users/jengelh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jengelh/subscriptions","organizations_url":"https://api.github.com/users/jengelh/orgs","repos_url":"https://api.github.com/users/jengelh/repos","events_url":"https://api.github.com/users/jengelh/events{/privacy}","received_events_url":"https://api.github.com/users/jengelh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-26T09:20:40Z","updated_at":"2016-04-26T09:53:01Z","closed_at":null,"body":"```\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x00007ffff5e04dd9 in readdir64 () from /lib64/libc.so.6\r\nMissing separate debuginfos, use: zypper install krb5-mini-debuginfo-1.12.1-30.1.x86_64 libX11-6-debuginfo-1.6.3-3.1.x86_64 libXau6-debuginfo-1.0.8-6.1.x86_64 libXext6-debuginfo-1.3.3-3.1.x86_64 libXss1-debuginfo-1.2.2-10.1.x86_64 libcom_err2-debuginfo-1.42.11-10.2.x86_64 libcurl4-debuginfo-7.37.0-7.1.x86_64 libgcc_s1-debuginfo-5.3.1+r233831-6.1.x86_64 libidn11-debuginfo-1.28-4.1.x86_64 libkeyutils1-debuginfo-1.5.9-4.3.x86_64 libldap-2_4-2-debuginfo-2.4.41-11.1.x86_64 libopenssl1_0_0-debuginfo-1.0.1i-12.1.x86_64 libpcre1-debuginfo-8.33-3.5.x86_64 libsasl2-3-debuginfo-2.1.26-8.1.x86_64 libselinux1-debuginfo-2.3-5.1.x86_64 libssh2-1-debuginfo-1.4.3-12.1.x86_64 libstdc++6-debuginfo-5.3.1+r233831-6.1.x86_64 libxcb1-debuginfo-1.11.1-1.1.x86_64 libz1-debuginfo-1.2.8-6.4.x86_64\r\n(gdb) bt\r\n#0  0x00007ffff5e04dd9 in readdir64 () from /lib64/libc.so.6\r\n#1  0x00000000004a3ccb in X_display_values_initialize () at hostinfo_unix.cpp:1993\r\n#2  0x00000000004a4589 in xss_idle (idle_threshold=idle_threshold@entry=60) at hostinfo_unix.cpp:2048\r\n#3  0x00000000004a4b9f in HOST_INFO::users_idle (this=this@entry=0x70dea0 <gstate+16576>, \r\n    check_all_logins=<optimized out>, idle_time_to_run=<optimized out>) at hostinfo_unix.cpp:2173\r\n#4  0x00000000004217fe in CLIENT_STATE::poll_slow_events (this=0x709de0 <gstate>) at client_state.cpp:930\r\n#5  0x000000000047ff70 in boinc_main_loop () at main.cpp:375\r\n#6  0x0000000000408049 in main (argc=1, argv=0x7fffffffea08) at main.cpp:542\r\n\r\n(gdb) up ... up ... up\r\n#1  0x00000000004a3ccb in X_display_values_initialize () at hostinfo_unix.cpp:1993\r\n1993      while ((dirp = readdir(dp)) != NULL) {\r\n(gdb) p dp\r\n$1 = (DIR *) 0x0\r\n\r\n1985      struct dirent *dirp;\r\n1986      if((dp = opendir(dir.c_str())) == NULL) {\r\n1987        if ( log_flags.idle_detection_debug ) {\r\n1988          msg_printf(NULL, MSG_INFO, \r\n1989            \"[idle_detection] Error (%d) opening %s.\", errno, dir.c_str());\r\n1990        }\r\n1991      }\r\n```\r\nGreat, so it checks for NULL but then passes it to readdir anyway :-/"},"comment":{"url":"https://api.github.com/repos/BOINC/boinc/issues/comments/214688272","html_url":"https://github.com/BOINC/boinc/issues/1530#issuecomment-214688272","issue_url":"https://api.github.com/repos/BOINC/boinc/issues/1530","id":214688272,"user":{"login":"ChristianBeer","id":997210,"avatar_url":"https://avatars.githubusercontent.com/u/997210?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristianBeer","html_url":"https://github.com/ChristianBeer","followers_url":"https://api.github.com/users/ChristianBeer/followers","following_url":"https://api.github.com/users/ChristianBeer/following{/other_user}","gists_url":"https://api.github.com/users/ChristianBeer/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristianBeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristianBeer/subscriptions","organizations_url":"https://api.github.com/users/ChristianBeer/orgs","repos_url":"https://api.github.com/users/ChristianBeer/repos","events_url":"https://api.github.com/users/ChristianBeer/events{/privacy}","received_events_url":"https://api.github.com/users/ChristianBeer/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T09:53:01Z","updated_at":"2016-04-26T09:53:01Z","body":"I'm not sure, that's why I pinged the original author. See the comment later in this function. It fills in some defaults to get the idle detection going (hopefully). I didn't check what the caller of X_display_values_initialize does on an empty list or how your system would react when those defaults are probed."}}