Making alloca more safe

BCS none at anon.com
Fri Nov 20 10:06:02 PST 2009


Hello Walter,

> BCS wrote:
> 
>> For some systems, once you hit a seg-v, things can't get any worse
>> 
> Oh, yes they can!

For some cases they can, for others they can't.

> You could now be executing a virus. *Anything* the
> software is connected to can now do anything wrong or malicious.

> (On my car, I installed an oil pressure switch that shuts off the
> electric fuel pump if the pressure drops.

It might not translate to CS but there are good reasons that such a device 
doesn't come standard on cars; the first time one killed a car in rush hour 
traffic and set off a 50 car pile-up the someone (GM?) goes bankrupt.

> I also pried a switch off of
> a junkyard Mustang that shuts off if it gets hit hard, I also plan on
> installing that to shut off the fuel pump. Think of those like a "seg
> fault" <g>)

That one might even be worse because it only comes into play when you know 
things are going wrong; "as soon as things go wrong, my car quits working".

> 
>> so why not try to make things better by saving what you can?
>> 
> Sure, you can try saving things, but you'd better hope that there was
> already a reasonably recent clean copy of your data.

that or make a very robust dump system (core dump?)

> To write safe & reliable software, approach it from "what can go
> wrong, will go wrong", not "I won't worry about that case, because
> it's unlikely." 





More information about the Digitalmars-d mailing list