Debugging Flashcards

1
Q

Bug

A
  • is not any error
  • failure, fault, error
  • infinite loop(failure)
  • deadlock (failure)
  • incorrect output (failure)
  • memory leaks (failure)
  • runtime exception
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Segmentation Fault

A

-program try’s to access memory that is not available (outside accessible range)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Bus fault

A

-program tried to access misaligned data item

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Illegal instruction

A

-try to execute an unassigned or privileged opcode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Bug classification

A
  • A : algorithm ~ code follows the infect of the programmer but intent was wrong
  • D : data ~ code reads/writes incorrect data or accessed a wrong storage location
  • F : Forgotten ~ a missing action/statement or maybe put in wrong place
  • B : Blunder ~ algorithm was correct but it was implemented wrong
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Blunder

A
  • variable (wrong var name)
  • expression (incorrect written expression)
  • language (mistake encouraged by language syntax)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Whose bug

A

Goes away when try to observe it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Bug detection

A

1: study the failure systems, add exception handler
2: read and re-read in error location, have someone else read code, or someone who will listen
3: experiment to find the simplest way to identify
4: try inserting, verifying of the code is working as it should

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Crash dumps

A

Debugger helps discover where program crashed and why, inspect call stack, and values of vars

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Static tools

A

Crash dump inspection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Dynamic tools

A

Debugger

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Debugger monitoring facilities

A
  • breakpoint: break main
  • single step execution: step over line you don’t want to go through
  • inspect vars: use where or print vars
  • display source code: list main
  • fault detection: throws exception
  • watchpoints: watch when var changes
  • multithread/ multiprocess support: monitor execution of threads
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Failure

A

Something visible to the programs user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Fault

A

The state of the program which leads to a failure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Error

A

The incorrect code fragment which leads to the fault and thus to the failure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly