Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to kill zombie processes?
    primarykey
    data
    text
    <p>I have two problems: a program I made am glitching out and making nearly unkillable processes, if either subproblem is solved I believe both problems will be easily resolved. I am running an early 2008 Macbook on OSX 10.6.8.</p> <p>/<em>Problem #1, coding:</em>/</p> <p>I've been playing around with the iRobot Create using termios.h I/O. I compile without warnings or errors and can run the program without a hitch. I am connecting to the robot by usb which explains the input "/dev/tty.usbserial".</p> <pre><code> gcc simple.c -o simple ./simple /dev/tty.usbserial </code></pre> <p>The program starts by checking the arguments given, then tries to connect with the given argument (char * device is /dev/tty.usbserial) with the biscConnect() function. It fails on my mac.</p> <pre><code>//in file simple.c: int main(int argc, char *argv[]){ if(argc!=2){ printf("Put port... like /dev/tty.usbserial or something\n"); exit(EXIT_FAILURE); } printf("Starting...\n"); biscConnect(argv[1]); } void biscConnect(char *device){ struct termios tty; // Try to open the device from the input if((fd = open(device, O_RDWR | O_NOCTTY | O_NONBLOCK))==-1){ fprintf(stderr, "Serial port at %s could not be opened: %s\n", device, strerror(errno)); exit(EXIT_FAILURE); } tcflush (fd, TCIOFLUSH); tcgetattr(fd, &amp;tty); tty.c_iflag = IGNBRK | IGNPAR; tty.c_lflag = 0; tty.c_oflag = 0; tty.c_cflag = CREAD | CS8 | CLOCAL; cfsetispeed(&amp;tty, B57600); cfsetospeed(&amp;tty, B57600); tcsetattr(fd, TCSANOW, &amp;tty); //The code fails prior to this point } </code></pre> <p>I would then send bytes to the robot to make it move if it didn't get stuck before then.</p> <p>/<em>Problem #2, unkillable processes:</em>/ When I run the file, the terminal goes into a weird mode where the prompt is gone and I can type anything I want (usually signifying a process is running). I cannot exit using control-c. The only way I can seem to exit is closing the terminal window. This fails to kill the running process.</p> <p>I can easily look up the pid but the Activity Monitor but the Force Quit fails to kill the process, kill -9 [pid] fails, killall [program name] fails etc. despite acknowledging the existence of the program. The only way to force terminate the process seems to be to physically close off the power from the computer and reboot it (ie shuting down doesn't work because it tries, and fails, to terminate the process(es)). I am wasting a terrible amount of time if to debug the program I need to power-cycle my laptop every run! I can continually create more process but am unable to delete them.</p> <p>I think if I knew the parent process I might be able to kill these "zombie" processes but I don't know what the parent is.</p> <p>Any ideas on how to get rid of these processes without power-cycling would be tremendous help, thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload