Search This Blog

Translate

Blog Archive

Middleboro Review 2

NEW CONTENT MOVED TO MIDDLEBORO REVIEW 2

Toyota

Since the Dilly, Dally, Delay & Stall Law Firms are adding their billable hours, the Toyota U.S.A. and Route 44 Toyota posts have been separated here:

Route 44 Toyota Sold Me A Lemon



Showing posts with label Spaghetti Code. Show all posts
Showing posts with label Spaghetti Code. Show all posts

Tuesday, November 22, 2016

Embedded Software Security, Safety & Quality Preview



The vehicle you drive is filled with SOFTWARE! 

Prof. Philip Koopman offers great information to understand the surrounding issues and complexities. 






Embedded Software Security, Safety & Quality Preview
Monday, November 21, 2016
Here's a summary video on Embedded Software Security,
Safety & Quality.
https://betterembsw.blogspot.com/2016/11/embedded-software-security-safety.html
(with 3:20 min preview video)  (There are seconds of blank screen within it)
--------------------------------------------------------------------------
EDGE CASE
RESEARCH
MAKE ROBUST SOFTWARE
TRAINING SERVICES
https://www.edge-case-research.com/training
--------------------------------------------------------------------------
EDGE CASE
RESEARCH
MAKE ROBUST SOFTWARE
SOFTWARE QUALITY LIBRARY
FULL TUTORIALS
info@edge-case-research.com
https://www.edge-case-research.com/full-tutorial-videos
------------------------
Currently posted:
Tutorial:
Peer Reviews
(19:50 min video)
------------------------
Tutorial:
Security Plans
(30:33 min video)
------------------------
Tutorial:
Avoiding
Spaghetti Code
(14:42 min video)
--------------------------------------------------------------------------

Friday, September 25, 2015

After Volkswagen Pollution Scandal, Can You Trust Your Technology


Dr. Michael Barr described TOYOTA's software as 'SPAGHETTI.' 

The VW Scandal is just the beginning of the unraveling of the FAILURES of Auto Makers to protect consumers. 

Republicans have underfunded government agencies that can no longer protect Americans and address the technology. 

The programs below are worth listening to. This is why NPR is a valuable resource worthy of your support. 


After Volkswagen Pollution Scandal, Can You Trust Your Technology?








The U.S. EPA said stealth software made VW’s 2009-2015 model cars powered by 2.0-liter diesel engines run cleaner in tests than in actual driving. (Jens Meyer/AP)

If you own a Volkswagen diesel, bad news: the German auto giant has been cheating. Researchers at West Virginia University discovered that VW has been equipping millions of its diesel models with software to make the cars pollute less during emissions testing. But on the road, they pollute a whole lot more, in violation of U.S. environmental laws. So, how do we know our computers are telling the whole truth?

Guests

Hiawatha Bray, technology writer for the business section of The Boston Globe. He’s also author of the new book, “You Are Here: From the Compass to GPS, the History and Future of How We Find Ourselves.” He tweets @GlobeTechLab.



Ray Magliozzi, co-host of NPR’s Car Talk, which tweets @cartalk.


The Boston Globe: When German Engineering Is Digital Deception

  • “It’s also a warning to everybody who’s ever assumed that the stuff on your computer screen is the gospel truth. Our digital devices can easily be used to manipulate, mislead or flat-out lie to us. Humans have always lied to each other, and always will. But we’re used to sniffing out the crude analog deceptions of our fellow man. When computers skew reality, it can be done with such subtlety, we may never realize we’re being played.”


Mother Jones: The VW Scandal Is Just the Beginning

  • “VW used software to put a new spin on an old scam. Wherever there is a test, someone will try to cheat on it. The EPA has banned emissions test “defeat devices” for decades. In 1995, it fined GM $11 million for turning off carbon monoxide controls when the air conditioning was on. Some observers have defended GM, arguing that carbon monoxide pollution is primarily an issue in the winter. But the larger principle—truth in testing—is important.”


NPR: Volkswagen ‘Dieselgate’ Fallout: Germany Tests Cars; Report Sends BMW Shares Down

  • “That test was carried out by the International Council on Clean Transportation, which found that the BMW model performed worse than a VW Passat TDI — one of the cars included in the Environmental Protection Agency’s call for a recall. ‘All measured data suggest that this is not a VW-specific issue,’ Peter Mock, the group’s Europe managing director, tells Auto Bild.”



