bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

checkwinsize doesn't work on Solaris due to missing #include for TIOCGWI


From: Dan Price
Subject: checkwinsize doesn't work on Solaris due to missing #include for TIOCGWINSZ
Date: Tue, 24 Mar 2009 10:15:51 -0700
User-agent: Mutt/1.5.14 (2007-02-12)

[resubmitting, this doesn't seem to have gotten to bug-bash on my first
try a few weeks ago]

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: solaris2.11
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
+-DCONF_OSTYPE='solaris2.11' -DCONF_MACHTYPE='i386-pc-solaris2.11'
+-DCONF_VENDOR='pc' -DLOCALEDIR='/tmp/share/locale' -DPACKAGE='bash' -DSHELL
+-DHAVE_CONFIG_H -DSOLARIS   -I.  -I. -I./include -I./lib   -g -O2
uname output: SunOS xanadu 5.11 snv_108 i86pc i386 i86pc
Machine Type: i386-pc-solaris2.11
Bash Version: 3.2
Patch Level: 48
Release Status: release

Description:

On Solaris/OpenSolaris platforms, I have discovered what I believe is a
bug in lib/sh/winsize.c.

I discovered with a debugger that the get_new_window_size() function
has no effect on Solaris.  In fact, here is what this file looks like if
you compile it:

$ dis winsize.o
disassembly for winsize.o
section .text
get_new_window_size()
    get_new_window_size:     c3                 ret

That's it-- an empty function.  The problem is that the appropriate header
file is not getting pulled in, in order to #define TIOCGWINSZ.

As a result, even with 'shopt -s checkwinsize' set on Solaris, bash
does not check the win size on suspend of a program, or on program
exit.  This is massively frustrating, and I know of several Solaris
users who have switched to zsh as a result of this bug.

I have not tried bash 4.0, but looking at the source code, it appears
that the bug is present there as well.

Repeat-By:

Fix:

I added an ifdef clause which looks to see if the HAVE_TERMIOS_H define
is set, after the #include of config.h.  If it is, then I #include the
termios.h header file.  This solves the problem, which I confirmed by
rebuilding and dis'ing the function.  I also ran my recompiled bash
and confirmed that it now worked correctly.

Thanks, I appreciate your time.  I hope that I have adequately described
the problem; feel free to mail me if not.

Thanks

        -dp

-- 
Daniel Price, Solaris Kernel Engineering    http://blogs.sun.com/dp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]