{"action":"created","issue":{"url":"https://api.github.com/repos/gvansickle/ucg/issues/96","repository_url":"https://api.github.com/repos/gvansickle/ucg","labels_url":"https://api.github.com/repos/gvansickle/ucg/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/gvansickle/ucg/issues/96/comments","events_url":"https://api.github.com/repos/gvansickle/ucg/issues/96/events","html_url":"https://github.com/gvansickle/ucg/issues/96","id":179562194,"number":96,"title":"dirname() compatibility","user":{"login":"0-wiz-0","id":2221844,"avatar_url":"https://avatars.githubusercontent.com/u/2221844?v=3","gravatar_id":"","url":"https://api.github.com/users/0-wiz-0","html_url":"https://github.com/0-wiz-0","followers_url":"https://api.github.com/users/0-wiz-0/followers","following_url":"https://api.github.com/users/0-wiz-0/following{/other_user}","gists_url":"https://api.github.com/users/0-wiz-0/gists{/gist_id}","starred_url":"https://api.github.com/users/0-wiz-0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0-wiz-0/subscriptions","organizations_url":"https://api.github.com/users/0-wiz-0/orgs","repos_url":"https://api.github.com/users/0-wiz-0/repos","events_url":"https://api.github.com/users/0-wiz-0/events{/privacy}","received_events_url":"https://api.github.com/users/0-wiz-0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gvansickle/ucg/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/gvansickle/ucg/labels/portability","name":"portability","color":"006b75"}],"state":"closed","locked":false,"assignee":{"login":"gvansickle","id":14008106,"avatar_url":"https://avatars.githubusercontent.com/u/14008106?v=3","gravatar_id":"","url":"https://api.github.com/users/gvansickle","html_url":"https://github.com/gvansickle","followers_url":"https://api.github.com/users/gvansickle/followers","following_url":"https://api.github.com/users/gvansickle/following{/other_user}","gists_url":"https://api.github.com/users/gvansickle/gists{/gist_id}","starred_url":"https://api.github.com/users/gvansickle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvansickle/subscriptions","organizations_url":"https://api.github.com/users/gvansickle/orgs","repos_url":"https://api.github.com/users/gvansickle/repos","events_url":"https://api.github.com/users/gvansickle/events{/privacy}","received_events_url":"https://api.github.com/users/gvansickle/received_events","type":"User","site_admin":false},"assignees":[{"login":"gvansickle","id":14008106,"avatar_url":"https://avatars.githubusercontent.com/u/14008106?v=3","gravatar_id":"","url":"https://api.github.com/users/gvansickle","html_url":"https://github.com/gvansickle","followers_url":"https://api.github.com/users/gvansickle/followers","following_url":"https://api.github.com/users/gvansickle/following{/other_user}","gists_url":"https://api.github.com/users/gvansickle/gists{/gist_id}","starred_url":"https://api.github.com/users/gvansickle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvansickle/subscriptions","organizations_url":"https://api.github.com/users/gvansickle/orgs","repos_url":"https://api.github.com/users/gvansickle/repos","events_url":"https://api.github.com/users/gvansickle/events{/privacy}","received_events_url":"https://api.github.com/users/gvansickle/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/gvansickle/ucg/milestones/4","html_url":"https://github.com/gvansickle/ucg/milestones/Version%200.3.0","labels_url":"https://api.github.com/repos/gvansickle/ucg/milestones/4/labels","id":1476585,"number":4,"title":"Version 0.3.0","description":"","creator":{"login":"gvansickle","id":14008106,"avatar_url":"https://avatars.githubusercontent.com/u/14008106?v=3","gravatar_id":"","url":"https://api.github.com/users/gvansickle","html_url":"https://github.com/gvansickle","followers_url":"https://api.github.com/users/gvansickle/followers","following_url":"https://api.github.com/users/gvansickle/following{/other_user}","gists_url":"https://api.github.com/users/gvansickle/gists{/gist_id}","starred_url":"https://api.github.com/users/gvansickle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvansickle/subscriptions","organizations_url":"https://api.github.com/users/gvansickle/orgs","repos_url":"https://api.github.com/users/gvansickle/repos","events_url":"https://api.github.com/users/gvansickle/events{/privacy}","received_events_url":"https://api.github.com/users/gvansickle/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":21,"state":"open","created_at":"2015-12-29T02:24:10Z","updated_at":"2016-09-30T14:26:43Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-09-27T17:38:19Z","updated_at":"2016-09-30T14:26:43Z","closed_at":"2016-09-30T14:26:43Z","body":"There are two kinds of implementations of dirname(3), both valid according to POSIX. One modifies its argument, one doesn't but returns a static buffer instead (see http://pubs.opengroup.org/onlinepubs/009695399/functions/dirname.html)\r\nNetBSD provides a version of the second one.\r\nucg reliable dumps core when it tries to find its home directory, because it calls dirname() on the result of dirname().\r\n\r\nHere's a possible patch which stops the core dumps:\r\n````\r\n--- src/ArgParse.cpp.orig       2016-04-11 00:11:55.000000000 +0000\r\n+++ src/ArgParse.cpp\r\n@@ -663,6 +663,7 @@ std::string ArgParse::GetProjectRCFilena\r\n        char *current_cwd = original_cwd;\r\n        while((current_cwd != nullptr) && (current_cwd[0] != '.'))\r\n        {\r\n+               char *prev_cwd;\r\n                // If we were able to get a file descriptor to $HOME above...\r\n                if(home_fd != -1)\r\n                {\r\n@@ -710,7 +711,9 @@ std::string ArgParse::GetProjectRCFilena\r\n                }\r\n \r\n                // Go up one directory.\r\n-               current_cwd = dirname(current_cwd);\r\n+               prev_cwd = strdup(current_cwd);\r\n+               current_cwd = dirname(prev_cwd);\r\n+               free(prev_cwd);\r\n        }\r\n \r\n        // Free the cwd string.\r\n````"},"comment":{"url":"https://api.github.com/repos/gvansickle/ucg/issues/comments/250758236","html_url":"https://github.com/gvansickle/ucg/issues/96#issuecomment-250758236","issue_url":"https://api.github.com/repos/gvansickle/ucg/issues/96","id":250758236,"user":{"login":"0-wiz-0","id":2221844,"avatar_url":"https://avatars.githubusercontent.com/u/2221844?v=3","gravatar_id":"","url":"https://api.github.com/users/0-wiz-0","html_url":"https://github.com/0-wiz-0","followers_url":"https://api.github.com/users/0-wiz-0/followers","following_url":"https://api.github.com/users/0-wiz-0/following{/other_user}","gists_url":"https://api.github.com/users/0-wiz-0/gists{/gist_id}","starred_url":"https://api.github.com/users/0-wiz-0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0-wiz-0/subscriptions","organizations_url":"https://api.github.com/users/0-wiz-0/orgs","repos_url":"https://api.github.com/users/0-wiz-0/repos","events_url":"https://api.github.com/users/0-wiz-0/events{/privacy}","received_events_url":"https://api.github.com/users/0-wiz-0/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T14:26:43Z","updated_at":"2016-09-30T14:26:43Z","body":"Ah, I never answered your question about that: I think I saw the core dump because I'm compiling with stack protector turned on by default.\r\nI'll open more bug reports now :-)"}}
{"actor":{"display_login":"0-wiz-0"}}