How A Little Lab In West Virginia Caught 

Volkswagen's Big Cheat



SEPTEMBER 24, 2015


Diesel car engines like this one in a 2012 Volkswagen Golf are among those that include software that circumvents EPA emissions standards for certain air pollutants.
Diesel car engines like this one in a 2012 Volkswagen Golf are among those that include software that circumvents
EPA emissions standards for certain air pollutants.


Patrick Pleul/DPA/Landov

Volkswagen was recently brought to its knees when scientists discovered the company had installed a device in its diesel-powered cars to fool emissions tests. Its stock price tanked, its reputation has been damaged and its CEO resigned on Wednesday.

So who made the discovery that sent the German car giant into a tailspin? A group of scientists at West Virginia University.

WVU research assistant professor Arvind Thiruvengadam and his colleagues test and experiment on cars and engines. He admits his is not the sexiest lab on campus, but he says he got superexcited when they won a grant in 2012 to test a few diesel cars.

"Our happiness was, 'Wow, we are going to be the first guys to test diesel cars on the road,' " he says. "And then after that, when we were getting the data we were like 'OK, we're going to write a lot of journal papers, and we'll be happy if three people read these journal papers.' That's our happiness at that point."

The International Council on Clean Transportation is a nonprofit that tries to provide independent science to government agencies that regulate the environment. It hired the university to do a standard emissions tests on diesel cars in the U.S. Volkswagen has been hyping diesel cars that are environmentally friendly and fuel efficient. Volkswagen had the boldest claims and the highest sales but Thiruvengadam tested two VW cars and found that the claims of low emissions never panned out in the real world.

"We were never seeing those low emissions during most part of our drives on the interstate. That part of the emissions program was interesting," he says.

In none of their road tests could they get their two Volkswagen cars to meet the claims, even though a BMW they tested did fine. Very early on it was pretty clear to the scientists that something was wrong.

He says the team kept double-checking its procedures. "And then, I mean, we did so much testing that we couldn't repeatedly be doing the same mistake again and again," he says.

"It's the sort of thing you just don't go around accusing companies of doing unless you're absolutely sure," says John German, with the International Council on Clean Transportation — the group that commissioned the test. German immediately suspected Volkswagen had done something not completely unheard of in the car business: install what's called a defeat device.

"The quick definition is something that tells the computer when you're on the official test cycle and when you're not. And when you're not, you change how the emission control system works," he says.

German says the deceit doesn't just stop with a programmer writing code.

"It's both writing the code, but you also need to do validation. So someone had to take these vehicles out, test them on the standard test cycle, make sure that the emission controls are supposed to be working when they're supposed to be working," he says.

German's group turned its data over to the Environmental Protection Agency and the California Air Resources Board. He says things like this start with one little lie or cheat at a time.

"You take a little step, you don't get caught. So yeah, you take another little step," he says. "And then maybe you don't even realize how far over the line you are."

So does he feel vindicated?

"I think vindicated is the wrong word. I feel satisfaction that we have contributed to something that will have a major impact on public health," he says. "But vindication implies that we are out to get somebody. And we weren't. We had no idea that this was out there."

The question now for investigators and prosecutors from Korea to Germany to the U.S. is how many people at Volkswagen knew and how far up that knowledge went.



http://www.npr.org/2015/09/24/443053672/how-a-little-lab-in-west-virginia-caught-volkswagens-big-cheat




Thursday, June 4, 2015

The heart of your Toyota has code so bad its embarrassing, and potentially life threatening





The heart of your Toyota has code so bad its embarrassing, and potentially life threatening

You would imagine that the code that runs your car, and controls all the safety functions would be meticulous. After all lives, money and reputations depend on it. Not so say NASA programmers who examined the code in a 2002 Toyota Camry. Its awful. Think of that when you are commuting to work next. For example a global variable is any piece of software anywhere in the system can get to that number and read it or write it.) The academic standard is zero. Toyota had more than 10,000 global variables.

