{"action":"created","issue":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3167","repository_url":"https://api.github.com/repos/fish-shell/fish-shell","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3167/labels{/name}","comments_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3167/comments","events_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3167/events","html_url":"https://github.com/fish-shell/fish-shell/issues/3167","id":162080505,"number":3167,"title":"fish's `timef()` function should kill the program if `gettimeofday()` fails","user":{"login":"krader1961","id":7545917,"avatar_url":"https://avatars.githubusercontent.com/u/7545917?v=3","gravatar_id":"","url":"https://api.github.com/users/krader1961","html_url":"https://github.com/krader1961","followers_url":"https://api.github.com/users/krader1961/followers","following_url":"https://api.github.com/users/krader1961/following{/other_user}","gists_url":"https://api.github.com/users/krader1961/gists{/gist_id}","starred_url":"https://api.github.com/users/krader1961/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krader1961/subscriptions","organizations_url":"https://api.github.com/users/krader1961/orgs","repos_url":"https://api.github.com/users/krader1961/repos","events_url":"https://api.github.com/users/krader1961/events{/privacy}","received_events_url":"https://api.github.com/users/krader1961/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fish-shell/fish-shell/labels/cleanup","name":"cleanup","color":"bfdadc"}],"state":"open","locked":false,"assignee":{"login":"krader1961","id":7545917,"avatar_url":"https://avatars.githubusercontent.com/u/7545917?v=3","gravatar_id":"","url":"https://api.github.com/users/krader1961","html_url":"https://github.com/krader1961","followers_url":"https://api.github.com/users/krader1961/followers","following_url":"https://api.github.com/users/krader1961/following{/other_user}","gists_url":"https://api.github.com/users/krader1961/gists{/gist_id}","starred_url":"https://api.github.com/users/krader1961/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krader1961/subscriptions","organizations_url":"https://api.github.com/users/krader1961/orgs","repos_url":"https://api.github.com/users/krader1961/repos","events_url":"https://api.github.com/users/krader1961/events{/privacy}","received_events_url":"https://api.github.com/users/krader1961/received_events","type":"User","site_admin":false},"assignees":[{"login":"krader1961","id":7545917,"avatar_url":"https://avatars.githubusercontent.com/u/7545917?v=3","gravatar_id":"","url":"https://api.github.com/users/krader1961","html_url":"https://github.com/krader1961","followers_url":"https://api.github.com/users/krader1961/followers","following_url":"https://api.github.com/users/krader1961/following{/other_user}","gists_url":"https://api.github.com/users/krader1961/gists{/gist_id}","starred_url":"https://api.github.com/users/krader1961/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krader1961/subscriptions","organizations_url":"https://api.github.com/users/krader1961/orgs","repos_url":"https://api.github.com/users/krader1961/repos","events_url":"https://api.github.com/users/krader1961/events{/privacy}","received_events_url":"https://api.github.com/users/krader1961/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/4","html_url":"https://github.com/fish-shell/fish-shell/milestones/fish-future","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/4/labels","id":130257,"number":4,"title":"fish-future","description":"These are issues that are not targeted for an upcoming minor or major release. After a release, we will re-examine these issues and pull any in that we think are good targets; that is retarget them to the next minor (or major) release.\r\n\r\nIf you can provide a fix for an issue in this milestone, we'll generally accept it for the next release even if the issue is not targeted for the release.","creator":{"login":"ridiculousfish","id":920838,"avatar_url":"https://avatars.githubusercontent.com/u/920838?v=3","gravatar_id":"","url":"https://api.github.com/users/ridiculousfish","html_url":"https://github.com/ridiculousfish","followers_url":"https://api.github.com/users/ridiculousfish/followers","following_url":"https://api.github.com/users/ridiculousfish/following{/other_user}","gists_url":"https://api.github.com/users/ridiculousfish/gists{/gist_id}","starred_url":"https://api.github.com/users/ridiculousfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridiculousfish/subscriptions","organizations_url":"https://api.github.com/users/ridiculousfish/orgs","repos_url":"https://api.github.com/users/ridiculousfish/repos","events_url":"https://api.github.com/users/ridiculousfish/events{/privacy}","received_events_url":"https://api.github.com/users/ridiculousfish/received_events","type":"User","site_admin":false},"open_issues":372,"closed_issues":3,"state":"open","created_at":"2012-06-11T02:25:13Z","updated_at":"2016-06-24T05:49:30Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-06-24T05:49:30Z","updated_at":"2016-06-24T05:59:02Z","closed_at":null,"body":"The current behavior of `timef()` dates back to at least commit 14c84ffb made in 2009-02-23 (I couldn't be bothered to trace it back farther than that). Returning NaN is silly. It is a can't happen, the computer is on fire, situation if `gettimeofday()` fails in that function. If that does happen `timef()` should kill the process.\r\n\r\nThis came to my attention when @floam made some changes to the *fish_key_reader.cpp* source. Note that there isn't a single place in the fish source code, other than @floam's recent change, that calls `isnan()`."},"comment":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/comments/228264488","html_url":"https://github.com/fish-shell/fish-shell/issues/3167#issuecomment-228264488","issue_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3167","id":228264488,"user":{"login":"floam","id":291142,"avatar_url":"https://avatars.githubusercontent.com/u/291142?v=3","gravatar_id":"","url":"https://api.github.com/users/floam","html_url":"https://github.com/floam","followers_url":"https://api.github.com/users/floam/followers","following_url":"https://api.github.com/users/floam/following{/other_user}","gists_url":"https://api.github.com/users/floam/gists{/gist_id}","starred_url":"https://api.github.com/users/floam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floam/subscriptions","organizations_url":"https://api.github.com/users/floam/orgs","repos_url":"https://api.github.com/users/floam/repos","events_url":"https://api.github.com/users/floam/events{/privacy}","received_events_url":"https://api.github.com/users/floam/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T05:59:02Z","updated_at":"2016-06-24T05:59:02Z","body":"I'll note here that [my checking](https://github.com/fish-shell/fish-shell/blob/0d6bdb38e62ec434cf9ee861e66428370c96bd5a/src/fish_key_reader.cpp#L121) for a NaN here isn't for the `timef()/gettimeofday() failure` - it's what I initialized the value to and check it after I've done some math involving that variable. It's nan() on the first loop through (or when gettimeofday() fails! Hate it when that happens!).\r\n\r\nnan was certainly used so there would not need to be checks in the code - it's \"safe\" to do math on and toss into a `printf()` - `timef()` is basically only used for debuggey output like `fish -p`. "}}
{"actor":{"display_login":"floam"}}