[DragonFlyBSD - Bug #3255] (Resolved) atime on pty devices increments faster than system time, even if idle

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Mon Jan 11 22:56:23 PST 2021


Issue #3255 has been updated by dillon.

Status changed from New to Resolved
Assignee set to dillon

Fixed.  The devfs code uses a quick shortcut to avoid having to obtain VFS timestamps on every read() and write() to a device.  This shortcut code had reversed a calculation, causing the times to appear to increment on their own with no activity.

----------------------------------------
Bug #3255: atime on pty devices increments faster than system time, even if idle
http://bugs.dragonflybsd.org/issues/3255#change-13950

* Author: dancrossnyc
* Status: Resolved
* Priority: Normal
* Assignee: dillon
* Category: Kernel
* Target version: Latest stable
----------------------------------------
The 'atime' on a PTY device seems to increment monotonically at a rate faster than than the system clock if the device is idle.

I noticed this because the output of commands that show idle time (w, finger, etc) always shows the associated login as active, even when it isn't.

For example, if I am logged in on pts/0 _and_ pts/1, and deliberately leave pts/1 idle for some time, then run `date; stat /dev/pts/1; date` I observe the following output:

Sun Jan 10 20:36:31 UTC 2021
1114963967 1435 crw--w---- 1 cross tty 8449 0 "Jan 10 20:59:23 2021" "Jan 10 20:13:39 2021" "Jan 10 13:55:47 2021" 4096 0 0 /dev/pts/1
Sun Jan 10 20:36:31 UTC 2021

Curiously, using the device resets `atime`. Here, I switch to pts/1 and run something (e.g., 'echo foo' or 'ls') and probe again:

Sun Jan 10 20:37:57 UTC 2021
1114963967 1435 crw--w---- 1 cross tty 8449 0 "Jan 10 20:38:00 2021" "Jan 10 20:37:54 2021" "Jan 10 13:55:47 2021" 4096 0 0 /dev/pts/1
Sun Jan 10 20:37:57 UTC 2021

(the one second lag is due to me switching windows and recalling the command, but the atime was reset to the time I ran some command.)

uname output:

DragonFly my.host.org 5.8-RELEASE DragonFly v5.8.3-RELEASE #10: Thu Sep 24 19:19:45 EDT 2020     root at www.shiningsilence.com:/usr/obj/home/justin/release/5_8/sys/X86_64_GENERIC  x86_64

I've tried this with several shells and mechanisms for logging in: the behavior seems invariant regardless of using e.g., ash, bash, zsh, sshd or even the venerable telnetd.



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list