Bug 101180 - Programs using inb in a gnome-terminal have extra carriage returns
Programs using inb in a gnome-terminal have extra carriage returns
Product: Red Hat Linux
Classification: Retired
Component: vte (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ray Strode [halfline]
Depends On:
  Show dependency treegraph
Reported: 2003-07-29 16:28 EDT by W.Tucker
Modified: 2007-04-18 12:56 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-10 17:38:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description W.Tucker 2003-07-29 16:28:07 EDT
Description of problem:
When using RedHat 8.0 with GNOME, programs that use inb to read from
an IO port appear to create spurious carriage returns when they are
run inside a gnome-terminal.

I first noticed the trouble when running programs using a data
acquisition device driver I wrote, but I was able to reproduce the
same effect with just a small foo.c program that is compiled with gcc
and run as root so the ioperm call will work.

It appears that calling inb somehow generates extra carriage returns
which are output to the gnome-terminal and then interpreted as user
input.  In this case, the input was processed at the command line, but
if foo had been waiting for user input (eg press return to continue)
it would have processed the extra CRs.  When foo is run from a
standard Ctrl+Alt+F1 console, no extra CRs appear.

Both foo.c and the gnome-terminal output it produces are included

Thanks for your help with this,  W.Tucker PostNorder(at)aol.com

Version-Release number of selected component (if applicable): 2.0.1

How reproducible: Very, although the number of carriage returns varies.

Steps to Reproduce:
1. Compile and run as root the following foo.c that calls inb

--------------- Start foo.c ----------------------
#include <stdio.h>
#include <asm/io.h>   // for inb

int main( void ) {

        long usec;
        unsigned char value;

        ioperm( 0x378, 5, 1 );

        printf( "Testing ...\n" );

        usec = 300000;
        while( usec-- )
                value = inb( 0x379 );

        printf( "Finished\n" );

        return( 0 ); 
--------------- End foo.c ----------------------

Actual results:
--------------- Start actual output from foo ----------------------
Testing ...

[root@Linux foo]# 
[root@Linux foo]# 
[root@Linux foo]# 
[root@Linux foo]# 
[root@Linux foo]# 
[root@Linux foo]# 
[root@Linux foo]# 
[root@Linux foo]# 
--------------- End actual output from foo ----------------------

Expected results:
--------------- Expected output from foo ----------------------
Testing ...
[root@Linux foo]# 
--------------- End expected output from foo ----------------------

Additional info:
Comment 1 Ray Strode [halfline] 2004-11-10 17:38:10 EST
I can't reproduce this problem with vte-0.11.11-13.  I'm going to assume it has
been fixed, but if you continue to have issues, feel free to reopen.

Note You need to log in before you can comment on or make changes to this bug.