[Bug 18749] New: built-in pexpect.py produces ioctl sign-extension warnings on FreeBSD

Bug ID 18749
Summary built-in pexpect.py produces ioctl sign-extension warnings on FreeBSD
Product lldb
Version unspecified
Hardware PC
OS FreeBSD
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter emaste@freebsd.org
Classification Unclassified

LLDB includes a copy of pexpect, in test/pexpect-2.4/pexpect.py

It includes a hack to work around some buggy platforms:

        # Check for buggy platforms. Some Python versions on some platforms     
        # (notably OSF1 Alpha and RedHat 7.1) truncate the value for            
        # termios.TIOCSWINSZ. It is not clear why this happens.                 
        # These platforms don't seem to handle the signed int very well;        
        # yet other platforms like OpenBSD have a large negative value for      
        # TIOCSWINSZ and they don't have a truncate problem.                    
        # Newer versions of Linux have totally different values for TIOCSWINSZ. 
        # Note that this fix is a hack.                                         
        TIOCSWINSZ = getattr(termios, 'TIOCSWINSZ', -2146929561)               
        if TIOCSWINSZ == 2148037735L: # L is not required in Python >= 2.2.    
            TIOCSWINSZ = -2146929561 # Same bits, but with sign.               

-2146929561 == 0xffffffff80087467.  Passing this sign-extended value, instead
of the desired 0x80087467, produces a warning message in the system console on
FreeBSD:

Feb  5 17:19:11 feynman kernel: WARNING pid 11323 (python2.7): ioctl
sign-extension ioctl ffffffff80087467

emaste@freebsd.org changed bug 18749

What | Removed | Added |

  • | - | - |
    Status | NEW | RESOLVED |
    Resolution | — | FIXED |
    Assignee | lldb-dev@cs.uiuc.edu | emaste@freebsd.org |

Comment # 2 on bug 18749 from emaste@freebsd.org

Fixed in r201603