Michael Barr, a well-respected embedded software specialist, spent more than 20 months reviewing Toyota’s source code at one of five cubicles in a hotel-sized room, supervised by security guards, who ensured that entrants brought no paper in or out, and wore no belts or watches.

Barr testified about the specifics of Toyota’s source code, based on his 800-page report. Phillip Koopman, a Carnegie Mellon University professor in computer engineering, a safety critical embedded systems specialist, authored a textbook, Better Embedded System Software, and performs private industry embedded software design reviews – including in the automotive industry – testified about Toyota’s engineering safety process. Both used a programmer’s derisive term for what they saw: spaghetti code – badly written and badly structured source code.

Barr testified:

... Quote:
There are a large number of functions that are overly complex. By the standard industry metrics some of them are untestable, meaning that it is so complicated a recipe that there is no way to develop a reliable test suite or test methodology to test all the possible things that can happen in it.

Some of them are even so complex that they are what is called unmaintainable, which means that if you go in to fix a bug or to make a change, you're likely to create a new bug in the process. Just because your car has the latest version of the firmware -- that is what we call embedded software --doesn't mean it is safer necessarily than the older one….

And that conclusion is that the failsafes are inadequate. The failsafes that they have contain defects or gaps. But on the whole, the safety architecture is a house of cards. It is possible for a large percentage of the failsafes to be disabled at the same time that the throttle control is lost.


Even a Toyota programmer described the engine control application as “spaghetti-like” in an October 2007 document Barr read into his testimony.

Koopman was highly critical of Toyota’s computer engineering process. The accepted, albeit voluntary, industry coding standards were first set by Motor Industry Software Reliability Association (MISRA) in 1995. Accompanying these rules is an industry metric, which equates broken rules with the introduction of a number of software bugs: For every 30 rule violations, you can expect on average three minor bugs and one major bug. Toyota made a critical mistake in declining to follow those standards, he said.

When NASA software engineers evaluated parts of Toyota’s source code during their NHTSA contracted review in 2010, they checked 35 of the MISRA-C rules against the parts of the Toyota source to which they had access and found 7,134 violations. Barr checked the source code against MISRA’s 2004 edition and found 81,514 violations.

Toyota substituted its own process, which had little overlap with the industry standard. Even so, Toyota’s programmers often broke their own rules. And they failed to keep adequate track of their departures from those rules – and the justification for doing so, which is also standard practice. Koopman testified that if safety is not baked into the recipe in the process of creating the product, it cannot be added later.
... Quote:
You have to exercise great care when you're doing safety critical software. You can't just wing it. And Toyota exercised some care, but they did not reach the level of accepted practice in how you need to design safety critical systems,” he said.

One of the biggest safety standards Toyota broke was allowing single point failures within its system. (Single point failure refers to a piece of hardware or software that has complete control over whether a system is safe or not—such as a single-engine airplane.) Koopman testified:
... Quote:
If there is a single point of failure, by every safety standard I have ever seen, it is by definition unsafe, and no amount of countermeasures, no amount of failsafes will fix that. They will reduce how often it happens, but it won't completely fix it. Because we have millions of vehicles out there, it will find a way to fail that you didn't think of, and it will fail.


Other egregious deviations from standard practice were the number of global variables in the system. (A variable is a location in memory that has a number in it. A global variable is any piece of software anywhere in the system can get to that number and read it or write it.)

The academic standard is zero. Toyota had more than 10,000 global variables.
... Quote:
And in practice, five, ten, okay, fine. 10,000, no, we're done. It is not safe, and I don't need to see all 10,000 global variables to know that that is a problem,” Koopman testified.


Other important design process errors Barr and Koopman identified were an absence of a peer code review, and Toyota’s failure to check the source code of its second CPU, supplied by Denso —even as executives assured Congress and NHTSA that the cause of UA couldn’t be in the engine software.

Barr testified to some of the vehicle behavior malfunctions caused by the death of tasks within the CPU, and concluded that Bookout’s UA was more likely than not caused by the death of a redacted-name task, called Task X at trial. Barr dubbed it “the kitchen-sink” task, because it controlled a lot of the vehicle’s functions, including throttle control; the cruise control – turning it on, maintain the speed and turning it off – and many of the failsafes on the main CPU.

