Forgot your password?
typodupeerror

Comment: Re:coding standards (Score 1) 664

by tjb6 (#46318695) Attached to: Stack Overflow Could Explain Toyota Vehicles' Unintended Acceleration

It's not so hard to track down local variables.
If you have a failure, you will have a stack pointer, and your memory map will give you an offset into the stack allocation for the function in question.

For those of us 'doing it old school' (mc68302 processor, no hardware debug support at all, no RTOS), the standard tools are a logic analyser dump and the compiler memory map output. Same tools are applicable to many other environments.

I have had to do it more times than I like...

Comment: Re:coding standards (Score 1) 664

by tjb6 (#46318641) Attached to: Stack Overflow Could Explain Toyota Vehicles' Unintended Acceleration

I think the standard you are referring to is MISRA.
I can't see any good reason why recursion would be used in such a control system, and in any embedded application it is asking for trouble - principally (as you say) stack overflows.

I am less convinced of the dangers of using local variables - the trade off is to use globals, or at least global to file (C static global), which is an open invitation to side effects all through the code.

Use of malloc or free - might not cause stack overflows, but
  1) can easily cause heap overflows, which can be as bad.
  2) can fail to return the memory, which is difficult to handle robustly in an embedded application.

We don't use the full MISRA set (for radar systems), but we absolutely do not allow recursion, or dynamic memory use. Nobody wants their control system to run out of memory after a few hours/days use, and fail (eg Patriot failure in Iraq).

Comment: Re:Why the hype? (Score 1) 274

by tjb6 (#46225345) Attached to: The Death Cap Mushroom Is Spreading Across the US

We have lots of them grow around here (Canberra, Australia). For some reason they like the pine and casuarina plantations around Canberra, possibly because not much else will grow in the bed of needles under those things.

We had two people (cooks at a chinese restaurant) die last year who picked them, thinking they were straw mushrooms. Just glad they did not serve them up at the restaurant!

I remember mushrooming as a kid, under my father's guidance. We only picked field mushrooms, which are dark underneath. Deathcaps are much lighter underneath. I think he learnt to do it because he grew up in the bush, and food and money were scarce for a while.

I've always considered the damn things a death sentence, so wont pick wild mushrooms any more, as it has been too long since I last did it (40 years).

Comment: Re:I've FIGURED OUT HOW TO STOP MRSA!! (Score 2) 111

by tjb6 (#45722497) Attached to: Multidrug Resistance Gene Released By Chinese Wastewater Treatment Plants

No it wouldn't. Patient to patient transfer via a 3rd party (doctor/nurse/visitor/whatever) is part of the problem, but there are plenty of people arriving at hospital with these things in progress already.

Correct use of antibiotics, and banning misuse of antibiotics (eg, as an animal feed supplement) would attack the root of the problem.

Regular low-dose antibiotics for livestock causes the growth of antibiotic resistant bacteria in the gut. Since bacteria have the unfortunate talent of being able to pass on some of their genetic material to their neighbours, the resistance is then passed on to their less pleasant neighbours, who are happy to take the party to us in a big way.

Blaming the doctors for all of this is like blaming your doctor for obesity - they could have done something better, but bad things had to be happening already.

Comment: Re:This one only "crashed" (Score 1) 258

by tjb6 (#45419763) Attached to: Military Drone Lost Over Lake Ontario

Speaking as a non US citizen, when the first drone "accidentally fires" on a non-US citizen ???

Surely you are not implying that the rest of the world are somehow second class human beings?
The ethics of the use of deadly force should be invariant across borders, but this is not seen by many governments.

Comment: Re:Needless? (Score 2) 361

by tjb6 (#45408007) Attached to: Ask Slashdot: Communication Skills For Programmers?
Sadly, the stereotype of the isolated developer quietly sitting in the corner and coding away is sometimes true. I have worked with a few over the years, spent a year or 2 of my time bringing them out of their shell, and often see them slip away into isolation again. Unless you are working on a one person project, then it is essential that you talk with your co-workers. If you are not just a worker drone (and for your psychological health), you should have some basic social interactions with your colleagues. I have seen the end of the 'isolated hacker' road - somebody in their 40s who could not interact, and could no longer function in a group. He doesn't work with us any more. We practice variations on agile development methods here, and if you are not talking to people to discuss your work, you are not working properly. I have also seen people who roamed the building and socialised incessantly, seldom performing any useful work. Mostly they do not work with us either. To survive 30 years in development, you have to 1) be productive 2) be able to communicate verbally, and in writing, 3) be able to interact with people in a functional way.

To understand a program you must become both the machine and the program.

Working...