Author Topic: Average car contains 100 million lines of code, The State of Autosoftware  (Read 8102 times)

0 Members and 3 Guests are viewing this topic.

Offline MTTopic starter

  • Super Contributor
  • ***
  • Posts: 1671
  • Country: aq
Well, a 2015 study showed that 74% of the cost of a car was electronics.
 
The following users thanked this post: bigfoot22

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15215
  • Country: fr
What could go wrong? ;D
 

Offline MTTopic starter

  • Super Contributor
  • ***
  • Posts: 1671
  • Country: aq
Deliberately wrong, like BMW color changing car at 1:15. sorta neat but i would not pay for it. :)

 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15215
  • Country: fr
Don't worry, you probably don't have the cash to anyway. :-DD
 

Offline MTTopic starter

  • Super Contributor
  • ***
  • Posts: 1671
  • Country: aq
Cash? you mean CBDC's!  :)   Anyho, i dont want a BMW, to much plastic crap inside the engine im told by car techs.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15215
  • Country: fr
Cash? you mean CBDC's!  :) 

Ah yes, sorry. Still having a hard time with central banks working on shoving that crap up our asses.

Anyho, i dont want a BMW, to much plastic crap inside the engine im told by car techs.

Well, BMW used to know how to make engines.
 

Offline MrMobodies

  • Super Contributor
  • ***
  • Posts: 1941
  • Country: gb
Reminds me of Toyota and the unintended vehicle acceleration.

https://www.edn.com/toyotas-killer-firmware-bad-design-and-its-consequences/
Quote
Toyota’s killer firmware: Bad design and its consequences
OCTOBER 28, 2013 BY MICHAEL DUNN

On Thursday October 24, 2013, an Oklahoma court ruled against Toyota in a case of unintended acceleration that lead to the death of one the occupants. Central to the trial was the Engine Control Module’s (ECM) firmware.

Embedded software used to be low-level code we’d bang together using C or assembler. These days, even a relatively straightforward, albeit critical, task like throttle control is likely to use a sophisticated RTOS and tens of thousands of lines of code. 
...
The Camry ETCS code was found to have 11,000 global variables. Barr described the code as “spaghetti.” Using the Cyclomatic Complexity metric, 67 functions were rated untestable (meaning they scored more than 50). The throttle angle function scored more than 100 (unmaintainable).

Talking of which I noticed some progress on triggering the fault on Wikipedia:
https://en.wikipedia.org/wiki/Sudden_unintended_acceleration
Quote
In January 2021, engineer Colin O'Flynn was able to induce unintended acceleration with a similar Toyota vehicle using electromagnetic fault injection (EMFI) on a test bench. He used an ECU and components from a wrecked 2005 Toyota Corolla. O'Flynn's experiments were conducted without access to the ECU source code, and without access to the confidential report by the Barr Group.[7]
 

Offline ve1nhb

  • Newbie
  • Posts: 5
  • Country: ca
You have never taken a Cobol programming course.  Million lines of code that is easy.
Nelson from the far eastern Island of Cape Breton.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7408
  • Country: ca
Toyota still has garbage firmware in their cars. One acquaintance had her RAV throttle runaway and once my vehicle took off in reverse while backing up. That will wake a person up.
They haven't fixed the problems it seems. Their transmission control TCM is also a buggy piece of shit, constantly making bad learns on shift patterns and I have to disconnect the battery to erase them. It's like they have kids writing their software. I like the factory service bulletin about the airbags mysteriously deploying for no reason "uh let Mr. Toyota know it happened"  :palm:

Modern ECU's have a lot of code dedicated to actually modelling many of the systems, this is the only way to get precise fuel metering to meet emissions. Model-based control is the norm.
Mathematical models of the catalytic converter (temperature), O2 sensor, valve temperature, EGR flow etc are all in the firmware nowadays. It's very sophisticated and takes up code space.
 
The following users thanked this post: MrMobodies

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15215
  • Country: fr
