{"action":"created","issue":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3149","repository_url":"https://api.github.com/repos/fish-shell/fish-shell","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3149/labels{/name}","comments_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3149/comments","events_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3149/events","html_url":"https://github.com/fish-shell/fish-shell/issues/3149","id":160583550,"number":3149,"title":"remove code that uses `posix_spawn()`","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},"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":371,"closed_issues":0,"state":"open","created_at":"2012-06-11T02:25:13Z","updated_at":"2016-06-16T05:58:36Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-06-16T05:58:35Z","updated_at":"2016-06-16T06:09:20Z","closed_at":null,"body":"Working on the fix for issue #2980 caused me to notice the use of `posix_spawn()`. However, those uses are protected by symbol `FISH_USE_POSIX_SPAWN` which is never set AFAICT. That code was added four years ago (see issue #11). I want to remove that code because a) it isn't being used, and b) isn't compatible with my fix for issue #2980. The presence of `posix_spawn()` in the code probably explains why fish does things like call `tcsetpgrp()` in both the parent and child process and suppresses error messages in the parent process. Ugh!\r\n\r\nA fish shell should never be so large that the cost of `fork()` is unreasonable (most of the cost is due to copying the MMU page tables or equivalent which scales with the size of the process). So the optimization provided by `posix_spawn()` should never be a factor for fish. Also, a bit of googling suggests that many implementations are nothing more than fork/exec wrappers in user space rather than a more efficient kernel implementation.\r\n\r\n@ridiculousfish Any objection to removing the `posix_spawn()` code?"},"comment":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/comments/226396381","html_url":"https://github.com/fish-shell/fish-shell/issues/3149#issuecomment-226396381","issue_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/3149","id":226396381,"user":{"login":"zanchey","id":520741,"avatar_url":"https://avatars.githubusercontent.com/u/520741?v=3","gravatar_id":"","url":"https://api.github.com/users/zanchey","html_url":"https://github.com/zanchey","followers_url":"https://api.github.com/users/zanchey/followers","following_url":"https://api.github.com/users/zanchey/following{/other_user}","gists_url":"https://api.github.com/users/zanchey/gists{/gist_id}","starred_url":"https://api.github.com/users/zanchey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanchey/subscriptions","organizations_url":"https://api.github.com/users/zanchey/orgs","repos_url":"https://api.github.com/users/zanchey/repos","events_url":"https://api.github.com/users/zanchey/events{/privacy}","received_events_url":"https://api.github.com/users/zanchey/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T06:09:20Z","updated_at":"2016-06-16T06:09:20Z","body":"`FISH_USE_POSIX_SPAWN` is defined to the value of `HAVE_SPAWN_H` by `postfork.h`. It certainly seems to get used on my system (`ltrace -e posix_spawn fish`)."}}
{"actor":{"display_login":"zanchey"}}