search for: waitpid

Displaying 20 results from an estimated 535 matches for "waitpid".

2016 Apr 14
2
[PATCH] Add safe wrapper around waitpid which deals with EINTR correctly.
As Eric Blake noted in: https://www.redhat.com/archives/libguestfs/2016-April/msg00154.html libguestfs doesn't correctly handle the case where waitpid receives a SIGCHLD signal and the main program has registered a non-restartable signal handler. In this case waitpid would return -EINTR and we would print an error, but actually we should retry this case. This adds two new internal functions, one for handling waitpid and printing (real) errors f...
2016 Apr 14
0
[PATCH] Add safe wrapper around waitpid which deals with EINTR correctly.
...mand.c +++ b/src/command.c @@ -74,7 +74,6 @@ #include <assert.h> #include <sys/types.h> #include <sys/stat.h> -#include <sys/wait.h> #include <sys/select.h> #ifdef HAVE_SYS_TIME_H @@ -692,10 +691,8 @@ wait_command (struct command *cmd) { int status; - if (waitpid (cmd->pid, &status, 0) == -1) { - perrorf (cmd->g, "waitpid"); + if (guestfs_int_waitpid (cmd->g, cmd->pid, &status, "command") == -1) return -1; - } cmd->pid = 0; @@ -902,7 +899,7 @@ guestfs_int_cmd_close (struct command *cmd) free (cm...
2002 Mar 29
1
Two patches for OpenSSH 3.1p1 (fwd)
Can I get people from other platforms to test the waitpid.patch to see if it solves hang-on-exit on their platform? I can confirm Solaris at this moment (but I've not done heavy testing at this moment) that is works like a charm (Solaris 7). It handles 'sleep 90&' vs 'nohup sleep 90&' correctly (killed, vs left). thanks. -...
2001 Mar 25
2
Bug in bsd-waitpid.c and bsd-nextstep.c
Hi! The handling of the "status" information in bsd-waitpid.c and bsd-nextstep.c seems to be bit odd. Patch attached. Best regards, Lutz -- Lutz Jaenicke Lutz.Jaenicke at aet.TU-Cottbus.DE BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/ Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355...
2016 Apr 14
2
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
...mask) { > > + perrorf (g, "read"); > > + close (fd[0]); > > + return -1; > > Oops - this strands a child process. You have to reap the child, even > if the read() failed. Bleah that was stupid. Try attached version - the only difference is I added a waitpid call to the error path above. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supp...
2004 Nov 18
0
FW: problem with win32 waitpid
Forward from Laurent Julliiard. Any suggestions anyone? Dan &gt;From: Laurent Julliard &lt;Laurent.Julliard@xrce.xerox.com&gt; &gt;Reply-To: laurent@moldus.org &gt;To: djberg96@hotmail.com &gt;Subject: problem with win32 waitpid &gt;Date: Thu, 18 Nov 2004 08:49:51 +0100 &gt; &gt;Dan, &gt; &gt;I am one of the developer of the FreeRIDE project (the Ruby IDE) and &gt;I''m in charge of the FreeRIDE debugger with which we have had a &gt;number of problems on Windows now mostly due to the &amp...
2018 Nov 09
4
collectd leaks SIGCHLD == SIG_IGN into plugins
...chives/libguestfs/2018-November/thread.html#00023 The long story short is that collectd leaks SIGCHLD == SIG_IGN setting into plugins: https://www.redhat.com/archives/libguestfs/2018-November/msg00095.html This means that any plugin that does the usual pattern of: pid = fork (); ... if (waitpid (pid, NULL, 0) == -1) { perror ("waitpid"); exit (EXIT_FAILURE); } will fail, because the forked subprocess is automatically reaped before waitpid is called, resulting in the wait failing with errno == ECHILD. It is possible to work around this by adding: signal (SIGCHLD, S...
2004 Nov 18
1
Forward from Laurent Julliard
...my code I have this: require ''win32/process'' command = "start CMD /K ruby -e ''while true { sleep 0.1; }''" @inp = @out = IO.popen(command,"w+") # this is the regular Ruby popen #.... getting the pid of the ruby process (pid variable) Process.waitpid(pid) puts "Process stopped" exit When I run this code I always get the following error: waitpid: no child process (Process::Win32::ProcessError) I suspect that the reason for that is because the command I run actually starts a CMD.exe program which in turn starts a ruby program. The...
2004 Feb 16
0
wait vs waitpid
Hi, It looks like the current wait() method is actually a mix of wait and waitpid. Should we break this down into wait and waitpid for win32, just to keep the API consistent with the Unix version? Mind you, I''m not sure what flags, if any, would be valid for Win32 with regards to waitpid. Also, is wait2 a possibility? Regards, Dan _______________________________...
2002 Mar 26
1
Two patches for OpenSSH 3.1p1
...where sessions will be left "hanging" when you normally exit from a ssh shell (for example by logging out from the remote host via "exit" or "logout"). The problem seems to be that sshd (and some other parts of OpenSSH) doesn't check the return code and errno from waitpid() for errno == EINTR and thus fails to collect the started subprocess correctly. This problem occurs atleast on Solaris 2 and UNICOS systems but it should probably exist on all other SysV based systems... (It doesn't occur all the time so it can be quite hard to test for). The other patch adds...
2007 Mar 31
4
quota warning - take 2
...to improve my code, and here (at last) is a new patch. Things I did not fix: - This patch is still for dovecot 1.0, as I will need warnings with dovecot 1.0. I may rewrite it for CVS HEAD in the future but can't promise. - I'm still using system() rather than fork()+exec()+waitpid() since I don't know a good time to run waitpid(). Comments are welcome. Timo, will you consider to add this to your unofficial patches? Cheers, Nicolas Boullis -------------- next part -------------- A non-text attachment was scrubbed... Name: dovecot_quota_warning.patch.gz Type: app...
2002 Sep 03
2
[patch] for rsync
...by wait_process. I hope I've done this right. Thanks for your help JW. Dave ---------------------------------------------------------------------------------- 29a30,34 > struct pid_status { > pid_t pid; > int status; > } pid_stat_table[10]; > 37c42,47 < while (waitpid(pid, status, WNOHANG) == 0) { --- > pid_t waited_pid; > int cnt; > > while ( 1 ) { > waited_pid = waitpid(pid, status, WNOHANG); > if ( waited_pid == 0 ) { 39a50 > } else break; 40a52,63 > if (( waited_pid == -1 ) && ( errno == E...
2016 Apr 14
3
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
...+ close (fd[0]); > >>> + return -1; > >> > >> Oops - this strands a child process. You have to reap the child, even > >> if the read() failed. > > > > Bleah that was stupid. Try attached version - the only difference is > > I added a waitpid call to the error path above. > > But without looping on EINTR... Thanks - I pushed it with your suggested loop added. BTW we don't loop in waitpid/EINTR anywhere else in libguestfs, but I guess this is something we should be doing. Can you tell us why it's necessary? Rich. >...
2009 Aug 22
1
[PATCH] Add waitpid along guestfs_close path (RHBZ#518747)
Not quite sure what happened to the waitpid()s which were along that path, but at some point they seem to have got deleted. This is a fix for: https://bugzilla.redhat.com/show_bug.cgi?id=518747 I haven't been able to run the tests yet however, because currently Rawhide is broken (ntfsprogs has missing dependencies). Rich. -- Richar...
2004 Mar 29
2
Issue with rsync 2.6.1-pre1 on AIX
Hi all, I've recently tried rsync in daemon mode on AIX. Unfortunately, after handling connections, the daemon segfaulted. I've located this problem to the signal handler for SIGCHLD in socket.c - it seems reinstalling the signal handler before doing waitpid caused the signal to be redelivered, so the program recurses to the signal handler before it runs out of stack space in the end and segfaults. Simply moving the handler reinstaller to after the waitpid seems to work (and should, AFAIK not break anything on other systems). I can also report that IP...
2005 Nov 23
8
a question about popen() performance on domU
Dear all, When I compared the performance of some application on both a Xen domU and a standard linux machine (where domU runs on a similar physical mahine), I notice the application runs faster on the domU than on the physical machine. Instrumenting the application code shows the application spends more time on popen() calls on domU than on the physical machine. I wonder if xenlinux does some
2007 Feb 01
1
pre-xfer exec fails in FreeBSD
Hi I want to use pre-xfer exec function in rsync for permition checking. In my Linux boxes, it successed. But today, I tried to put them in my FreeBSD box, it failed. I've checked the log, but found the pre-xfer exec returns always be -1, which means waitpid failed to get the return status. After doing a little ugly patch for the wait_process function as follow, pre-xfer works again. --- main.c Thu Feb 1 22:42:23 2007 +++ main.c.orig Sat Oct 14 07:46:32 2006 @@ -103,10 +103,7 @@ * remember_children(), we succeed instead of returning an er...
2017 Nov 09
3
check does not check that package examples remove tempdir()
I was looking at the CRAN package 'bfork-0.1.2', which exposes the Unix fork() and waitpid() calls at the R code level, and noticed that the help file example for bfork::fork removes R's temporary directory, the value of tempdir(). I think it happens because the forked process shares the value of tempdir() with the parent process and removes it when it exits. This seems like a ser...
2003 Aug 20
5
Rsync hang on HP-UX 10.20
Hi, We downloaded the latest rsync 2.5.6 source code and compiled it on HP-UX for both 10.20 and 11.x. Rsync runs fine if we run it from the command line on both platforms. But after we put rsync command into a HP Software Distributor package configure script (just a shell script with rsync command in it) and run swinstall, which will get installation bits including the configure script, put the
2016 Apr 14
0
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
...g, "read"); >>> + close (fd[0]); >>> + return -1; >> >> Oops - this strands a child process. You have to reap the child, even >> if the read() failed. > > Bleah that was stupid. Try attached version - the only difference is > I added a waitpid call to the error path above. But without looping on EINTR... + + /* Read the umask. */ + if (read (fd[0], &mask, sizeof mask) != sizeof mask) { + perrorf (g, "read"); + close (fd[0]); + waitpid (pid, NULL, 0); I think it's enough to make this line: while (wait...