Modern ECU's have a lot of code dedicated to actually modelling many of the systems, this is the only way to get precise fuel metering to meet emissions. Model-based control is the norm.
Mathematical models of the catalytic converter (temperature), O2 sensor, valve temperature, EGR flow etc are all in the firmware nowadays. It's very sophisticated and takes up code space.

Definitely. This complexity makes it all the more likely to have faults.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #10 on: January 25, 2023, 06:26:30 am »
And it is only getting worse.

The infotainment systems in cars are increasingly becoming thrown together crap. Pretty common these days that the infotainment system bugs out and you need to fiddle with it to get it back working. In some instances i found i actually needed to park and turn the car off in order to restart it and get it working again.

On top of that they are implementing features in unsesible backwards ways. For example my Volvo from 2016 has a dedicated heated seats button that cycles an icon on the screen trough 3 heat levels. The button works even before the infotainment is even booted (so it is only there for display) and it remembers the last setting after the car is turned off. In fact it is so smart that if you leave it on a heat level of 1, the next time you get into a cold car it applies heat level 3 for a minute or two to get it up to temp quickly before going back down to the heat level of 1 and staying there. Nicely implemented feature that works like magic without having to think about it, just set and forget.

Move forwards to the 2021 model year Volvos. In comes the giant touchscreen and no buttons. Lets see how they implemented heated seats after all this technological progress. First of all there is no actual button for heated seats, you press the heated seat icon on it. Nothing wrong with that (you can only have so many hardware buttons anyway), however the implementation... ho boy. First of all the setting is no longer remembered, heated seats are off every time you start the car. Then if you want heating setting 1 right off the bat you have to press 3 times to get level 3 then level 2 then level 1 (also normal way of doing it), however if you press too quickly it will miss presses, registering only 2 of the 3 presses. Then if you have a heated steering wheel that heated seat button actually opens up a tiny menu where you press the seat icon for seats and then another icon for the steering wheel. Making it a total of like 3 to 7 presses on a touchscreen to set it up every time you start the car. This is just one example of many features that are implemented completely wrong.

Sometimes i feel like the software developers who create these infotainment systems have never owned a car.
 
The following users thanked this post: RJSV

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4283
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #11 on: January 25, 2023, 07:39:54 am »
A lot of developers and managers think it is just like with money. The more you have of it the better it is.

But they do forget about test ability and readability. In most of these cases the statement less is more is certainly true.

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12496
  • Country: ch
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #12 on: January 25, 2023, 07:47:03 am »
A lot of developers and managers think it is just like with money. The more you have of it the better it is.

But they do forget about test ability and readability. In most of these cases the statement less is more is certainly true.
Maybe I’m too charitable, but I think most developers do care about those things, but with the time pressure they’re usually on, those things get neglected. And I don’t think most workplaces really actively encourage good coding practices. They’ve either jumped on the “agile” bandwagon (lowercase in quotes “agile”, i.e. sloppy free for all, not actual Agile), or they simply prioritize “finish it yesterday!” over disciplined methodology.

In contrast, I think a great many managers don’t understand the value in disciplined software development methodologies and practices. They see the time cost of doing them, and don’t appreciate the risks they take on with rushed coding.
 

Offline MrMobodies

  • Super Contributor
  • ***
  • Posts: 1941
  • Country: gb
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #13 on: January 25, 2023, 07:52:52 am »
Toyota still has garbage firmware in their cars. One acquaintance had her RAV throttle runaway and once my vehicle took off in reverse while backing up. That will wake a person up.
They haven't fixed the problems it seems. Their transmission control TCM is also a buggy piece of shit, constantly making bad learns on shift patterns and I have to disconnect the battery to erase them. It's like they have kids writing their software. I like the factory service bulletin about the airbags mysteriously deploying for no reason "uh let Mr. Toyota know it happened"  :palm:

I read many stories and the saddest one I remember reading was this young Chinese man who had a 1996 Corolla (not thought to be linked to the sudden acceleration of the other Toyota at the time) but it one day got out of control and and killed some people. I think he protested but they jailed him and when it proven it wasn't his fault the prosecutors still wanted him to admit fault or something like that in a deal he turned down.

Found it but not what I thought:
https://www.thegilbertlawgroup.com/blog/2015/january/man-sent-to-prison-over-toyota-sudden-accelerati/
Quote
Toyota Driver Freed From Prison, Prosecutor Drops Charges
Koua Fong Lee, who was in prison for vehicular homicide, is a free man.


By ANGELA M. HILL and SUSANNA SONG June 29, 2010, 11:28 PM

Aug. 05, 2010 — -- Koua Fong Lee, the Minnesota man jailed when his 1996 Toyota Camry sped out of control and killed three people, has won his freedom. After a judge ordered him freed pending a new trial, prosecutors announced they would not try Lee again for vehicular homicide. Following a four-day hearing, Judge Joanne Smith had ruled Thursday afternoon there was enough evidence to grant a new trial to Lee, who had been serving an eight-year sentence. She ordered him freed pending trial.

Lee was convicted of criminal vehicular homicide for a 2006 crash in which his Camry crashed into an Oldsmobile, killing driver Javis Adams, his 10-year-old son and injuring Adams' seven-year-old niece Devyn Bolton, who later died of her injuries. Lee granted an exclusive prison interview to ABC News in February, and at that time told Chief Investigative Correspondent Brian Ross that he pressed the Camry's brakes repeatedly but the car would not stop.

According to ABC affiliate KSTP, Ramsey County, Minnesota prosecutors said Lee could return home to his family if he accepted their offer to plead guilty to the same felony and be released immediately. The terms of the plea would mean Lee would still be a convicted felon with 15 years of probation and his driving privileges would be suspended for 10 years.

Lee, 32, said no to the plea deal.

His defense attorneys told KSTP his reason for rejecting the deal was because he continues to maintain he was pressing the brake at the time of the accident and he is not a felon. Lee's attorneys maintain the accident was caused by unintended acceleration. "I am confident that we can show Koua's Toyota ran away on him," said Bob Hilliard, one of Lee's attorneys, prior to the beginning of the hearing. "Koua's Toyota would not respond to his braking."
...
Brent Schafer, also representing Lee, said new evidence showed that Lee deserved a new trial. "We'll call witnesses who have also experienced throttle control problems in their 1996 Camry."

The family of the victims had also backed a new trial. Michael Padden, attorney for the victims' family, said his clients were "shocked" at the plea offer and "disappointed" with the prosecutors. "
...
 "They're shocked that they're dangling a carrot in front of the guy like this, because obviously he wants to be with his family but it's really a crappy offer if you think about it."
...
The Ramsey County prosecutor's office said there was no new evidence. In April, two experts hired by the prosecutor re-examined the car and reported "…there were no problems with the brakes or throttle system.  :bullshit: "They blamed the accident on driver error.

*Ramsey County Attorney Susan Gaertner expressed her sympathy to all involved in the accident, while also stating her opposition to a new trial. "But the law is clear," she said. "Newly discovered evidence is required to overturn a conviction. Despite diligent efforts, we found no such evidence."

**Lee's attorneys hired their own expert to examine the car, however, and their expert reported there was evidence that the throttle was stuck open and that Lee was pressing the brakes at the time of the collision.

**So basically the prosecutors or the people they had sent out to do the test were lying.

*The victims family supported a new trial seeing how other 1996 Camry's were reported to have the same issue. The County Attorney expressed her sympathy but opposed a new trial that the victims supported and the accused. They examined the car and came up with the same conclusion, brakes and throttle working... driver error. The accused attorneys hired their own expert who found evidence that the throttle was open and the brakes were pressed at the same time at the point of the accident. So isn't that like opposite of evidence provided to the prosecutor?

It sounds to me like the prosecutors but more to do with the attorney/judge? seemed biased and hellbent for some reason opposing a new trial and wanting him to admit it was his fault despite the evidence from other owners. It was either his fault or not and evidence show it wasn't and other people coming forward on the issue. So they try to make him an offer. Now why would they do that if they genuinely believed he was guilty? They didn't offer him a plea deal before the others came forward.

And their behaviour. I wonder why they behaved like that? Is it because he is of Chinese origin and they just happen to be racist and let it influence their decision making? or got taken in and bribed over by Toyota?
« Last Edit: January 25, 2023, 07:57:12 am by MrMobodies »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12496
  • Country: ch
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #14 on: January 25, 2023, 07:59:09 am »
As for infotainment systems taking over the cockpit: I think it’s gotten to the point where we’re going to need to legally mandate physical controls. It’s absolute lunacy to put essential controls onto a touchscreen. IMHO, nothing the driver needs to control during driving should be on the touchscreen.

The other thing we need to maybe do more with is voice control. We’ve gotten that reliable enough that it works very reliably for simple tasks (“hey siri set a timer for 15 minutes”) and quite well for a lot of more complex tasks (“hey siri schedule lunch with mom on Tuesday at 1pm”). I know many cars now let you do things like control air conditioning.

The problem is that voice control needs to be done really well (such as allowing a wide vocabulary for the same things), but above all, that good voice recognition and natural language processing aren’t available for most languages. It’s excellent in the major dialects of “key” languages, but tapers off quickly for less popular languages and dialects. But for voice control to substitute physical controls, it needs to work reliably in every language any driver is going to use. And since that ain’t gonna happen any time soon, physical controls it is!
 
The following users thanked this post: tom66

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4283
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #15 on: January 25, 2023, 08:11:32 am »
Maybe I’m too charitable, but I think most developers do care about those things, but with the time pressure they’re usually on, those things get neglected.

Sure time pressure is a thing, and might bring sloppy programming, but I believe it to be a state of mind. The bigger the better.

Only viewed the first bit of the interview, and the moment they mentioned high performance computers and 5G/6G data links to improve on vehicle behavior I left.

We are talking about a car, with very well defined modes of operation, and they worked well without all this electronics in them. Sure there are benefits coming with the electronics, but you don't need more lines of code then a very big well know OS.

The software world going to hell due to these practices can be seen all around. Simple functionality failing to be implemented correctly and not fully tested. As an example, I wanted to close a bank account. The online route, that took a bit to find, told me that there was still money in the account and it needed to be less then 10 euros to be able to continue. It provided a button to transfer the money, and also told to leave some money for possible costs. So I reduced the amount to 7,17 euros, transferring a nice round amount of money, and tired again. Nope, same message, still money in the account needs to be less then 10 euros. Transferred another two euros, but still no dice. Filed a complaint and they closed the account for me. To me this shows just some idiot not knowing how to program and properly test the functionality, or a willing error to not allow you to close your account. Take your pick.

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6570
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #16 on: January 25, 2023, 08:39:08 am »
The biggest problem is indeed the maturity of the software.
They could not get it right earlier let alone now with all these cameras , radar and so called autonomous driving.
Just as with abs and belts which increased safety, the result was that people felt so safe they began to drive unsafer. So if these new features give you an unwarranted extra safety feeling, you know what the stupid people will do.

https://www.dumpert.nl/item/100051980_0c76ee08
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #17 on: January 25, 2023, 08:57:32 am »
The biggest problem is indeed the maturity of the software.
They could not get it right earlier let alone now with all these cameras , radar and so called autonomous driving.
Just as with abs and belts which increased safety, the result was that people felt so safe they began to drive unsafer. So if these new features give you an unwarranted extra safety feeling, you know what the stupid people will do.

https://www.dumpert.nl/item/100051980_0c76ee08

Yeah these new automatic emergency braking systems are not to be relied on to just work in every situation. There is a mountain of software that makes it work, even involving AI into the mix.

They really activate at the last possible moment and might not actually stop in time to prevent contact if the conditions are not ideal (good road surface, good tires, well maintained brakes..etc), but they still reduce the speed down significantly to a point where there are no/minimal injuries. None the less they are a great thing when driving in poor visibility like heavy rain or fog since the radar can see trough the fog and has a faster reaction time.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4283
  • Country: nl
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #18 on: January 25, 2023, 10:54:12 am »
None the less they are a great thing when driving in poor visibility like heavy rain or fog since the radar can see trough the fog and has a faster reaction time.

But it still can't look around corners  >:D

In heavy rain or fog it is just wise to lower your speed to give yourself more time to react. None the less there are always idiots who think they are indestructible and overtake you in these circumstances  :palm:

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7408
  • Country: ca
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #19 on: January 25, 2023, 11:09:51 am »
And what is the programming language used? C and C++ are terribly dangerous, we all know how antique and shitty it is having no memory protection.
Who's doing the actual ISO26262 evaluation or certification? Nobody but the automaker thinking "it's OK" in house.

Tesla's infotainment systems wearing out their FLASH memory, an embarrassing fiasco that required NHTSA pressure for a full recall. The S/W wearing out the H/W.
 
The following users thanked this post: bigfoot22

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: si
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #20 on: January 25, 2023, 11:22:44 am »
Indeed it is no replacement for common sense of adapting your driving to the conditions.

Even saw a Tesla with its self driving loose it in a corner. It was going around a corner that was too slippery for the speed it tried to take it at, so it ends up spinning it. They do slow down in corners, but it is likely turned for taking corners in good dry road conditions.
« Last Edit: January 25, 2023, 11:33:03 am by Berni »
 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #21 on: January 25, 2023, 11:52:48 am »
100 million lines of code?
I don't believe that for a minute unless there are reams and reams of comments and full source revision history in every file, along with an essay of legalese and copyright information, although none of this is really 'code'.


Was it really supposed to do that?
 

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6951
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #22 on: January 25, 2023, 12:34:55 pm »
Yeah these new automatic emergency braking systems are not to be relied on to just work in every situation. There is a mountain of software that makes it work, even involving AI into the mix.

I would say they are great based on a recent experience.  Car in front slammed on their brakes but they had no functioning brake lights, only to decide to turn off in front of me with no indicator either.  I probably should have noticed clues from their driving, as they seemed erratic and their vehicle was in poor condition, but I was in 'autopilot' as brains tend to do while driving.  The radar picked this up well before I noticed.  I was following with 3-sec distance and the immediate beep and red flashing warning in my face immediately directed my attention and I braked hard.  The nice thing is when AEB detects an event, it always enhances the brake response, so even a slight press is interpreted as significant braking.  Then ABS and ESP handle the stability of the vehicle.  Plenty of space to safely stop ... would I have avoided hitting them without, well quite possibly, but it definitely gave me extra margin.  Do I rely on them?  Absolutely no, the radar cannot detect all events, it's only there in addition to the meatbag in the driver's seat.
 

Offline Vincent

  • Regular Contributor
  • *
  • Posts: 83
  • Country: ca
  • May or may not be a Tektronix fanboy
    • The Vince Electric Laboratory
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #23 on: January 25, 2023, 01:03:25 pm »
And now we have smartphone apps that connect to cars. Hackers' wonderland!

Never in a century will I have my car and smartphone connected together. Or my bank account and my smartphone. Or anything critical and my smartphone for that matter.
 
The following users thanked this post: bigfoot22

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17088
  • Country: us
  • DavidH
Re: Average car contains 100 million lines of code, The State of Autosoftware
« Reply #24 on: January 25, 2023, 04:23:01 pm »
100 million lines of code?
I don't believe that for a minute unless there are reams and reams of comments and full source revision history in every file, along with an essay of legalese and copyright information, although none of this is really 'code'.

It will be that much when you include the code for various libraries which get dragged in due to dependencies whether the code is ever executed or not.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf