Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 9.9, Problem 9.10PP
Program Plan Intro
Simple Segregated Storage:
Simple Segregated Storage is the fastest and simplest
- It works by separating a blocks of memory into fixed size chunks.
- The free list holds same size blocks for each size class, respectively the size of the largest item of the size class.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
We can solve memory leaks with
using a tombstone or lock and keys approach to the dangling pointer problem
using a tombstone or mark-sweep approach to the dangling pointer problem
some form of garbage collection such as mark-sweep or reference counters
some form of garbage collection such as tombstones or lock-and-keys
7. a. Explain the concept and the cause of a memory leak.
b. Explain the idea of garbage collection and how it is related to current heap links
I'm having a hard time seeing the problem with this buffer overflow problem can someone please elaborate if its secure or not, and if there are any other issues with the implementation in the problem?
Someone tries to fix the stack based buffer overflow problem as follows, is it secure now? why? Are there any other issues within the function's implementation below? Explain your reasoning.
int bof(char *str, int size)
{
char *buffer = (char *) malloc(size);
strcpy(buffer, str);
return 1;
}
Chapter 9 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 9.2 - Prob. 9.1PPCh. 9.3 - Prob. 9.2PPCh. 9.6 - Prob. 9.3PPCh. 9.6 - Prob. 9.4PPCh. 9.8 - Practice Problem 9.5 (solution page 882) Write a C...Ch. 9.9 - Prob. 9.6PPCh. 9.9 - Prob. 9.7PPCh. 9.9 - Prob. 9.8PPCh. 9.9 - Prob. 9.9PPCh. 9.9 - Prob. 9.10PP
Ch. 9 - Prob. 9.11HWCh. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Given an input file hello.txt that consists of the...Ch. 9 - Determine the block sizes and header values that...Ch. 9 - Prob. 9.16HWCh. 9 - Prob. 9.17HWCh. 9 - Prob. 9.18HWCh. 9 - Prob. 9.19HWCh. 9 - Write your own version of malloc and free, and...
Knowledge Booster
Similar questions
- 3 Malloc—Dynamic Memory Allocation 1. Give an example where a malloc()-like allocator would fail due to external fragmentation. 2. Give an example where returning a block to the allocator results in reducing the number of free blocks. Assume an implicit free list is used.arrow_forwardQuestion 6.3: In order to practice multi-threading use C++ to create a quick sort algorithm using a standard sequential method then use the OpenMP library to create a parallel version of the program and write a brief evaluation of the performances of both of these algorithms.arrow_forwardQuestion 4: Question 3: Consider the following code which computes the inner product of 2 vectors: prod := 0; i = 1; repeat { prod := prod + a[i] *b[i] i=i+1; until i > 20 } a. Convert the given code into Intermediate Representation - Three Address Codearrow_forward
- Q7. ] Given the following ARM64 assembly code for a function, add comments to each line, use its stack frame with corresponding variables, and trace the code execution to figure out what it does. Notice that local variables are stored in the function's stack frame. Hint: this is a void function that takes two input parameters. tunct: sub sp. sp, #32 str x0, (sp, 8] Address Contents x1, [sp) Idr x0, Isp, 81 str SP Sp + 4 Sp +8 Sp + 12 Sp + 16 Sp + 20 Sp + 24 Sp + 28 Idr wo, [x0] str wo, [sp, 28] Idr x0, [sp) Idr w1, [x0] Idr x0, [sp, 8] w1, [x0] Idr x0, Isp) str Idr w1, [sp, 28] str w1, [x0] DOR add Sp. sp, 32 retarrow_forwardSomeone tries to fix the stack based buffer overflow problem as follows, is it secure now? why?why not? Are there any other issues within the function's implementation below? Please explain your reasoning. int bof(char *str, int size) { char *buffer = (char *) malloc(size); strcpy(buffer, str); return 1; }arrow_forward112. Four necessary conditions for deadlock to exist are: mutual exclusion, no-preemption, circular wait and a. hold and wait b. deadlock avoidance c. race around condition d. buffer overflowarrow_forward
- 3. Which stack protection techniques are vulnerable to return-orlented programming? a. Stack Canaries b. Address space layout randomization c. Limiting Executable Code Regions 4. In malloclab, several students implemented an optimization where small blocks would be allocated at the beglinning of a free block, and large blocks would be allocated at the end of a free block. In what way was this useful on some traces? a. It increases the memory utilization due to less Internal fragmentation. b. It increagos tho momory utlization duo to moro coaloscing opportunities. c. Itincreases the throughput due to smaller free lists. d. It increases the throughput due to better temporal locality in caches. 5. After a forki), to access which datastnuctures, should the resulting two processes synchronize? а. Неар b. Stack c. Registers d. Globals e. Program Codearrow_forward3. In the StackGuard approach to solving the buffer overflow problem, the compiler inserts a canary value on the memory location before the retum address in the stack. The canary value is randomly generated. When there is a return from the function call, the compiler checks if the canary value has been overwritten or not. Do you think this approach would work? Why or why not?arrow_forwardLanguage : c++ Question: Create a single link list of 8 nodes and exchange the addresses of even nodes with the odd nodes. An even nodes are the one which come at even place in the single link list like 2, 4, 6… And for the odd nodes which come at the odd place in the single link list like 1, 3, 5, 7…. An illustration is given belowarrow_forward
- Someone tries to fix the stack based buffer overflow problem as follows, is it secure now? why? Are there any other issues within the function's implementation below? Explain your reasoning. int bof(char *str, int size) { char *buffer = (char *) malloc(size); strcpy(buffer, str); return 1; }arrow_forwardQuestion 1 (a) What is fragmentation? Briefly explain what it is and how we address it. (b) Explain the role of the stack and the heap, using an example of call- ing a function that then allocates memory for 100 integers to a local pointer variable. You may use a diagram if you wish.arrow_forward5(b) Give the two arrays that will be merged by the final step of mergesort on [8, 2, 1, 4, 5, 3, 7, 9].arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education