Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmux troubles with port_associate on pkgsrc illumos #988

Open
whorfin opened this issue May 8, 2021 · 5 comments
Open

tmux troubles with port_associate on pkgsrc illumos #988

whorfin opened this issue May 8, 2021 · 5 comments

Comments

@whorfin
Copy link

whorfin commented May 8, 2021

Greetings
And apologies if this is "the wrong place", I took the "please file it" request to heart, and the mailinglist link was broken.
Using

https://pkgsrc.joyent.com/packages/SmartOS/trunk/x86_64/All

on

$ uname -a
SunOS serverbox 5.11 omnios-r151030-5bd7739fe4 i86pc i386 i86pc illumos

and having installed tmux-3.2

I noticed that vim "fakeclip" package was badly misbehaving. And I tracked it down to a very simple repro case:

$ tmux load-buffer test.txt
[warn] port_associate: Not owner

I don't always get the port_associate message, but it's not just a warning - the tmux command hangs and must be manually killed. Sometimes it works fine.
Something is annoyingly, intermittently amiss.

tmux show-buffer is similarly affected, although I have found that this always works:

$ tmux show-buffer

while redirection sometimes triggers the port_associate hanging "warning"

$ tmux show-buffer >/tmp/busted
[warn] port_associate: Not owner
[warn] port_associate: Not owner

Cheers

@jclulow
Copy link
Contributor

jclulow commented May 8, 2021

That seems unusual. From the manual page for port_associate(3C):

       The port_associate() function will fail if:

       EACCES
                  The source argument is PORT_SOURCE_FILE and, Search permission
                  is denied on a component of path prefix or the file exists and
                  the permissions, corresponding to the events argument, are
                  denied.

...

Have you tried tracing the arguments to the port_associate() call to see what's being associated when it fails this way?

@whorfin
Copy link
Author

whorfin commented May 8, 2021

Here are the results of

$ truss -t port_associate tmux load-buffer test.txt >& log.txt

for a "it worked" and an "it hung with the message" case
(The SIGTERM is from me killing the hanging tmux)

00tmux-fail.txt
00tmux-ok.txt

@whorfin
Copy link
Author

whorfin commented May 8, 2021

...I pulled down and built from source various versions from upstream https://github.com/tmux/tmux/releases
tmux-3.2 behaves just as the joyent/pkgsrc version does
tmux-3.1c is similarly broken
tmux-3.0a appears to be OK
so you might want to downgrade the version provided; I will report upstream

@whorfin
Copy link
Author

whorfin commented May 8, 2021

Per the tmux upstream conversation, this appears to be a bug in libevent.
Setting EVENT_NOEVPORT=1 fixes tmux!
This might explain a secondary annoyance of bizarre lockup/hangs-until-timeouts when resizing the enclosing terminal over ssh
A random google hit which points to this being observed in opensolaris long ago would be:
https://forum.transmissionbt.com/viewtopic.php?t=6680&start=15

@pfmooney
Copy link
Contributor

pfmooney commented Oct 9, 2022

This has been diagnosed as illumos#15036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants