Lecture 05: Understanding Execvp

Total Page:16

File Type:pdf, Size:1020Kb

Lecture 05: Understanding Execvp Lecture 05: Understanding execvp Principles of Computer Systems Spring 2019 Stanford University Computer Science Department Lecturer: Chris Gregg PDF of this presentation 1 Lecture 05: Question from yesterday: where is the cursor stored for a file? Diagram from last lecture: In the last lecture, the question came up about multiple processes pointing to the open file table, and what happens to the cursor. Every time there is an open() system call, a new entry is generated for the open file table. If a process forks, both the parent and child share a pointer to the same open file entry, and therefore their cursors will be the same (i.e., if one reads a line, the other will read the next line). This is also true with the dup and dup2 system calls, which we will learn about (briefly) in lab and in more detail next week. 2 Assignment 2: The Unix v6 Filesystem Your second assignment of the quarter is to write a program in C (not C++) that can read from a 1970s-era Unix version 6 filesystem. The test data you are reading from are literally bit-for-bit representations of a Unix v6 disk. You will leverage all of the information covered in the file system lecture from Lecture 3 to write the program, and for more detailed information, see Section 2.5 of the Salzer and Kaashoek textbook. You will primarily be writing code in four different files (and we suggest you tackle them in this order): inode.c file.c directory.c pathname.c Because the program is in C, you will have to rely on arrays of structs, and low-level data manipulation, as you don't have access to any C++ standard template library classes. 3 Assignment 2: The Unix v6 Filesystem The basic idea of the assignment is to write code that will be able to locate and read files in the file system. You will, for example, be using a function we've written for you to read sectors from the disk image: /** * Reads the specified sector (e.g. block) from the disk. Returns the number of bytes read, * or -1 on error. */ int diskimg_readsector(int fd, int sectorNum, void *buf); Sometimes, buf will be an array of inodes, sometimes it will be a buffer that holds actual file data. In any case, the function will always read DISKIMG_SECTOR_SIZE number of bytes, and it is your job to determine the relevance of those bytes. It is critical that you carefully read through the header files for this assignment (they are actually relatively short). There are key constants (e.g., ROOT_INUMBER, struct direntv6, etc.) that are defined for you to use, and reading them will give you an idea about where to start for parts of the assignment. 4 Assignment 2: The Unix v6 Filesystem One function that can be tricky to write is the following: /** * Gets the location of the specified file block of the specified inode. * Returns the disk block number on success, -1 on error. */ int inode_indexlookup(struct unixfilesystem *fs, struct inode *inp, int blockNum); The unixfilesystem struct is defined and initialized for you. The inode struct will be populated already The blockNum is the number, in linear order, of the block you are looking for in a particular file. For example: Let's say the inode indicates that the file it refers to has a size of 180,000 bytes. And let's assume that blockNum is 302. This means that we are looking for the 302nd block of data in the file referred to by inode. Recall that blocks are 512 bytes long. How would you find the block index (i.e., sector index) of the 302nd block in the file? 5 Assignment 2: The Unix v6 Filesystem For example: Let's say the inode indicates that the file it refers to has a size of 180,000 bytes. And let's assume that blockNum is 302. This means that we are looking for the 302nd block of data in the file referred to by inode. Recall that blocks are 512 bytes long How would you find the block index (i.e., sector index) of the 302nd block in the file? 1. Determine if the file is large or not 2. If it isn't large, you know you only have direct addressing. 3. If it is large (this file is), then you have indirect addressing. 4. The 302nd block is going to fall into the second indirect block, because each block has 256 block numbers (each block number is an unsigned short, or a uint16_t). 5. You, therefore, need to use diskimg_readsector to read the sector listed in the 2nd block number (which is in the inode struct), then extract the (302 % 256)th short from that block, and return the value you find there. 6. If the block number you were looking for happened to fall into the 8th inode block, then you would have a further level of indirection for a doubly-indirect lookup. 6 Assignment 2: The Unix v6 Filesystem For the assignment, you will also have to search through directories to locate a particular file. You do not have to follow symbolic links (you can ignore them completely) You do need to consider directories that are longer than 32 files long (because they will take up more than two blocks on the disk), but this is not a special case! You are building generic functions to read files, so you can rely on them to do the work for you, even for directory file reading. Don't forget that a filename is limited to 14 characters, and if it is exactly 14 characters, there is not a trailing '\0' at the end of the name (this to conserve that one byte of data!) So...you might want to be careful about using strcmp for files (maybe use strncmp, instead?) This is a relatively advanced assignment, with a lot of moving parts. Start early! Come to office hours or ask Piazza questions. Remember: CAs won't look at your code, so you must formulate your questions to be conceptual enough that they can be answered. 7 Lecture 05: More on Multiprocessing Third example: Synchronizing between parent and child using waitpid waitpid can be used to temporarily block one process until a child process exits. pid_t waitpid(pid_t pid, int *status, int options); The first argument specifies the wait set, which for the moment is just the id of the child process that needs to complete before waitpid can return. The second argument supplies the address of an integer where termination information can be placed (or we can pass in NULL if we don't care for the information). The third argument is a collection of bitwise-or'ed flags we'll study later. For the time being, we'll just go with 0 as the required parameter value, which means that waitpid should only return when a process in the supplied wait set exits. The return value is the pid of the child that exited, or -1 if waitpid was called and there were no child processes in the supplied wait set. 8 Lecture 05: More on Multiprocessing Third example: Synchronizing between parent and child using waitpid Consider the following program, which is more representative of how fork really gets used in practice (full program, with error checking, is right here): int main(int argc, char *argv[]) { printf("Before.\n"); pid_t pid = fork(); printf("After.\n"); if (pid == 0) { printf("I am the child, and the parent will wait up for me.\n"); return 110; // contrived exit status } else { int status; waitpid(pid, &status, 0) if (WIFEXITED(status)) { printf("Child exited with status %d.\n", WEXITSTATUS(status)); } else { printf("Child terminated abnormally.\n"); } return 0; } } 9 Lecture 05: More on Multiprocessing Third example: Synchronizing between parent and child using waitpid The output is the same every single time the above program is executed. myth60$ ./separate Before. After. After. I am the child, and the parent will wait up for me. Child exited with status 110. myth60$ The implementation directs the child process one way, the parent another. The parent process correctly waits for the child to complete using waitpid. The parent lifts child exit information out of the waitpid call, and uses the WIFEXITED macro to examine some high-order bits of its argument to confirm the process exited normally, and it uses the WEXITSTATUS macro to extract the lower eight bits of its argument to produce the child return value (which we can see is, and should be, 110). The waitpid call also donates child process-oriented resources back to the system. 10 Lecture 05: More on Multiprocessing Synchronizing between parent and child using waitpid This next example is more of a brain teaser, but it illustrates just how deep a clone the process created by fork really is (full program, with more error checking, is right here). int main(int argc, char *argv[]) { printf("I'm unique and just get printed once.\n"); pid_t pid = fork(); bool parent = pid != 0; if ((random() % 2 == 0) == parent) sleep(1); // force exactly one of the two to sleep if (parent) waitpid(pid, NULL, 0); // parent shouldn't exit until child has finished printf("I get printed twice (this one is being printed from the %s).\n", parent ? "parent" : "child"); return 0; } The code emulates a coin flip to seduce exactly one of the two processes to sleep for a second, which is more than enough time for the child process to finish. The parent waits for the child to exit before it allows itself to exit.
Recommended publications
  • Name Synopsis Description
    Perl version 5.10.0 documentation - vmsish NAME vmsish - Perl pragma to control VMS-specific language features SYNOPSIS use vmsish; use vmsish 'status';# or '$?' use vmsish 'exit'; use vmsish 'time'; use vmsish 'hushed'; no vmsish 'hushed'; vmsish::hushed($hush); use vmsish; no vmsish 'time'; DESCRIPTION If no import list is supplied, all possible VMS-specific features areassumed. Currently, there are four VMS-specific features available:'status' (a.k.a '$?'), 'exit', 'time' and 'hushed'. If you're not running VMS, this module does nothing. vmsish status This makes $? and system return the native VMS exit statusinstead of emulating the POSIX exit status. vmsish exit This makes exit 1 produce a successful exit (with status SS$_NORMAL),instead of emulating UNIX exit(), which considers exit 1 to indicatean error. As with the CRTL's exit() function, exit 0 is also mappedto an exit status of SS$_NORMAL, and any other argument to exit() isused directly as Perl's exit status. vmsish time This makes all times relative to the local time zone, instead of thedefault of Universal Time (a.k.a Greenwich Mean Time, or GMT). vmsish hushed This suppresses printing of VMS status messages to SYS$OUTPUT andSYS$ERROR if Perl terminates with an error status. and allowsprograms that are expecting "unix-style" Perl to avoid having to parseVMS error messages. It does not suppress any messages from Perlitself, just the messages generated by DCL after Perl exits. The DCLsymbol $STATUS will still have the termination status, but with ahigh-order bit set: EXAMPLE:$ perl -e"exit 44;" Non-hushed error exit%SYSTEM-F-ABORT, abort DCL message$ show sym $STATUS$STATUS == "%X0000002C" $ perl -e"use vmsish qw(hushed); exit 44;" Hushed error exit $ show sym $STATUS $STATUS == "%X1000002C" The 'hushed' flag has a global scope during compilation: the exit() ordie() commands that are compiled after 'vmsish hushed' will be hushedwhen they are executed.
    [Show full text]
  • UNIX X Command Tips and Tricks David B
    SESUG Paper 122-2019 UNIX X Command Tips and Tricks David B. Horvath, MS, CCP ABSTRACT SAS® provides the ability to execute operating system level commands from within your SAS code – generically known as the “X Command”. This session explores the various commands, the advantages and disadvantages of each, and their alternatives. The focus is on UNIX/Linux but much of the same applies to Windows as well. Under SAS EG, any issued commands execute on the SAS engine, not necessarily on the PC. X %sysexec Call system Systask command Filename pipe &SYSRC Waitfor Alternatives will also be addressed – how to handle when NOXCMD is the default for your installation, saving results, and error checking. INTRODUCTION In this paper I will be covering some of the basics of the functionality within SAS that allows you to execute operating system commands from within your program. There are multiple ways you can do so – external to data steps, within data steps, and within macros. All of these, along with error checking, will be covered. RELEVANT OPTIONS Execution of any of the SAS System command execution commands depends on one option's setting: XCMD Enables the X command in SAS. Which can only be set at startup: options xcmd; ____ 30 WARNING 30-12: SAS option XCMD is valid only at startup of the SAS System. The SAS option is ignored. Unfortunately, ff NOXCMD is set at startup time, you're out of luck. Sorry! You might want to have a conversation with your system administrators to determine why and if you can get it changed.
    [Show full text]
  • HP Decset for Openvms Guide to the Module Management System
    HP DECset for OpenVMS Guide to the Module Management System Order Number: AA–P119J–TE July 2005 This guide describes the Module Management System (MMS) and explains how to get started using its basic features. Revision/Update Information: This is a revised manual. Operating System Version: OpenVMS I64 Version 8.2 OpenVMS Alpha Version 7.3–2 or 8.2 OpenVMS VAX Version 7.3 Windowing System Version: DECwindows Motif for OpenVMS I64 Version 1.5 DECwindows Motif for OpenVMS Alpha Version 1.3–1 or 1.5 DECwindows Motif for OpenVMS VAX Version 1.2–6 Software Version: HP DECset Version 12.7 for OpenVMS Hewlett-Packard Company Palo Alto, California © Copyright 2005 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Java is a US trademark of Sun Microsystems, Inc. Microsoft, Windows, and Windows NT are U.S. registered trademarks of Microsoft Corporation.
    [Show full text]
  • Linux-Kernel
    linux-kernel #linux- kernel Table of Contents About 1 Chapter 1: Getting started with linux-kernel 2 Remarks 2 Versions 2 Examples 2 Installation or Setup 2 Download extract and enter to the kernel directory 2 Build the dependencies, compile the kernel and modules. 3 Chapter 2: Creation and usage of Kernel Threads 4 Introduction 4 Examples 4 Creation of kernel threads 4 Chapter 3: Event Tracing 6 Examples 6 Tracing I2C Events 6 Chapter 4: Fork System call 7 Examples 7 fork() system call 7 Chapter 5: How to find the right person for help. 9 Introduction 9 Examples 9 Find the "likely" maintainers for the FTDI USB serial converter 9 Chapter 6: Linux Hello World Device driver 10 Examples 10 An empty kernel module 10 Building and running the module 10 Chapter 7: Linux: Named Pipes(FIFO) 12 Examples 12 What is Named Pipe (FIFO) 12 Credits 13 About You can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: linux-kernel It is an unofficial and free linux-kernel ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official linux-kernel. The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners.
    [Show full text]
  • HP Openvms Utility Routines Manual
    HP OpenVMS Utility Routines Manual Order Number: BA554-90019 June 2010 This manual describes the OpenVMS utility routines, a set of routines that provide a programming interface to various OpenVMS utilities. Revision/Update Information: This manual supersedes the HP OpenVMS Utility Routines Manual, OpenVMS Alpha Version 8.3. Software Version: OpenVMS Version 8.4 for Integrity servers OpenVMS Alpha Version 8.4 Hewlett-Packard Company Palo Alto, California © Copyright 2010 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. ZK4493 The HP OpenVMS documentation set is available on CD. This document was prepared using DECdocument, Version 3.3-1B. Contents Preface ............................................................ xvii 1 Introduction to Utility Routines 2 Access Control List (ACL) Editor Routine 2.1 Introduction to the ACL Editor Routine ........................... ACL–1 2.2 Using the ACL Editor Routine: An Example ....................... ACL–1 2.3 ACL Editor Routine . ........................................ ACL–2 ACLEDIT$EDIT ...........................................
    [Show full text]
  • The Big Picture So Far Today: Process Management
    The Big Picture So Far From the Architecture to the OS to the User: Architectural resources, OS management, and User Abstractions. Hardware abstraction Example OS Services User abstraction Processor Process management, Scheduling, Traps, Process protection, accounting, synchronization Memory Management, Protection, virtual memory Address spaces I/O devices Concurrency with CPU, Interrupt Terminal, mouse, printer, handling system calls File System File management, Persistence Files Distributed systems Networking, security, distributed file Remote procedure calls, system network file system System calls Four architectures for designing OS kernels Computer Science CS377: Operating Systems Lecture 4, page 1 Today: Process Management • A process as the unit of execution. • How are processes represented in the OS? • What are possible execution states and how does the system move from one state to another? • How are processes created in the system? • How do processes communicate? Is this efficient? Computer Science CS377: Operating Systems Lecture 4, page 2 What's in a Process? • Process: dynamic execution context of an executing program • Several processes may run the same program, but each is a distinct process with its own state (e.g., MS Word). • A process executes sequentially, one instruction at a time • Process state consists of at least: ! the code for the running program, ! the static data for the running program, ! space for dynamic data (the heap), the heap pointer (HP), ! the Program Counter (PC), indicating the next instruction, ! an execution stack with the program's call chain (the stack), the stack pointer (SP) ! values of CPU registers ! a set of OS resources in use (e.g., open files) ! process execution state (ready, running, etc.).
    [Show full text]
  • Processes and Job Control
    Processes and Job Control Hour 17 PObjectives < Definitions: process, orphan, and zombie < System processes < Process creation < Examining processes: the ps command < Job control: &, nohup, fg, bg, jobs, ( ), and kill < Exit status Copyright © 1998-2002 Delroy A. Brinkerhoff. All Rights Reserved. Hour 17 Unix Slide 1 of 12 Process Also called a job by C and Korn shells PWhen a program or executable file is loaded from disk and started running (i.e., when a command is run), it is called a process vi pid 641 < identified by a unique process ID (PID) number < has an owner vi < private data vi PA program can be loaded more than once pid 895 < creates multiple processes vi < each process has a different PID < each process may have a different owner PPIDs are unique, nonnegative integers < numbers recycle without collisions Hour 17 Unix Slide 2 of 12 System Processes Processes created during system boot P0System kernel < “hand crafted” at boot < called swap in older versions (swaps the CPU between processes) < called sched in newer versions (schedules processes) < creates process 1 P1 init (the parent of all processes except process 0) < general process spawner < begins building locale-related environment < sets or changes the system run-level P2 page daemon (pageout on most systems) P3 file system flusher (fsflush) Hour 17 Unix Slide 3 of 12 Process Life Cycle Overview of creating new processes fork init init pid 467 Pfork creates two identical pid 1 exec processes (parent and child) getty pid 467 Pexec < replaces the process’s instructions
    [Show full text]
  • 6.087 Practical Programming in C, Lecture 14
    Outline Review Inter process communication Signals Fork Pipes FIFO Spotlights 1 6.087 Lecture 14 – January 29, 2010 Review Inter process communication Signals Fork Pipes FIFO Spotlights 2 Review: multithreading • Race conditions • non-determinism in thread order. • can be prevented by synchronization • atomic operations necessary for synchronization • Mutex: Allows a single thread to own it • Semaphores: Generalization of mutex, allows N threads to acquire it at a time. • P(s) : acquires a lock • V(s) : releases lock • sem_init(),sem_destroy() • sem_wait(),sem_trywait(),sem_post() • Other problems: deadlock, starvation 2 Sockets • <sys/socket.h> • enables client-server computing • Client: connect() • Server: bind(),listen(),accept() • I/O: write(),send(),read(),recv() 3 6.087 Lecture 14 – January 29, 2010 Review Inter process communication Signals Fork Pipes FIFO Spotlights 4 Preliminaries • Each process has its own address space. Therefore, individual processes cannot communicate unlike threads. • Interprocess communication: Linux/Unix provides several ways to allow communications • signal • pipes • FIFO queues • shared memory • semaphores • sockets 4 <signals.h> • Unix/Linux allows us to handle exceptions that arise during execution (e.g., interrupt, floating point error, segmentation fault etc.). • A process recieves a signal when such a condition occurs. void (∗signal(int sig,void(∗handler)(int )))( int ) • determines how subsequent signals will be handled. • pre-defined behavior: SIG_DFL (default), SIG_IGN (ignore) • returns the previous handler. 5 <signal.h> Valid signals: SIGABRT abnormal termination SIGFPE floating point error SIGILL illegal instruction SIGINT interrupt SIGSEGV segmentation fault SIGTERM termination request SIGBUS bus error SIGQUIT quit The two signals SIGSTOP,SIGKILL cannot be handled. 6 <signal.h> int raise( int sig) can be used to send signal sig to the program.
    [Show full text]
  • Lecture 4: September 13 4.1 Process State
    CMPSCI 377 Operating Systems Fall 2012 Lecture 4: September 13 Lecturer: Prashant Shenoy TA: Sean Barker & Demetre Lavigne 4.1 Process State 4.1.1 Process A process is a dynamic instance of a computer program that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently. A computer program itself is just a passive collection of instructions, while a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several windows of the same program typically means more than one process is being executed. The state of a process consists of - code for the running program (text segment), its static data, its heap and the heap pointer (HP) where dynamic data is kept, program counter (PC), stack and the stack pointer (SP), value of CPU registers, set of OS resources in use (list of open files etc.), and the current process execution state (new, ready, running etc.). Some state may be stored in registers, such as the program counter. 4.1.2 Process Execution States Processes go through various process states which determine how the process is handled by the operating system kernel. The specific implementations of these states vary in different operating systems, and the names of these states are not standardised, but the general high-level functionality is the same. When a process is first started/created, it is in new state. It needs to wait for the process scheduler (of the operating system) to set its status to "new" and load it into main memory from secondary storage device (such as a hard disk or a CD-ROM).
    [Show full text]
  • Pid T Fork(Void); Description: Fork Creates a Child Process That Differs
    pid_t fork(void); Description: fork creates a child process that differs from the parent process only in its PID and PPID, and in the fact that resource utilizations are set to 0. File locks and pending signals are not inherited. Returns: On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. int execve(const char *filename, char *const argv [], char *const envp[]); Description: execve() executes the program pointed to by filename. filename must be either a binary executable, or a script. argv is an array of argument strings passed to the new program. envp is an array of strings, conventionally of the form key=value, which are passed as environment to the new program. Returns: execve() does not return on success, and the text, data, bss, and stack of the calling process are overwritten by that of the program loaded. pid_t wait(int *status); pid_t waitpid(pid_t pid, int *status, int options); Description: The wait function suspends execution of the current process until a child has exited, or until a signal is delivered whose action is to terminate the current process or to call a signal handling function. The waitpid function suspends execution of the current process until a child as specified by the pid argument has exited, or until a signal is delivered whose action is to terminate the current process or to call a signal handling function. If a child has already exited by the time of the call (a so-called \zombie" process), the function returns immediately.
    [Show full text]
  • System Calls & Signals
    CS345 OPERATING SYSTEMS System calls & Signals Panagiotis Papadopoulos [email protected] 1 SYSTEM CALL When a program invokes a system call, it is interrupted and the system switches to Kernel space. The Kernel then saves the process execution context (so that it can resume the program later) and determines what is being requested. The Kernel carefully checks that the request is valid and that the process invoking the system call has enough privilege. For instance some system calls can only be called by a user with superuser privilege (often referred to as root). If everything is good, the Kernel processes the request in Kernel Mode and can access the device drivers in charge of controlling the hardware (e.g. reading a character inputted from the keyboard). The Kernel can read and modify the data of the calling process as it has access to memory in User Space (e.g. it can copy the keyboard character into a buffer that the calling process has access to) When the Kernel is done processing the request, it restores the process execution context that was saved when the system call was invoked, and control returns to the calling program which continues executing. 2 SYSTEM CALLS FORK() 3 THE FORK() SYSTEM CALL (1/2) • A process calling fork()spawns a child process. • The child is almost an identical clone of the parent: • Program Text (segment .text) • Stack (ss) • PCB (eg. registers) • Data (segment .data) #include <sys/types.h> #include <unistd.h> pid_t fork(void); 4 THE FORK() SYSTEM CALL (2/2) • The fork()is one of the those system calls, which is called once, but returns twice! Consider a piece of program • After fork()both the parent and the child are ..
    [Show full text]
  • Troubleshoot Zombie/Defunct Processes in UC Servers
    Troubleshoot Zombie/Defunct Processes in UC Servers Contents Introduction Prerequisites Requirements Components Used Background Information Check Zombies using UCOS Admin CLI Troubleshoot/Clear the Zombies Manually Restart the Appropriate Service Reboot the Server Kill the Parent Process Verify Introduction This document describes how to work with zombie processes seen on CUCM, IMnP, and other Cisco UC products when logged in using Admin CLI. Prerequisites Requirements Cisco recommends that you have knowledge of using Admin CLI of the UC servers: ● Cisco Unified Communications Manager (CUCM) ● Cisco Unified Instant Messaging and Presence Server (IMnP) ● Cisco Unity Connection Server (CUC) Components Used This document is not restricted to specific software and hardware versions. The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command. Background Information The Unified Communications servers are essentially Linux OS based applications. When a process dies on Linux, it is not all removed from memory immediately, its process descriptor (PID) stays in memory which only takes a tiny amount of memory. This process becomes a defunct process and the process's parent is notified that its child process has died. The parent process is then supposed to read the dead process's exit status and completely remove it from the memory. Once this is done using the wait() system call, the zombie process is eliminated from the process table. This is known as reaping the zombie process.
    [Show full text]