On CURRENT r309302 with debuggin on I'm getting assertions like here: https://lists.freebsd.org/pipermail/freebsd-current/2011-May/024573.html They seem to happen randomly on key presses. Is the second "MPASS(tib != NULL);" needed? Is it possible that "tib->tib_next" is NULL on the last loop iteration (i.e. offset gets incremented to ti->ti_end)? The first MPASS should be enough.
(In reply to Jan Kokemüller from comment #0) 5.5 years later, this is exactly right. The assertion is legitimately false if we are at the very end of the buffer.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d769609620931a62ebacbd4f1f5fd048c7e3d7c0 commit d769609620931a62ebacbd4f1f5fd048c7e3d7c0 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-04-12 21:30:04 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-04-12 21:30:04 +0000 tty: Remove an incorrect assertion from ttyinq_line_iterate() We may legitimately have tib == NULL if we're at the very end of the queue. PR: 215373 Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation sys/kern/tty_inq.c | 1 - 1 file changed, 1 deletion(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=60c952d4724974b877b2ec02784e22b74dab8809 commit 60c952d4724974b877b2ec02784e22b74dab8809 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-04-12 21:30:04 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-04-18 16:19:57 +0000 tty: Remove an incorrect assertion from ttyinq_line_iterate() We may legitimately have tib == NULL if we're at the very end of the queue. PR: 215373 Reported by: pho Sponsored by: The FreeBSD Foundation (cherry picked from commit d769609620931a62ebacbd4f1f5fd048c7e3d7c0) sys/kern/tty_inq.c | 1 - 1 file changed, 1 deletion(-)