NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/56713 - tail -f doesn't follow (fwd)
The following reply was made to PR kern/56713; it has been noted by GNATS.
From: Paul Goyette <paul%whooppee.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/56713 - tail -f doesn't follow (fwd)
Date: Sun, 6 Mar 2022 09:46:46 -0800 (PST)
Logging to PR
---------- Forwarded message ----------
Date: Sun, 6 Mar 2022 09:44:19 -0800 (PST)
From: Paul Goyette <paul%whooppee.com@localhost>
To: thorpej%netbsd.org@localhost
Cc: martin%netbsd.org@localhost
Subject: Re: kern/56713 - tail -f doesn't follow
I still cannot get my test program to fail, but I have looked a bit
closer into what's going on.
I modified tail's forward.c to do a few printf()s before calls to
kevent(). I'm using a pkg_build for gnucash to generate the target
log file, but anything can substitute.
xtail on log file provides the last 10 lines of the file. The following (11th)
line would start with "===> Skipping vulnerability checks."
...
=> Full dependency swig3>=3.0.12: found swig3-3.0.12nb4
=> Full dependency hicolor-icon-theme>=0.9nb1: found hicolor-icon-theme-0.17nb1
=> Full dependency gdk-pixbuf2>=2.42.6: found gdk-pixbuf2-2.42.6nb1
=> Full dependency guile22>=2.2.7nb3: found guile22-2.2.7nb4
=> Full dependency desktop-file-utils>=0.10nb1: found
desktop-file-utils-0.26nb1
=> Full dependency icu>=70.1: found icu-70.1
=> Full dependency libxml2>=2.9.12nb1: found libxml2-2.9.12nb2
=> Full dependency libxslt>=1.1.34nb6: found libxslt-1.1.34nb7
=> Full dependency webkit-gtk>=2.34.2: found webkit-gtk-2.34.6
=> Full dependency gtk3+>=3.24.30nb1: found gtk3+-3.24.31
At this point, xtail's ktrace shows one of my test printf's,
followed by the set-watchlist kevent call, followed by an attempt
to read any new data that might exist (there is none), followed
by the kevent() call to wait-for-event. The latter shows that
it never returns, until I press ^C
...
20519 20519 xtail 1646584937.737532152 CALL write(1,0x764d4e699000,0x23)
20519 20519 xtail 1646584937.737534380 GIO fd 1 wrote 35 bytes
"forward: ADD_EVENTS: kevent( n=1 )\n"
20519 20519 xtail 1646584937.737534576 RET write 35/0x23
20519 20519 xtail 1646584937.737535715 CALL
__kevent50(4,0x7f7fff1f5ab0,1,0,0,0)
20519 20519 xtail 1646584937.737537464 RET __kevent50 0
20519 20519 xtail 1646584937.737537905 CALL read(3,0x764d4e69a040,0x8000)
20519 20519 xtail 1646584937.737538452 GIO fd 3 read 0 bytes
""
20519 20519 xtail 1646584937.737538685 RET read 0
20519 20519 xtail 1646584937.737539221 CALL
__kevent50(4,0,0,0x7f7fff1f5ab0,1,0)
20519 20519 xtail 1646585057.253611154 RET __kevent50 -1 errno 4
Interrupted system call
Note that the call to kevent() to establish the event watch-list is at
timestamp 37.737535715, and the never-ending wait starts at timestamp
37.737539221
From the ktrace of the process writing to the log file we see the
point where it writes the next line:
29343 29343 sh 1646584941.086235727 CALL write(1,0x74bbbc55b000,0x24)
29343 29343 sh 1646584941.086240495 GIO fd 1 wrote 36 bytes
"===> Skipping vulnerability checks.\n"
29343 29343 sh 1646584941.086240792 RET write 36/0x24
The write to the log file for the "===> Skipping ..." text occurred
at 41.086240495 which is after the kevent() starts waiting, so it
should have triggered the kevent.
I tried to update my test program to add the read-new-data but it
still doesn't fail. :(
I'm quickly reaching my limit of understanding here...
+--------------------+--------------------------+----------------------+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette%netbsd.org@localhost |
| & Network Engineer | | pgoyette99%gmail.com@localhost |
+--------------------+--------------------------+----------------------+
Home |
Main Index |
Thread Index |
Old Index