Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jul 2009 14:44:18 +0200 (CEST)
From:      Ulrich Spoerlein <uqs@spoerlein.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        krion@FreeBSD.org
Subject:   ports/136686: x11/xterm: endless loop when using xterm -hold
Message-ID:  <200907121244.n6CCiIGt025788@roadrunner.spoerlein.net>
Resent-Message-ID: <200907121250.n6CCo1Wf071084@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         136686
>Category:       ports
>Synopsis:       x11/xterm: endless loop when using xterm -hold
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 12 12:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Ulrich Spoerlein
>Release:        FreeBSD 7.2-STABLE i386
>Organization:
>Environment:
>Description:
Opera wants to run external applications using "xterm -hold" when they
should be run inside an xterm.

This is broken in 7.2 and 8.0 with several generations of Xorg and xterm.
>How-To-Repeat:
1. run xterm -hold -e ls
2. try to close the window, note the cpu usage
3. pkill -9 -f "xterm -hold"

ktraceing such a process shows the endless spinning on fd=3

 19711 xterm    CALL  poll(0x2860d8a0,0x1,0)
 19711 xterm    RET   poll 0
 19711 xterm    CALL  read(0x4,0x28af301c,0x1000)
 19711 xterm    GIO   fd 4 read 12 bytes
       "ktrace.out\r
       "
 19711 xterm    RET   read 12/0xc
 19711 xterm    PSIG  SIGCHLD caught handler=0x80687d0 mask=0x0 code=0x0
 19711 xterm    CALL  wait4(0xffffffff,0,<invalid>0,0)
 19711 xterm    RET   wait4 19714/0x4d02
 19711 xterm    CALL  wait4(0xffffffff,0,WNOHANG,0)
 19711 xterm    RET   wait4 -1 errno 10 No child processes
 19711 xterm    CALL  sigreturn(0xbfbfe7f0)
 19711 xterm    RET   sigreturn JUSTRETURN
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  poll(0xbfbfe874,0x1,0xffffffff)
 19711 xterm    RET   poll 1
 19711 xterm    CALL  writev(0x3,0xbfbfe960,0x3)
 19711 xterm    GIO   fd 3 wrote 36 bytes
       0x0000 4d0a 0900 1800 4006 1c00 4006 1100 0e00 006b 0074 0072 0061 0063 0065 002e 006f 0075 0074            |M.....@...@......k.t.r.a.c.e...o.u.t|

 19711 xterm    RET   writev 36/0x24
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  gettimeofday(0xbfbfea04,0)
 19711 xterm    RET   gettimeofday 0
 19711 xterm    CALL  poll(0x2860d8a0,0x1,0)
 19711 xterm    RET   poll 0
 19711 xterm    CALL  ioctl(0x3,FIONREAD,0xbfbfea14)
 19711 xterm    RET   ioctl 0
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  gettimeofday(0xbfbfea04,0)
 19711 xterm    RET   gettimeofday 0
 19711 xterm    CALL  poll(0x2860d8a0,0x1,0)
 19711 xterm    RET   poll 0
 19711 xterm    CALL  ioctl(0x3,FIONREAD,0xbfbfea14)
 19711 xterm    RET   ioctl 0
 19711 xterm    CALL  read(0x4,0x28af301c,0x1000)
 19711 xterm    GIO   fd 4 read 0 bytes
       ""
 19711 xterm    RET   read 0
 19711 xterm    CALL  poll(0xbfbfe9c4,0x1,0xffffffff)
 19711 xterm    RET   poll 1
 19711 xterm    CALL  writev(0x3,0xbfbfeab0,0x3)
 19711 xterm    GIO   fd 3 wrote 68 bytes
       0x0000 370a 0600 1e00 4006 1800 4006 0840 0000 ffff ff00 1300 4006 3763 0600 1f00 4006 1800 4006 0840 0000  |7.....@...@..@........@.7c....@...@..@..|
       0x0028 ffff ff00 1300 4006 4d01 0500 1800 4006 1f00 4006 1100 1d00 0020 0000                                |......@.M.....@...@...... ..|

 19711 xterm    RET   writev 68/0x44
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)


This is printing the ls(1) output (only ktrace.out in this case), then it loops doing this:

 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  gettimeofday(0xbfbfeb04,0)
 19711 xterm    RET   gettimeofday 0
 19711 xterm    CALL  poll(0x2860d8a0,0x1,0)
 19711 xterm    RET   poll 0
 19711 xterm    CALL  select(0x5,0x8096a20,0x80969a0,0,0x8096994)
 19711 xterm    RET   select 1
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  gettimeofday(0xbfbfeb04,0)
 19711 xterm    RET   gettimeofday 0
 19711 xterm    CALL  poll(0x2860d8a0,0x1,0)
 19711 xterm    RET   poll 0
 19711 xterm    CALL  read(0x4,0x28af301c,0x1000)
 19711 xterm    GIO   fd 4 read 0 bytes
       ""
 19711 xterm    RET   read 0
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable
 19711 xterm    CALL  read(0x3,0x28625018,0x1000)
 19711 xterm    RET   read -1 errno 35 Resource temporarily unavailable


The wait4() calls look suspicious to me, but that's just a hunch and they
are not present in the xterm sources anyway.

>Fix:

	


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907121244.n6CCiIGt025788>