Fantastic exchange from DConf

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Tue May 9 10:21:25 PDT 2017


On Tue, May 09, 2017 at 07:13:31AM -0700, Walter Bright via Digitalmars-d wrote:
> On 5/8/2017 1:55 PM, John Carter wrote:
> > On Saturday, 6 May 2017 at 06:26:29 UTC, Joakim wrote:
> > 
> > > Walter: I believe memory safety will kill C.
> > 
> > C/C++ has been granted an extension of life by the likes of valgrind
> > and purify and *-sanitizer.
> 
> I agree. But one inevitably runs into problems relying on valgrind and
> other third party tools:
> 
> 1. it isn't part of the language

And it doesn't catch everything.


> 2. it may not be available on your platform

And may not be compatible with your target architecture -- a lot of C
code, especially in the embedded realm, have curious target archs that
could be problematic for 3rd party tools that need to inject runtime
instrumentation.


> 3. somebody has to find it, install it, and integrate it into the
> dev/test process

This is a big one. Many large C projects have their own idiomatic way of
building, which is often incompatible with 3rd party tools.  This is a
major demotivator for people to want to use those tools, because it's a
big time investment to configure the tool to work with the build
scripts, and an error-prone and painful process to rework the build
scripts to work with the tool. "Why break our delicate tower-of-cards
build system that's worked just fine for 20 years, just to run this
new-fangled whatever 3rd party thingy promulgated by these young
upstarts these days?"


> 4. it's incredibly slow to run valgrind, so there are powerful
> tendencies to skip it

Yes, it's an extra step that the developer has to manually run, when he
is already under an unreasonable deadline to meet an unreasonable
customer request upon which hinges a $1M deal so you can't turn it down
no matter how unreasonable it is.  He barely has enough time to write
code that won't crash outright, nevermind writing *proper* code. Yet
another extra step to run manually? Forget it, not gonna happen.  Not
until a major crash happens on the customer's site that finally
convinces the PTB to dictate the use of valgrind as a part of regular
work routine.  Other than that, the chances of someone actually
bothering to do it are slim indeed.


> valgrind is a stopgap measure, and has saved me much grief over the
> years, but it is NOT the solution.

Yes, it's a patch over the current festering wound so that, at least for
the time being, the blood is out of sight.  But you can't wear that
patch forever. Sooner or later the gangrene be visible on the surface.
:-D


T

-- 
Change is inevitable, except from a vending machine.


More information about the Digitalmars-d mailing list