Byobu + tmux + OSX + specific circumstances = zombie tmux clients

Bug #1252073 reported by Ryan Thompson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Incomplete
Medium
Dustin Kirkland 

Bug Description

Short version: On OSX, if you use "byobu-launch" (including via "byobu-enable") and then close the console window without detaching, that window's client sticks around after the window itself is closed. This limits the maximum size of the tmux viewport to whatever size that window was when it was closed.

Longer version:

This is a bug that happens when Byobu is started in a certain way and then the console window containing it is closed without first detaching. The bug happens specifically when "byobu-launcher" is run without "exec" in a script that is sourced from the command line. The bug does not happen if the script contains "exec byobu-launcher", or if the script is executed instead of sourced, or if "byobu-launcher" is run directly from the command line. A simple way to meet the above conditions is by sourcing the following 2-line script:

#!/bin/sh
byobu-launcher

So, to reproduce this first make sure there is no existing byobu-instance, then source that script in a small console window, and then close that window without detaching the client. Then, open a new window and attach to the byobu tmux session again. Try to resize the session to a larger size, and observe that it will never exceed the size of the previous window that was closed. Run "tmux list-clients" and observe that there are two clients listed: the current one, and the zombie one from the closed window.

I also have access to an Ubuntu machine, which I will test this on shortly.

Revision history for this message
Ryan Thompson (rct86) wrote :

The following patch "fixes" the problem by changing the "byobu-launch" script to do "exec byobu-launcher", which prevents it from triggering the bug. Obviously this also breaks the functionality of the commented-out code.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi Ryan,

Thanks for the detailed report. Obviously I can't apply this patch as-is, since, as you say, it breaks the detach-but-don't-logout functionality (Shift-F6).

As for fixing the window size problem, there is a hotkey for that. When you're in the arbitrarily small window, try pressing Alt-F6.

Per the Shift-F1 help menu:
    Alt-F6 Detach all clients but yourself

This should actually kill the zombie client and fix your window size. This might be slightly inconvenient, but hopefully its enough of a workaround for you?

Changed in byobu:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Dustin Kirkland  (kirkland)
status: In Progress → Incomplete
Revision history for this message
Ryan Thompson (rct86) wrote :

I was hoping you might have some idea of what was going wrong. Perhaps the kill signal (SIGTERM?) is being blocked or swallowed somehow?

In any case, I've solved the problem for my self by applying my patch, since I don't need the detach-without-logout functionality for myself. Thanks for giving this your attention.

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 1252073] Re: Byobu + tmux + OSX + specific circumstances = zombie tmux clients

Hmm, is that the signal that's being sent? SIGTERM? It shouldn't be
blocked or swallowed...
:-Dustin

On Mon, Nov 18, 2013 at 1:09 PM, Ryan Thompson <email address hidden> wrote:
> I was hoping you might have some idea of what was going wrong. Perhaps
> the kill signal (SIGTERM?) is being blocked or swallowed somehow?
>
> In any case, I've solved the problem for my self by applying my patch,
> since I don't need the detach-without-logout functionality for myself.
> Thanks for giving this your attention.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1252073
>
> Title:
> Byobu + tmux + OSX + specific circumstances = zombie tmux clients
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/byobu/+bug/1252073/+subscriptions

Revision history for this message
Ryan Thompson (rct86) wrote :

I'm not sure, what signal it is. That's why I put a question mark. I
don't really know what's supposed to happen when you close a terminal
window.

On Tue 26 Nov 2013 02:17:11 PM PST, Dustin Kirkland  wrote:
> Hmm, is that the signal that's being sent? SIGTERM? It shouldn't be
> blocked or swallowed...
> :-Dustin
>
>
> On Mon, Nov 18, 2013 at 1:09 PM, Ryan Thompson <email address hidden> wrote:
>> I was hoping you might have some idea of what was going wrong. Perhaps
>> the kill signal (SIGTERM?) is being blocked or swallowed somehow?
>>
>> In any case, I've solved the problem for my self by applying my patch,
>> since I don't need the detach-without-logout functionality for myself.
>> Thanks for giving this your attention.
>>
>> --
>> You received this bug notification because you are a bug assignee.
>> https://bugs.launchpad.net/bugs/1252073
>>
>> Title:
>> Byobu + tmux + OSX + specific circumstances = zombie tmux clients
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/byobu/+bug/1252073/+subscriptions
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.