All of lore.kernel.org
 help / color / mirror / Atom feed
* [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty
@ 2020-07-10  5:44 Tero Kinnunen
  2020-07-13 19:29 ` Anibal Limon
  0 siblings, 1 reply; 7+ messages in thread
From: Tero Kinnunen @ 2020-07-10  5:44 UTC (permalink / raw)
  To: yocto; +Cc: anibal.limon, Tero Kinnunen

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 <tero.kinnunen@vaisala.com>
---
 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) == -1) {
+			fprintf(fp, "ERROR: Unable to detach from controlling tty, %s\n", strerror(errno));
+		}
 		PTEST_LIST_ITERATE_START(head, p)
 			char *ptest_dir = strdup(p->run_ptest);
 			if (ptest_dir == NULL) {
@@ -444,9 +447,6 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
 				break;
 			}
 			dirname(ptest_dir);
-			if (ioctl(0, TIOCNOTTY) == -1) {
-				fprintf(fp, "ERROR: Unable to detach from controlling tty, %s\n", strerror(errno));
-			}
 
 			if ((pgid = getpgid(0)) == -1) {
 				fprintf(fp, "ERROR: getpgid() failed, %s\n", strerror(errno));
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty
  2020-07-10  5:44 [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty Tero Kinnunen
@ 2020-07-13 19:29 ` Anibal Limon
  2021-02-19  6:44   ` [yocto] " Chen Qi
  0 siblings, 1 reply; 7+ messages in thread
From: Anibal Limon @ 2020-07-13 19:29 UTC (permalink / raw)
  To: Tero Kinnunen; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 1955 bytes --]

Applied, Thanks!.

Anibal

On Fri, 10 Jul 2020 at 00:44, Tero Kinnunen <tero.kinnunen@vaisala.com>
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 <tero.kinnunen@vaisala.com>
> ---
>  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) == -1) {
> +                       fprintf(fp, "ERROR: Unable to detach from
> controlling tty, %s\n", strerror(errno));
> +               }
>                 PTEST_LIST_ITERATE_START(head, p)
>                         char *ptest_dir = strdup(p->run_ptest);
>                         if (ptest_dir == NULL) {
> @@ -444,9 +447,6 @@ run_ptests(struct ptest_list *head, const struct
> ptest_options opts,
>                                 break;
>                         }
>                         dirname(ptest_dir);
> -                       if (ioctl(0, TIOCNOTTY) == -1) {
> -                               fprintf(fp, "ERROR: Unable to detach from
> controlling tty, %s\n", strerror(errno));
> -                       }
>
>                         if ((pgid = getpgid(0)) == -1) {
>                                 fprintf(fp, "ERROR: getpgid() failed,
> %s\n", strerror(errno));
> --
> 2.25.1
>
>

[-- Attachment #2: Type: text/html, Size: 2667 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty
  2020-07-13 19:29 ` Anibal Limon
@ 2021-02-19  6:44   ` Chen Qi
  2021-02-19 15:18     ` Randy MacLeod
  0 siblings, 1 reply; 7+ messages in thread
From: Chen Qi @ 2021-02-19  6:44 UTC (permalink / raw)
  To: Anibal Limon, Tero Kinnunen; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 2570 bytes --]

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

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:
>
>     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 <tero.kinnunen@vaisala.com
>     <mailto:tero.kinnunen@vaisala.com>>
>     ---
>      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) == -1) {
>     +                       fprintf(fp, "ERROR: Unable to detach from
>     controlling tty, %s\n", strerror(errno));
>     +               }
>                     PTEST_LIST_ITERATE_START(head, p)
>                             char *ptest_dir = strdup(p->run_ptest);
>                             if (ptest_dir == NULL) {
>     @@ -444,9 +447,6 @@ run_ptests(struct ptest_list *head, const
>     struct ptest_options opts,
>                                     break;
>                             }
>                             dirname(ptest_dir);
>     -                       if (ioctl(0, TIOCNOTTY) == -1) {
>     -                               fprintf(fp, "ERROR: Unable to
>     detach from controlling tty, %s\n", strerror(errno));
>     -                       }
>
>                             if ((pgid = getpgid(0)) == -1) {
>                                     fprintf(fp, "ERROR: getpgid()
>     failed, %s\n", strerror(errno));
>     -- 
>     2.25.1
>
>
>
> 



[-- Attachment #2: Type: text/html, Size: 5159 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty
  2021-02-19  6:44   ` [yocto] " Chen Qi
@ 2021-02-19 15:18     ` Randy MacLeod
  2021-02-19 17:24       ` Anibal Limon
  2021-02-19 17:25       ` Richard Purdie
  0 siblings, 2 replies; 7+ messages in thread
From: Randy MacLeod @ 2021-02-19 15:18 UTC (permalink / raw)
  To: Chen Qi, Anibal Limon, Tero Kinnunen
  Cc: Yocto discussion list, Michael Halstead, Richard Purdie,
	Trevor Gamblin, Konrad Scherer

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:


--2021-02-19 14:36:24-- 
http://downloads.yoctoproject.org/mirror/sources/git2_git.yoctoproject.org.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: 
‘/ala-lpggp31/rmacleod/src/distro/yocto/b/foo/downloads/git2_git.yoctoproject.org.ptest-runner2.tar.gz’

../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:
>>
>>     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 <tero.kinnunen@vaisala.com
>>     <mailto:tero.kinnunen@vaisala.com>>
>>     ---
>>      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) == -1) {
>>     +                       fprintf(fp, "ERROR: Unable to detach from
>>     controlling tty, %s\n", strerror(errno));
>>     +               }
>>                     PTEST_LIST_ITERATE_START(head, p)
>>                             char *ptest_dir = strdup(p->run_ptest);
>>                             if (ptest_dir == NULL) {
>>     @@ -444,9 +447,6 @@ run_ptests(struct ptest_list *head, const
>>     struct ptest_options opts,
>>                                     break;
>>                             }
>>                             dirname(ptest_dir);
>>     -                       if (ioctl(0, TIOCNOTTY) == -1) {
>>     -                               fprintf(fp, "ERROR: Unable to
>>     detach from controlling tty, %s\n", strerror(errno));
>>     -                       }
>>
>>                             if ((pgid = getpgid(0)) == -1) {
>>                                     fprintf(fp, "ERROR: getpgid()
>>     failed, %s\n", strerror(errno));
>>     -- 
>>     2.25.1
>>
>>
>>
> 
> 
> 
> 
> 


-- 
# Randy MacLeod
# Wind River Linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty
  2021-02-19 15:18     ` Randy MacLeod
@ 2021-02-19 17:24       ` Anibal Limon
  2021-02-19 17:25       ` Richard Purdie
  1 sibling, 0 replies; 7+ messages in thread
From: Anibal Limon @ 2021-02-19 17:24 UTC (permalink / raw)
  To: Randy MacLeod
  Cc: Chen Qi, Tero Kinnunen, Yocto discussion list, Michael Halstead,
	Richard Purdie, Trevor Gamblin, Konrad Scherer

[-- Attachment #1: Type: text/plain, Size: 5094 bytes --]

On Fri, 19 Feb 2021 at 09:18, Randy MacLeod <randy.macleod@windriver.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)
>             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.org.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:
> ‘/ala-lpggp31/rmacleod/src/distro/yocto/b/foo/downloads/
> git2_git.yoctoproject.org.ptest-runner2.tar.gz’
>
> ../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:
> >>
> >>     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 <tero.kinnunen@vaisala.com
> >>     <mailto:tero.kinnunen@vaisala.com>>
> >>     ---
> >>      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) == -1) {
> >>     +                       fprintf(fp, "ERROR: Unable to detach from
> >>     controlling tty, %s\n", strerror(errno));
> >>     +               }
> >>                     PTEST_LIST_ITERATE_START(head, p)
> >>                             char *ptest_dir = strdup(p->run_ptest);
> >>                             if (ptest_dir == NULL) {
> >>     @@ -444,9 +447,6 @@ run_ptests(struct ptest_list *head, const
> >>     struct ptest_options opts,
> >>                                     break;
> >>                             }
> >>                             dirname(ptest_dir);
> >>     -                       if (ioctl(0, TIOCNOTTY) == -1) {
> >>     -                               fprintf(fp, "ERROR: Unable to
> >>     detach from controlling tty, %s\n", strerror(errno));
> >>     -                       }
> >>
> >>                             if ((pgid = getpgid(0)) == -1) {
> >>                                     fprintf(fp, "ERROR: getpgid()
> >>     failed, %s\n", strerror(errno));
> >>     --
> >>     2.25.1
> >>
> >>
> >>
> >
> >
> >
> > 
> >
>
>
> --
> # Randy MacLeod
> # Wind River Linux
>

[-- Attachment #2: Type: text/html, Size: 7759 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty
  2021-02-19 15:18     ` Randy MacLeod
  2021-02-19 17:24       ` Anibal Limon
@ 2021-02-19 17:25       ` Richard Purdie
  2021-02-19 17:34         ` Randy MacLeod
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2021-02-19 17:25 UTC (permalink / raw)
  To: Randy MacLeod, Chen Qi, Anibal Limon, Tero Kinnunen
  Cc: Yocto discussion list, Michael Halstead, Trevor Gamblin, Konrad Scherer

On Fri, 2021-02-19 at 10:18 -0500, 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?

I talked with Anibal and its fixed now.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty
  2021-02-19 17:25       ` Richard Purdie
@ 2021-02-19 17:34         ` Randy MacLeod
  0 siblings, 0 replies; 7+ messages in thread
From: Randy MacLeod @ 2021-02-19 17:34 UTC (permalink / raw)
  To: Richard Purdie, Chen Qi, Anibal Limon, Tero Kinnunen
  Cc: Yocto discussion list, Michael Halstead, Trevor Gamblin, Konrad Scherer

On 2021-02-19 12:25 p.m., Richard Purdie wrote:
> On Fri, 2021-02-19 at 10:18 -0500, 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?
> 
> I talked with Anibal and its fixed now.

Thanks everyone.
../Randy

> 
> Cheers,
> 
> Richard
> 


-- 
# Randy MacLeod
# Wind River Linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-19 17:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10  5:44 [ptest-runner][PATCH v2] Fix inappropriate ioctl when detaching tty Tero Kinnunen
2020-07-13 19:29 ` Anibal Limon
2021-02-19  6:44   ` [yocto] " Chen Qi
2021-02-19 15:18     ` Randy MacLeod
2021-02-19 17:24       ` Anibal Limon
2021-02-19 17:25       ` Richard Purdie
2021-02-19 17:34         ` Randy MacLeod

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.