Skip to content

Commit f09ac55

Browse files
authored
Merge pull request #2 from pcudd33/pcudd33-patch-2
The finalized version of Day2Notes. All naming conventions are followed and all information from the lecture notes was added with detail.
2 parents ee1db62 + da586b9 commit f09ac55

File tree

1 file changed

+167
-0
lines changed

1 file changed

+167
-0
lines changed

Day2Notes

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# **Lecture 2**
2+
3+
## Class presentations
4+
5+
### Problems caused by issues in software
6+
#### Northeast Blackout of 3003
7+
- There was a software bug called the “Race Condition”, that once triggered stalled FirstEnergy’s control room alarm system for over an hour. System operators were unaware of the malfunction
8+
- Loss of water pressure led to water contamination. So, 4 million people were under boil water advisory until August 18th. 4 Days after the power outage.
9+
- Power outage along the eat coast. 55 Million people were affected during this and 100 people died.
10+
- “A race condition occurs when two threads access a shared variable at the same time...” – Microsoft. “in some homes, there are multiple light switches connected to a common ceiling light. When these types of circuits are used, moving either switch from its current position turns the light off.” – tech target
11+
12+
#### Aviation – 737 MAX
13+
- ##### Software MCAS – maneuvering characteristics augmentation system
14+
o Built to enhance pitch stability of 737 MAX so that it would work like older models (newer models had bigger engines which pushed nose up)
15+
o Meant to make it easier to train flight crews on newer models
16+
o Flight crews not well trained on use
17+
- ##### Issue Caused by false AOA inputs to 1 sensor which triggered MCAS (tipped nose down during takeoff and kept malfunctioning as crew tried to correct nosedive because they could not override the software).
18+
o AOA – angle of attack (angle between wing and airflow on the wing)
19+
o 2 crashes, 346 people died
20+
- ##### Changes MCAS software has been modified to use 2 sensors instead of 1 (in case one fails), and flight crew can now completely override the software.
21+
o Pilots now go through training on managing MCAS and problems that might arise
22+
23+
#### ETCS software malfunction
24+
- During the trial embedded systems expert who reviewed Toyota’s electronic throttle source code testified that they found Toyota’s source code defective, and that it contains bugs – including bugs that can cause unintended acceleration.
25+
- “we’ve demonstrated bow as little as a single bit flip can cause the driver to lose control of the engine speed in real cars due to software malfunction that is not reliably detected by any fail-safe.” Michael Barr, CTO, and co-founder of Barr Group told us in an exclusive interview. Barr served as an expert witness in this case.
26+
27+
#### Ariane 5 flight 501
28+
- Problem came from reused code from the inertial reference platform (IRS) on the Ariane 4
29+
- Ariane 5’s flight path caused certain values, specifically the horizontal bias variable to be much higher than the code was meant to handle.
30+
- Greater values of horizontal bias data were converted from 64-bit floats to 16-bit int values causing an overflow, meaning the numbers were too large to represent with just 16 bits.
31+
- Only 4 of the 7 variables used were protected from overflow, designed only to handle the assumptions about the Ariane 4 flight path.
32+
- The overflow halted the IRS modules, and the one active module send a diagnostic bit patter to the on-board computer, bit it was interpreted as flight data.
33+
- This caused the rocket to bank to an angle of more than 20 degrees, causing it to rip apart and then self-destruct.
34+
- Supplier of the nav software was told to stop the processor when an exception occurred, so the exception which occurred was due to a flaw in the design, causing the shutdown of two good units when they could have still provided best estimates of the required info.
35+
o Simulations should have been completed prior to launch
36+
o Identify all previous assumptions and make sure they are still valid
37+
o Ranges of variables should have been explicitly quantified instead of just assuming a range, in this case a 16-bit range
38+
- The failure brough to light the risk with complex computation and increased the support for research on ensuring the reliability of safety critical systems.
39+
40+
#### Patriot Missile defense system error
41+
- ##### What happened
42+
o Failed to intercept an incoming missile.
43+
o The incoming missile hit a United States Army Barracks in Dhahran, Saudi Arabia during the Gulf war.
44+
- ##### How was SW involved
45+
o Source Code Reviews after incident revealed errors.
46+
o Software calculated the position of the incoming missile.
47+
o Failure due to rounding error over 100 hours.
48+
- ##### Why so Bad
49+
o 28 Americans killed, over 100 injured.
50+
o This flaw exists in ALL Patriot missile Defense Systems.
51+
o Purely software, completely preventable.
52+
- ##### Implications
53+
o Now this type of software undergoes endurance tests (what happens if we run this code for a long time).
54+
55+
56+
57+
58+
## Class Notes
59+
60+
### Using a computer
61+
62+
#### Graphical User Interface
63+
- GUIs are convenient, but slow.
64+
65+
#### Command line access
66+
- gives us access to run tools “under the hood”.
67+
- can increase productivity by learning these command line tools.
68+
69+
#### Linux based OS
70+
- Windows makes up 75% of all desktop/laptop operating systems
71+
- MacOS makes up 15% of all desktop/laptop operating systems
72+
- We will focus on a Linux-based OS for learning a set of tools
73+
- Linux is the dominant OS
74+
75+
#### Sshing and other definitions
76+
- We will use virtual servers running Linux for this class
77+
78+
#### Definition
79+
**Shell** is a program that exposes an OS’s services to a human user or other programs
80+
- textual interface (terminal, git-bash, PowerShell)
81+
#### Definition
82+
**Secure Shell** remote access to a shell on another computer
83+
84+
###### how to ssh
85+
- the xx is each student’s unique number
86+
- cslinuxlab-xx.stlawu.local
87+
88+
#### Using terminal on the secure shell
89+
90+
###### Logging into Linux labs
91+
- ssh {full email address}@cslinuxlab-xx.stlawu.local
92+
- type yes
93+
- enter your St. Lawrence password
94+
- Control d to exit Linux labs
95+
96+
###### Creating password
97+
- ‘ssh-keygen -o’ Generating public/private rsa key pair
98+
- hit enter
99+
- chose passphrase
100+
- type It again
101+
- Your certificate is created
102+
103+
###### Using a certificate
104+
- ‘ssh-copy-id’ {full email address}@cslinuxlab-xx.stlawu.local
105+
- this is how you get your public key onto the other machine
106+
107+
- Enter your passphrase
108+
- Now your certificate is on the Linux lab machine
109+
110+
#### Basic bash commands
111+
- ‘pwd’ (present working directory)
112+
- ‘ls’ (list all files/directories/etc.)
113+
- ‘cd’ (change directory)
114+
- ‘cd .’ (stay in that level)
115+
- ‘cd ..’ (takes you up one level)
116+
- ‘cd /../../..’ (can give a path)
117+
- ‘clear’ (clears the screen without deleting)
118+
- ‘mkdir’ <directory name> (makes directories)
119+
- ‘which’ <program> (tells you where program lives on machine/if it has it)
120+
- ‘curl’ -O -k <URL> (download files/ignores certificates/with the same name)
121+
- ‘man’ <program> (brings you to manual page)
122+
- ‘less’ <filename> (new version of more/lets you view file)
123+
- ‘tar’ xzf <filename> (extract a file in gzip format)
124+
- ‘find’ (will show every file in that level of directory)
125+
126+
#### Directory structure Linux
127+
- Starts with a leading / (can cd to /)
128+
- Bin is below / (binary – executables live here)
129+
- Lib is below / (library – support files)
130+
- Home is below /
131+
- Below home is our account where we can make files and directories
132+
133+
#### Setting up CS340 directory
134+
- Use mkdir CS340 in your Linux lab directory
135+
- Enter CS340
136+
##### Scraping from the internet
137+
o Use curl and a URL to download random.tar.gz
138+
139+
#### How to use less and the man pages
140+
- Options are the flags that we use with commands to make them do things
141+
- / allows you to type and hit enter to search
142+
- Man gets you to the manual
143+
- Less allows you to view files
144+
- Get out of less with q
145+
146+
147+
148+
#### How to use for loops in bash
149+
###### Example 1
150+
```
151+
for I in {0..100}
152+
do
153+
echo $i
154+
done
155+
```
156+
###### Example 2
157+
Stepping through by 2’s
158+
```
159+
for I in {0..100..2}
160+
do
161+
echo $i
162+
done
163+
```
164+
165+
166+
167+

0 commit comments

Comments
 (0)