bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU Parallel Bug Reports parallel cannot cope with process with empt


From: William Bader
Subject: Re: GNU Parallel Bug Reports parallel cannot cope with process with empty name
Date: Fri, 26 Jun 2015 12:48:20 -0400



> Date: Fri, 26 Jun 2015 12:06:58 -0400
> From: address@hidden
> To: address@hidden
> CC: address@hidden
> Subject: Re: GNU Parallel Bug Reports parallel cannot cope with process with empty name
>
> On 06/26/2015 11:52 AM, Ole Tange wrote:
> > On Fri, Jun 12, 2015 at 2:51 AM, Daniel Colascione <address@hidden> wrote:
> >
> >> It's possible for a process to have an empty name:
> >
> > I have seen this twice:
> >
> > * Once on a Mac running Cubase's license server software
> > * Once on a Linux system that was compromised by criminals
> >
> >> $ ps -ef | perl -ane '1..1 and /^(.*)CO?MM?A?N?D/ and $s=length
> >> $1;s/^.{$s}//; print "@F[1,2] $_"' | grep 900
> >> 90029 90023
> >
> > Can you elaborate on what OS you are running and which crazy program
> > removes it's program name from the process list?
>
> It's an internal program running a typical GNU/Linux system. The
> program's provenance doesn't matter: it's both legal and possible for
> programs to give themselves empty names. Are you suggesting it's okay
> for Parallel to fall over and die (in a loop, no less, when executed
> with --version) because some program uses a supported API in a way that
> displeases you? I hope not, because that attitude would force me to tell
> everyone I know to stay away from using GNU Parallel.
>

On many operating systems, you can change what ps shows by simply by writing to argv[].

In the old days before procfs, you could run nlist() on /unix to find the location of the "proc" struct in /dev/kmem. The u386mon source has examples.

scslaptop37 ~/test$ cat testsetarg.c 

#include <unistd.h>

#include <string.h>

main(argc, argv)

int argc;

char *argv[];

{

        strncpy(argv[0], argv[1], strlen(argv[0]));

        sleep(30);

}

scslaptop37 ~/test$ cc testsetarg.c 

scslaptop37 ~/test$ ./a.out abc def & ps -ef | grep abc

[1] 14689

william  14689  2797  0 12:24 pts/1    00:00:00 abc     abc def

william  14691  2797  0 12:24 pts/1    00:00:00 grep --color=auto abc

scslaptop37 ~/test$ uname -a

Linux scslaptop37 3.19.8-100.fc20.x86_64 #1 SMP Tue May 12 17:08:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

scslaptop37 ~/test$ 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]