bug-ncurses
[Top][All Lists]
Advanced

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

Re: Infinite polling loop


From: Bryan Christ
Subject: Re: Infinite polling loop
Date: Tue, 28 Aug 2018 22:27:12 -0500

Thomas,

i finally circled back to this and found the culprit.  In 18.04 LTS, The env variable TERM is being set to xterm-256color and in my start-up routine, I assume certain things about color pairs and mappings.  If I clobber the TERM var and make it just xterm, everything works fine.  Is there a better way to force a traditional 16 color palette?

On Sun, Jun 3, 2018 at 6:22 PM Thomas Dickey <address@hidden> wrote:
On Sun, Jun 03, 2018 at 10:21:44AM -0500, Bryan Christ wrote:
> Thomas,
>
> I've tried setting the values ranging from 1 to 5000.  The poll() call
> still gets stuck in an infinite loop just with different timeout values.  I
> retested under Eterm with timeout() set to 15 so that I could see what was
> going on under the hood.  Unlike xfce4-terminal, with Eterm there are
> alternating poll() calls which tells me it's not stuck in a loop.
>
> poll([{fd=5, events=POLLIN}], 1, 1)     = 1 ([{fd=5, revents=POLLNVAL}])
> poll([{fd=0, events=POLLIN}], 1, 15)    = 0 (Timeout)

sure - the other poll is from viper_kmio_gpm

Actually, what I see on the screen is "Press [alt ~] for Main Menu",
but haven't seen in the code where that's interpreted (or which "alt-~"
keys I might press to get a menu).  I could figure this out by reading
the source-code, but some documentation would be helpful :-)

> On Sat, Jun 2, 2018 at 7:42 PM, Thomas Dickey <address@hidden> wrote:
>
> > On Sat, Jun 02, 2018 at 11:10:38AM -0500, Bryan Christ wrote:
> > > Thomas, the observation was on another application... VWM (which uses
> > > libvterm).  I also observed this problem does not happen with Eterm or
> > > xterm.
> >
> > The spinning is in libviper, where it attempts to read keys.
> > During libviper's initialization, it calls
> >
> >         nodelay(SCREEN_WINDOW, TRUE);
> >
> > which tells it to not wait if there's no data.  It then switches over
> > to the other protothread.
> >
> > Changing that to a very small timeout (1 millisecond) gets rid of the
> > problem:
> >
> >         wtimeout(SCREEN_WINDOW, 1);
> >
> > You wouldn't notice the problem on the Linux console, because
> > viper_kmio_fetch checks for data from GPM (which doesn't return
> > immediately).
> >
> > > On Sat, Jun 2, 2018, 9:00 AM Thomas Dickey <address@hidden> wrote:
> > >
> > > > On Fri, Jun 01, 2018 at 11:27:50PM -0500, Bryan Christ wrote:
> > > > > I recently encountered a bizarre problem with a polling loop on
> > Xubuntu
> > > > > 18.04.  When I run my application on a standard tty, it runs fine.
> > When I
> > > > > run it in xfce4-terminal the screen is completely blank.  When I
> > strace the
> > > > > application, it's running in an vigorous polling loop.  When I run
> > the
> > > > > application on 16.04 there are no problems at all on a standard tty
> > nor on
> > > > > xfce4-terminal.  On Xubuntu 18.04 ncurses = 6.1 (20180127).  I also
> > get the
> > > > > exact same behavior when I try to run in rxvt.
> > > >
> > > > hmm - I compiled
> > > >         https://github.com/TragicWarrior/libvterm
> > > >
> > > > using Ubuntu 18.04 and don't see a problem (xfce4-terminal 0.8.7.3).
> > > > The vshell program works, and top shows a low load factor.
> >
> > --
> > Thomas E. Dickey <address@hidden>
> > https://invisible-island.net
> > ftp://ftp.invisible-island.net
> >
>
>
>
> --
> Bryan
> <><

--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net


--
Bryan
<><

reply via email to

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