Opened 8 years ago
Closed 8 years ago
#52224 closed defect (fixed)
tmux @2.2 Fix regression on 2.2: avoid using kqueue/poll on OS X
Reported by: | lbschenkel (Leonardo Brondani Schenkel) | Owned by: | tessus (Helmut K. C. Tessarek) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.4 |
Keywords: | haspatch | Cc: | |
Port: | tmux |
Description
tmux avoids using libevent's kqueue or poll implementations on OS X because they are considered broken:
https://github.com/tmux/tmux/blob/2.2/osdep-darwin.c#L77
However, due to an oversight version 2.2 of tmux does not call the platform-specific initialization code when initializing tmux which means that kqueue and poll are not disabled as intended:
https://github.com/tmux/tmux/blob/2.2/tmux.c#L341
This was later found and fixed in upstream:
https://github.com/tmux/tmux/commit/7411f21c5f9dbc64d98538ad3df8d4b25e1988ba
Due to the bug above in conjunction with a bug in latest stable libevent (2.0.22), tmux prints the warning below on OS X 10.12 (Sierra):
[warn] kq_init: detected broken kqueue; not using.: File exists
Even though the warning coming from libevent due to a bug in its kqueue detection logic, tmux should not attempt to use kqueue nor poll in OS X because those implementations are broken in ways that affect tmux.
Attached to this ticket is a patch for a new release of tmux (2.2_1) that incorporates the patch from upstream.
Attachments (1)
Change History (6)
Changed 8 years ago by lbschenkel (Leonardo Brondani Schenkel)
Attachment: | tmux.patch added |
---|
comment:1 Changed 8 years ago by mf2k (Frank Schima)
Cc: | tessarek@… removed |
---|---|
Keywords: | haspatch added |
Owner: | changed from macports-tickets@… to tessarek@… |
comment:2 Changed 8 years ago by tessus (Helmut K. C. Tessarek)
I don't know, if we should add this patch. Otherwise, which patches for releases do we add? All of them? If yes, I'd rather update the tmux-devel subport.
There's a tmux-devel subport which we can update to git head.
Please let me know what you think.
comment:3 Changed 8 years ago by lbschenkel (Leonardo Brondani Schenkel)
The reason why I originally suggested incorporating this patch was because it's a regression introduced in 2.2 (neither older nor newer versions of tmux have the bug), the fix is trivial, and if applied it removed a warning message when tmux is run in macOS 10.12. The warning was really from libevent, and that port has been fixed after I opened this ticket, so at least one of the justifications for integrating this patch has disappeared.
Honestly if I were the maintainer I would still integrate this specific patch just to avoid the hard-to-diagnose glitches that you may encounter when events happen to be missed, but I have to concede that this just due to my own preference — I happen to prefer to run stable versions with a few backported patches here and there than running pre-release versions — and the bug was not considered important enough by upstream to justify a new patch release. I understand that you as the maintainer may be afraid of setting a precedent and wants to avoid having to make a value judgment for every future patch that is not yet incorporated into an official release. If you prefer not to add the patch, I certainly get your point and I won't object.
comment:4 Changed 8 years ago by lbschenkel (Leonardo Brondani Schenkel)
Now that port has been updated to 2.3 the fix is not necessary anymore. Please close this ticket.
comment:5 Changed 8 years ago by larryv (Lawrence Velázquez)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed by the 2.3 update in r153405.
new Portfile revision and patch for kqueue/poll