*Synopsis*: ksh93's built-in "tail -f" cannot be interrupted if "suspended"
Due to a change requested by <User 1-5Q-9201>, <User 1-5Q-9201> is now the responsible engineer for: CR 6919591 changed on Mar 29 2010 by <User 1-5Q-9201> === Field ============ === New Value ============= === Old Value ============= Hook 5 <email address omitted> Hook 6 <email address omitted> Keyword oss-sponsor Keyword oss-request Responsible Engineer <User 1-5Q-9201> Status 3-Accepted 1-Dispatched Targeted Release solaris_nevada ====================== =========================== =========================== *Change Request ID*: 6919591 *Synopsis*: ksh93's built-in "tail -f" cannot be interrupted if "suspended" Product: solaris Category: shell Subcategory: korn93 Type: Defect Subtype: Status: 3-Accepted Substatus: Priority: 2-High Introduced In Release: Introduced In Build: Responsible Engineer: <User 1-5Q-9201> Keywords: 2010.02-reviewed, oss-request, oss-sponsor === *Description* ============================================================ On a system running snv_131 and the following version of ksh93 devildoll $ ksh93 -c 'print "${.sh.version}"' Version JMP 93t+ 2009-10-12 tail appears to be a ksh93 built-in. If I monitor a log file using "tail -f" and then suspend (using ^S) and resume the tail, it appears that I can no longer interrupt the process. devildoll $ tail -f /etc/motd Sun Microsystems Inc. SunOS 5.11 snv_131 January 2010 ^Z[1] + Stopped tail -f /dev/null devildoll $ fg tail -f /dev/null ^C Here's a pstack(1) of the process 6720: -ksh fffffd7fff2ecf7a nanosleep (fffffd7fffdfbe10, 0) fffffd7fff095382 b_tail () + b8a fffffd7fff172607 sh_exec () + 308f fffffd7fff16f0ef sh_eval () + 287 fffffd7fff102151 b_hist () + a49 fffffd7fff172607 sh_exec () + 308f fffffd7fff1494c6 exfile () + 786 fffffd7fff148caa sh_main () + 822 0000000000400e72 main () + 52 0000000000400ccc ???????? () And a truss(1) including sending the signal 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: Received signal #2, SIGINT, in nanosleep() [caught] 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) Err#4 EINTR 6720: lwp_sigmask(SIG_SETMASK, 0x00000002, 0x00000000) = 0xFFBFFEFF [0x0000FFFF] 6720: sigaction(SIGINT, 0xFFFFFD7FFFDFB6D0, 0xFFFFFD7FFFDFB750) = 0 6720: setcontext(0xFFFFFD7FFFDFB4A0) 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 6720: fstat(5, 0xFFFFFD7FFFDFBD90) = 0 6720: nanosleep(0xFFFFFD7FFFDFBE10, 0x00000000) = 0 *** (#1 of 2): 2010-01-24 23:45:26 GMT+00:00 <User 1-5Q-13979> Sorry, the ^S above should have been ^Z - namely it really is the job control suspend character. *** (#2 of 2): 2010-02-07 04:01:31 GMT+00:00 <User 1-5Q-13979> === *Public Comments* ======================================================== Glenn Fowler (AT&T Research AST developer) said this about this bug: > the report confuses ^S and ^Z > the intention is probably ^Z > I don't see the problem on sol11.i386 Version JMP 93t+ 2010-01-20 Roland Mainz (OpenSolaris ksh93-integration project lead) says: > I can"t reproduce the bug either. Is it possible that the reporter > mixed ^S/^Q (terminal output stop/resume functionality) with > ^Z (shell command to put the current job into the background) > ? *** (#1 of 2): 2010-02-04 23:30:49 GMT+00:00 <User 1-5Q-1267> Not sure if the question is being posed to me but the issue is definitely with ^Z using the ksh93 in snv_132. *** (#2 of 2): 2010-02-07 04:01:31 GMT+00:00 <User 1-5Q-13979> === *Workaround* ============================================================= Use /usr/bin/tail instead. *** (#1 of 1): 2010-01-25 07:57:28 GMT+00:00 <User 1-5Q-13979> === *Additional Details* ===================================================== Targeted Release: solaris_nevada Commit To Fix In Build: Fixed In Build: Integrated In Build: Verified In Build: See Also: Duplicate of: Hooks: Hook1: Hook2: Hook3: Hook4: Hook5: <email address omitted> Hook6: <email address omitted> Program Management: Root Cause: Fix Affects Documentation: No Fix Affects Localization: No === *History* ================================================================ Date Submitted: 2010-01-24 23:45:26 GMT+00:00 Submitted By: <User 1-5Q-13979> Status Changed Date Updated Updated By 3-Accepted 2010-03-29 02:44:29 GMT+00:00 <User 1-5Q-9201> === *Service Request* ======================================================== Impact: Significant Functionality: Primary Severity: 2 Product Name: solaris Product Release: solaris_nevada Product Build: snv_131 Operating System: 5.11 Hardware: generic Submitted Date: 2010-01-24 23:45:26 GMT+00:00 === *Multiple Release (MR) Cluster* - 0 ======================================