UNIX C Library Robustness Exercise, Assignments of Computer Science

A homework assignment for a university course focused on robust programming. Students are required to write three programs that use functions from the standard unix c library to cause crashes or generate unpredictable results. The assignment includes instructions on how to demonstrate these issues using gdb and running the programs on different types of computers.

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-ezl
koofers-user-ezl 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
September 30, 1999 ECS 153 — FALL 1999 Page 1
Version of September 30, 1999 12:59 pm
Homework 1
Points
: 100
Due Date
: Monday, October 11, 1999 at 11:59PM
1. (
7 points
) Chapter 1, exercise 1
2. (
14 points
) Chapter 1, exercise 2
3. (
5 points
) Chapter 1, exercise 3
4. (
12 points
) Chapter 1, exercise 5
5. (
6 points
) Chapter 1, exercise 7
6. (
6 points
) Chapter 1, exercise 13
7. (
6 points
) Chapter 1, exercise 14
8. (
9 points
) Robust Programming handout, exercise 2
9. (
5 points
) Robust Programming handout, exercise 17
10. (
30 points
)
This exercise asks you to look at a standard UNIX C library for problems with robustness. Please
write three programs that use functions from the standard I/O library. You are to call the functions in such a way
that they cause the program to crash, or generate unpredictable results. To demonstrate “crashing,” use
gdb
out-
put to show that the crash occured within the standard I/O library function. To demonstrate “unpredictable
results,” run your program (without changes) on at least two different types of computers in the CSIF (for exam-
ple, once on a DEC and once on an SGI) and show that the results of the function differ (you can use
gdb
, or print
the relevant values).
Important note:you must supply the correct type of argument for the functions. You may
not, for example, pass a character pointer where a file pointer is expected.
Please submit both the programs and typescripts for each program showing the crash or the unpredictable results.

Partial preview of the text

Download UNIX C Library Robustness Exercise and more Assignments Computer Science in PDF only on Docsity!

September 30, 1999 E C S 1 5 3 — F A L L 1 9 9 9 Page 1

Version of September 30, 1999 12:59 pm

Homework 1

Points : 100 Due Date : Monday, October 11, 1999 at 11:59PM

  1. ( 7 points ) Chapter 1, exercise 1
  2. ( 14 points ) Chapter 1, exercise 2
  3. ( 5 points ) Chapter 1, exercise 3
  4. ( 12 points ) Chapter 1, exercise 5
  5. ( 6 points ) Chapter 1, exercise 7
  6. ( 6 points ) Chapter 1, exercise 13
  7. ( 6 points ) Chapter 1, exercise 14
  8. ( 9 points ) Robust Programming handout, exercise 2
  9. ( 5 points ) Robust Programming handout, exercise 17
  10. ( 30 points ) This exercise asks you to look at a standard UNIX C library for problems with robustness. Please write three programs that use functions from the standard I/O library. You are to call the functions in such a way that they cause the program to crash, or generate unpredictable results. To demonstrate “crashing,” use gdb out- put to show that the crash occured within the standard I/O library function. To demonstrate “unpredictable results,” run your program (without changes) on at least two different types of computers in the CSIF (for exam- ple, once on a DEC and once on an SGI) and show that the results of the function differ (you can use gdb , or print the relevant values). Important note:you must supply the correct type of argument for the functions. You may not, for example, pass a character pointer where a file pointer is expected. Please submit both the programs and typescripts for each program showing the crash or the unpredictable results.