Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 604798 - >=sys-apps/sed-4.3 fails src_test in testsuite/panic-tests.sh
Summary: >=sys-apps/sed-4.3 fails src_test in testsuite/panic-tests.sh
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://debbugs.gnu.org/cgi/bugreport...
Whiteboard:
Keywords: PATCH, TESTFAILURE
Depends on:
Blocks:
 
Reported: 2017-01-06 03:07 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2018-10-26 09:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (build.log.xz,27.23 KB, application/x-xz)
2017-01-06 07:19 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details
cave info =sys-apps/sed-4.3 | ansifilter (caveinfo,16.86 KB, text/plain)
2017-01-06 07:20 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details
sed-4.3-test-pty-readable.patch (sed-4.3-test-pty-readable.patch,872 bytes, patch)
2017-01-08 01:51 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-01-06 03:07:20 UTC
============================================================================
Testsuite summary for GNU sed 4.3
============================================================================
# TOTAL: 107
# PASS:  97
# SKIP:  5
# XFAIL: 4
# FAIL:  1
# XPASS: 0
# ERROR: 0


FAIL: testsuite/panic-tests.sh

---



FAIL: testsuite/panic-tests
===========================

--- exp-err-tty 2017-01-06 15:42:36.073141748 +1300
+++ err-tty     2017-01-06 15:42:36.086141949 +1300
@@ -1 +1 @@
-sed: couldn't edit X: is a terminal
+sed: can't read /dev/pts/3: Permission denied
FAIL testsuite/panic-tests.sh (exit status: 1)
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2017-01-06 06:25:47 UTC
The test suite didn't fail when I committed sed-4.3 so pelase give us the usual information like emerge --info and build.log file.
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-01-06 07:19:20 UTC
Created attachment 458880 [details]
build.log.xz

I'm guessing its partly due to running under paludis, which I think implies different environment constraints.

My hope is we can nail this problem as being environmentally sensitive enough to false-fail and then simply block that test out.
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-01-06 07:20:46 UTC
Created attachment 458882 [details]
cave info =sys-apps/sed-4.3 | ansifilter
Comment 4 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-01-06 08:04:39 UTC
Looking into it seems to suggest package manager difference is significant here.

Portage basically hides the problem because portage creates a new tty, which tty naturally returns the ID of, and naturally has both read and write access to.

Paludis does not create its own tty and instead inherits the tty of the calling user, which in this case is root

crw--w----  1 root tty  136,  3 Jan  6 21:00 3

The user paludis runs as *is* a member of the tty group, however, that doesn't help, as that only has -w access, not -r 

It is suggested that perhaps this test should create a tty that it knows to be in control of before executing this test, instead of relying on the environment to be specifically tailored for the test in advance.
Comment 5 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-01-08 01:51:33 UTC
Created attachment 459122 [details, diff]
sed-4.3-test-pty-readable.patch
Comment 6 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-01-08 01:55:49 UTC
Attached patch works around the bug by extending the existing guards that check for tty writeability, by also checking for tty readability.

As sed can't report "is a tty" without first being able to read the device, unreadable devices can't yeild the "is a tty" error, only EACCESS.

This patch allows this test to continue to operate under portage or any other environment where the tty is +rw, but automatically skips that test if the tty is not +r or +w
Comment 7 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-02-11 12:09:31 UTC
Serious question: How do I report this upstream?

This page is utterly useless for finding a bug tracker: http://sed.sourceforge.net/

Issue still prevalent in 4.4 and the fix is trivial.
Comment 8 SpanKY gentoo-dev 2017-02-11 19:16:32 UTC
(In reply to Kent Fredric (IRC: kent\n) from comment #4)

if paludis doesn't create a new tty, sounds like it's subject to injection attacks via ioctl(TIOCSTI)

(In reply to Kent Fredric (IRC: kent\n) from comment #5)

patch looks fine if you want to add it to the tree.  just make sure to include links to this bug & upstream mailing list.

(In reply to Kent Fredric (IRC: kent\n) from comment #7)

https://lists.gnu.org/mailman/listinfo/bug-sed

although it looks like you've already found it
Comment 9 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-03-22 03:32:54 UTC
Expected fixed in next release:

https://git.savannah.gnu.org/cgit/sed.git/commit/?id=b092d4a6c07b25f743d302b05c308325edcfc599