He was critical of Toyota watchdog supervisor – software to detect the death of a task -- design. He testified that Toyota’s watchdog supervisor “is incapable of ever detecting the death of a major task. That's its whole job. It doesn't do it. It's not designed to do it.”

Instead, Toyota designed it to monitor CPU overload, and, Barr testified: “it doesn't even do that right. CPU overload is when there's too much work in a burst, a period of time to do all the tasks. If that happens for too long, the car can become dangerous because tasks not getting to use the CPU is like temporarily tasks dying.”

Barr also testified that Toyota’s software threw away error codes from the operating system, ignoring codes identifying a problem with a task. At trial, Barr said:

And task death, although I focused a lot of task X here, because it does so much and it does throttle control and it does failsafe, it's pretty important, but there is [redacted] tasks and they can die in different combinations. It could be task 3 and task X, or task 3and task 7 and task X, or just task 9. And those can cause an unpredictable range of vehicle misbehaviors. It turns out that unintended acceleration is just the most dangerous thing your car can do when it malfunctions.

Even if you were to dismiss their conclusions as nothing but paid-for expert testimony, Koopman and Barr’s assessment about software errors as a possible UA root cause go a long way in explaining so much: how Toyota’s system could fail and leave no trace; why we are still seeing UAs in late model Toyota vehicles and why Toyota can’t seem to fix it with floor mat and pedal recalls; how it could get away with hiding some of the root causes of UA events for so long.

Their descriptions of the incredible complexity of Toyota’s software also explain why NHTSA has reacted the way it has and why NASA never found a flaw it could connect to a Toyota’s engine going to a wide open throttle, ignoring the driver’s commands to stop and not set a diagnostic trouble code. For one, Barr testified, the NASA engineers were time limited, and did not have access to all of the source code. They relied on Toyota’s representations– and in some cases, Toyota misled NASA. For example, NASA was under the false belief that Toyota had designed in hardware bit flip protections called Error Detection and Correction Codes, (EDAC). The 2005 Camry for example did not have EDAC, Barr testified, but in an email Toyota told NASA that it did. At trial he said:

NASA didn't know that that wasn't there. It wasn't there in the 2005 Camry. And so if the bit-flip occurred, there would be no hardware mechanism to find it. And if it occurred in a critical value that was not mirrored, there would be no software protections against it. So the conclusion here is that there are critical variables in which bits could flip.

Their testimony explains why it would be near impossible for NHTSA to ever pin an electronic failure on a problem buried in software. NHTSA didn’t even have any software engineers on ODI’s staff during the myriad Toyota UA investigations. They have no real expertise on the complexities that actually underpin all of the safety-critical vehicle functions of today’s cars. It’s as if ODI engineers are investigating with an abacus, a chisel and a stone tablet. One begins to understand the agency’s stubborn doubling, tripling, quadrupaling down on floor mats and old ladies as explanations for UA events.

But even if NHTSA did have this expertise, the software piece is so complex ODI would never have the time or budget to assess an automaker’s source code. This is why we keep harping on the need for NHTSA to write a functional safety regulation – under its own steam or Congressional mandate.

We are posting preliminary drafts of Koopman’s (part 1 and part 2) and Barr's trial testimony, along with Barr's slides – long, but well worth a read for anyone interested in understanding more about embedded software systems in automobiles and how not to design one; where NHTSA went wrong: and the unbelievably shaky software at the foundation of Toyota’s electronic architecture.

Normally, one associates a company’s desire to shield trade secrets with the protection of something valuable. That something, one presumes, is the technology itself -- the secret recipe a company uses in making its product. Rather than protecting the automotive equivalent of formula for Coke, the testimony of Koopman and Barr suggest that Toyota really wanted to hide was its formula for disaster. Consider the contents of a September 2007 email among Toyota employees:

... Quote:
In truth technology such as failsafe is not part of the Toyota's engineering division's DNA,’ ” Barr read in court. “And it continues, ‘But isn't it good that it is recognized as one of the major strengths of Toyota and its system controls industry.’ And then I highlighted also the portion that says, ‘Continuing on as is would not be a good thing.’”


Read more about it here http://www.safetyresearch.n...
By netchicken: posted on 3-6-2015



http://xmb.stuffucanuse.com/xmb/viewthread.php?tid=8805