From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.yoctoproject.org (mail.yoctoproject.org [198.145.29.25]) by mx.groups.io with SMTP id smtpd.web10.11886.1613755501889600611 for ; Fri, 19 Feb 2021 09:25:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=A8QLAAIh; spf=softfail (domain: linaro.org, ip: 198.145.29.25, mailfrom: anibal.limon@linaro.org) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mail.yoctoproject.org (Postfix) with ESMTPS id 23F0F38C06E6 for ; Fri, 19 Feb 2021 17:25:01 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id h98so4766775wrh.11 for ; Fri, 19 Feb 2021 09:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cRLf9kgC6YX4I8YU+7vN09/A5Kti1u6OreWljB83l80=; b=A8QLAAIh1ioOyPtei9NtHALLWm2Rdt9QphRQcuGb8qbYWhwf5RKw9HlwPTyRvhZ1AS iqSyBgIWuygsKEeu09jhFLygTb62SBlvOn3Lz2V9sTvY1vDT/lguU1NWpDii6GfbSO+G lGGyAwI/c/HXyMYcK4JD+HPp3+boaEQVYgIqMxnrfzBo79y1ZqKxicSO47XOE7wDDo+H qGDZcwX8ZTescycC0iSuNSfCyP1sD1mdwwQLQf8S6bf0wLGj1+qmaiWgjcVg5n6f9ntM 3aWKqZRnt6Ri+HHJ+S1Gyc9FwYdT7iCizFYKbxI6CkTrqRl8admb7iSzDwjuvy1Lo53h tZng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cRLf9kgC6YX4I8YU+7vN09/A5Kti1u6OreWljB83l80=; b=Qecx++Wiiqxj43xzOA565nndb91duq07mhLWyfByQig5DzW3fwTc0u9XNrh7s1emFK EDoy6ujbEti9d8fGO9y/RYqE5N5hOOn5awWdPJk7J0cMcMPXLS1/f/KVEk7gF1X+CGYC +tD5QUsbG50I81d8ahiyI+6YExdzA8sJrpHvEcGuWq5/kpVVWlZEF/iLt3d3LEtHC6ku wetGftYpkWl08Ml44bCjVfcCIVNlhVnfJBaVX6f1kKiNlWxJAR1fFxaO1MGmDk6Cstvf k7wke6LFlhrWXIvUE4h/tZNoERsmFBhZrsbIEhZT/MdPYeoQ1wFampS5NNyUqMt8Ztf7 eOZw== X-Gm-Message-State: AOAM532FOsVlRwPEmRpiJK4KoEuiC0UzW8saOMQyq0ipizwDEjSxP2iE vs8Y1sAwSK7mSj8xEtmFH6z7NvWBigb0X860SbvmRg== X-Google-Smtp-Source: ABdhPJwyiTZ5Crty3dIl2dzx22PNXo/8EXEm085NKU4/KXIovp6wN6f6nZMl1/j6q2pvPVtly9rszB4XzrNxOUl1VGE= X-Received: by 2002:a5d:4903:: with SMTP id x3mr10042858wrq.95.1613755499435; Fri, 19 Feb 2021 09:24:59 -0800 (PST) MIME-Version: 1.0 References: <20200710054432.557157-1-tero.kinnunen@vaisala.com> In-Reply-To: From: "Anibal Limon" Date: Fri, 19 Feb 2021 11:24:47 -0600 Message-ID: Subject: Re: [yocto] [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty To: Randy MacLeod Cc: Chen Qi , Tero Kinnunen , Yocto discussion list , Michael Halstead , Richard Purdie , Trevor Gamblin , Konrad Scherer Content-Type: multipart/alternative; boundary="0000000000004c6b2b05bbb3bb58" --0000000000004c6b2b05bbb3bb58 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 19 Feb 2021 at 09:18, Randy MacLeod wrote: > On 2021-02-19 1:44 a.m., Chen Qi wrote: > > Hi Anibal, > > > > The ptest-runner repo seems to be messed up. > > This patch is no longer there, yet the SRCREV in ptest-runner recipe > > refers to this commit. > > > > $ git show 834670317bd3f6e427e1ac461c07ada6b8936dfd > > fatal: bad object 834670317bd3f6e427e1ac461c07ada6b8936dfd > > > > Regards, > > Chen Qi > > This was making our automated builds fail but I've added > the fall-back tarball and that should suffice for now. > > We should probably do something to prevent that but > could someone take a look soon and perhaps restore the repo > from another location? > > My local clone has: > $ git log --oneline -3 > 8346703 (HEAD -> master) Fix inappropriate ioctl when detaching tty > 1e9a845 (tag: v2.4) > Add support to specify multiple folder for ptest-runner > 287ba30 Makefile: Fix TEST_LDFLAGS gcc cmdline position > > > fyi: > > $ cd .../ptest-runner2.git > $ git pull > remote: Enumerating objects: 7, done. > remote: Counting objects: 100% (7/7), done. > remote: Compressing objects: 100% (4/4), done. > remote: Total 4 (delta 3), reused 0 (delta 0) > Unpacking objects: 100% (4/4), 526 bytes | 65.00 KiB/s, done. > From git://git.yoctoproject.org/ptest-runner2 > + 8346703...87f6a6e master -> origin/master (forced update) > fatal: Not possible to fast-forward, aborting. > > $ cd .../oe-core.git > $ git status > $ cd ../build > $ . ../oe-core.git/oe-init-build-env foo > $ bitbake -c fetch ptest-runner > ... > WARNING: ptest-runner-2.4.0+gitAUTOINC+834670317b-r0 do_fetch: Failed to > fetch URL git://git.yoctoproject.org/ptest-runner2, attempting MIRRORS > if available > > but the fetch works since it falls back to the downloads tarball: > Hi Randy, I pushed the rev, my mistake, sorry for the trouble. Regards, Anibal > > > --2021-02-19 14:36:24-- > > http://downloads.yoctoproject.org/mirror/sources/git2_git.yoctoproject.o= rg.ptest-runner2.tar.gz > Resolving downloads.yoctoproject.org (downloads.yoctoproject.org)... > 198.145.29.63 > Connecting to downloads.yoctoproject.org > (downloads.yoctoproject.org)|198.145.29.63|:80... connected. > HTTP request sent, awaiting response... 200 OK > Length: 185994 (182K) [application/octet-stream] > Saving to: > =E2=80=98/ala-lpggp31/rmacleod/src/distro/yocto/b/foo/downloads/ > git2_git.yoctoproject.org.ptest-runner2.tar.gz=E2=80=99 > > ../Randy > > > > On 07/14/2020 03:29 AM, Anibal Limon wrote: > >> Applied, Thanks!. > >> > >> Anibal > >> > >> On Fri, 10 Jul 2020 at 00:44, Tero Kinnunen >> > wrote: > >> > >> Fixes error > >> > >> ERROR: Unable to detach from controlling tty, Inappropriate > >> ioctl for device > >> > >> when running multiple ptests > >> > >> ptest-runner a b > >> > >> or when invoked over ssh single command, like > >> > >> $ ssh localhost ptest-runner > >> > >> For ssh case, fd 0 is not a tty. (isatty(0) is false). > >> When running multiple ptests, deattach for parent needs to be > >> done only once. > >> > >> Signed-off-by: Tero Kinnunen >> > > >> --- > >> utils.c | 6 +++--- > >> 1 file changed, 3 insertions(+), 3 deletions(-) > >> > >> diff --git a/utils.c b/utils.c > >> index a8ba190..a4e190e 100644 > >> --- a/utils.c > >> +++ b/utils.c > >> @@ -437,6 +437,9 @@ run_ptests(struct ptest_list *head, const > >> struct ptest_options opts, > >> break; > >> } > >> fprintf(fp, "START: %s\n", progname); > >> + if (isatty(0) && ioctl(0, TIOCNOTTY) =3D=3D -1) { > >> + fprintf(fp, "ERROR: Unable to detach from > >> controlling tty, %s\n", strerror(errno)); > >> + } > >> PTEST_LIST_ITERATE_START(head, p) > >> char *ptest_dir =3D strdup(p->run_ptest); > >> if (ptest_dir =3D=3D NULL) { > >> @@ -444,9 +447,6 @@ run_ptests(struct ptest_list *head, const > >> struct ptest_options opts, > >> break; > >> } > >> dirname(ptest_dir); > >> - if (ioctl(0, TIOCNOTTY) =3D=3D -1) { > >> - fprintf(fp, "ERROR: Unable to > >> detach from controlling tty, %s\n", strerror(errno)); > >> - } > >> > >> if ((pgid =3D getpgid(0)) =3D=3D -1) { > >> fprintf(fp, "ERROR: getpgid() > >> failed, %s\n", strerror(errno)); > >> -- > >> 2.25.1 > >> > >> > >> > > > > > > > >=20 > > > > > -- > # Randy MacLeod > # Wind River Linux > --0000000000004c6b2b05bbb3bb58 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, 19 Feb 2021 at 09:18, Randy M= acLeod <randy.macleod@win= driver.com> wrote:
On 2021-02-19 1:44 a.m., Chen Qi wrote:
> Hi Anibal,
>
> The ptest-runner repo seems to be messed up.
> This patch is no longer there, yet the SRCREV in ptest-runner recipe =
> refers to this commit.
>
> $ git show 834670317bd3f6e427e1ac461c07ada6b8936dfd
> fatal: bad object 834670317bd3f6e427e1ac461c07ada6b8936dfd
>
> Regards,
> Chen Qi

This was making our automated builds fail but I've added
the fall-back tarball and that should suffice for now.

We should probably do something to prevent that but
could someone take a look soon and perhaps restore the repo
from another location?

My local clone has:
$ git log --oneline -3
8346703 (HEAD -> master) Fix inappropriate ioctl when detaching tty
1e9a845 (tag: v2.4)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Add support to specify multiple = folder for ptest-runner
287ba30 Makefile: Fix TEST_LDFLAGS gcc cmdline position


fyi:

$ cd .../ptest-runner2.git
$ git pull
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (4/4), 526 bytes | 65.00 KiB/s, done.
=C2=A0From git://git.yoctoproject.org/ptest-runner2 =C2=A0 + 8346703...87f6a6e master=C2=A0 =C2=A0 =C2=A0-> origin/master= =C2=A0 (forced update)
fatal: Not possible to fast-forward, aborting.

$ cd .../oe-core.git
$ git status
$ cd ../build
$ . ../oe-core.git/oe-init-build-env foo
$ bitbake -c fetch ptest-runner
...
WARNING: ptest-runner-2.4.0+gitAUTOINC+834670317b-r0 do_fetch: Failed to <= br> fetch URL git://git.yoctoproject.org/ptest-runner2, = attempting MIRRORS
if available

but the fetch works since it falls back to the downloads tarball:

Hi Randy,

I pushed the= rev, my mistake, sorry for the trouble.

Regards,<= /div>
Anibal
=C2=A0


--2021-02-19 14:36:24--
http= ://downloads.yoctoproject.org/mirror/sources/git2_git.yoctoproject.org.ptes= t-runner2.tar.gz
Resolving downloads.yoctoproject.org (downloads.yoctop= roject.org)...
198.145.29.63
Connecting to downloads.yoctoproject.org
(downloads.yoctoproject.org)|198.145.29.63|:80... connected= .
HTTP request sent, awaiting response... 200 OK
Length: 185994 (182K) [application/octet-stream]
Saving to:
=E2=80=98/ala-lpggp31/rmacleod/src/distro/yocto/b/foo/downloads/git2_git.yoctoproject.= org.ptest-runner2.tar.gz=E2=80=99

../Randy
>
> On 07/14/2020 03:29 AM, Anibal Limon wrote:
>> Applied, Thanks!.
>>
>> Anibal
>>
>> On Fri, 10 Jul 2020 at 00:44, Tero Kinnunen <tero.kinnunen@vaisala.com=
>> <mailto:tero.kinnunen@vaisala.com>> wrote:
>>
>>=C2=A0 =C2=A0 =C2=A0Fixes error
>>
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 ERROR: Unable to detach from con= trolling tty, Inappropriate
>>=C2=A0 =C2=A0 =C2=A0ioctl for device
>>
>>=C2=A0 =C2=A0 =C2=A0when running multiple ptests
>>
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 ptest-runner a b
>>
>>=C2=A0 =C2=A0 =C2=A0or when invoked over ssh single command, like<= br> >>
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 $ ssh localhost ptest-runner
>>
>>=C2=A0 =C2=A0 =C2=A0For ssh case, fd 0 is not a tty. (isatty(0) is= false).
>>=C2=A0 =C2=A0 =C2=A0When running multiple ptests, deattach for par= ent needs to be
>>=C2=A0 =C2=A0 =C2=A0done only once.
>>
>>=C2=A0 =C2=A0 =C2=A0Signed-off-by: Tero Kinnunen <tero.kinnunen@vaisala.com=
>>=C2=A0 =C2=A0 =C2=A0<mailto:tero.kinnunen@vaisala.com>>
>>=C2=A0 =C2=A0 =C2=A0---
>>=C2=A0 =C2=A0 =C2=A0=C2=A0utils.c | 6 +++---
>>=C2=A0 =C2=A0 =C2=A0=C2=A01 file changed, 3 insertions(+), 3 delet= ions(-)
>>
>>=C2=A0 =C2=A0 =C2=A0diff --git a/utils.c b/utils.c
>>=C2=A0 =C2=A0 =C2=A0index a8ba190..a4e190e 100644
>>=C2=A0 =C2=A0 =C2=A0--- a/utils.c
>>=C2=A0 =C2=A0 =C2=A0+++ b/utils.c
>>=C2=A0 =C2=A0 =C2=A0@@ -437,6 +437,9 @@ run_ptests(struct ptest_li= st *head, const
>>=C2=A0 =C2=A0 =C2=A0struct ptest_options opts,
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 }
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 fprintf(fp, "START: %s\n", progname);
>>=C2=A0 =C2=A0 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= = =A0 =C2=A0if (isatty(0) && ioctl(0, TIOCNOTTY) =3D=3D -1) {
>>=C2=A0 =C2=A0 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= = =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fprintf(fp, "ERROR: Unable to d= etach from
>>=C2=A0 =C2=A0 =C2=A0controlling tty, %s\n", strerror(errno));=
>>=C2=A0 =C2=A0 =C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= = =A0 =C2=A0}
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 PTEST_LIST_ITERATE_START(head, p)
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char *ptest_dir =3D strdup(p->ru= n_ptest);
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ptest_dir =3D=3D NULL) {
>>=C2=A0 =C2=A0 =C2=A0@@ -444,9 +447,6 @@ run_ptests(struct ptest_li= st *head, const
>>=C2=A0 =C2=A0 =C2=A0struct ptest_options opts,
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<= br> >>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dirname(ptest_dir);
>>=C2=A0 =C2=A0 =C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= = =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ioctl(0, TIOCNOTTY) =3D=3D -1) {=
>>=C2=A0 =C2=A0 =C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= = =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fprintf(= fp, "ERROR: Unable to
>>=C2=A0 =C2=A0 =C2=A0detach from controlling tty, %s\n", strer= ror(errno));
>>=C2=A0 =C2=A0 =C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= = =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((pgid =3D getpgid(0)) =3D=3D -1= ) {
>>=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf= (fp, "ERROR: getpgid()
>>=C2=A0 =C2=A0 =C2=A0failed, %s\n", strerror(errno));
>>=C2=A0 =C2=A0 =C2=A0--
>>=C2=A0 =C2=A0 =C2=A02.25.1
>>
>>
>>
>
>
>
>
>


--
# Randy MacLeod
# Wind River Linux
--0000000000004c6b2b05bbb3bb58--