[TUHS] Clueless programmers

George Michaelson ggm at algebras.org
Thu Feb 15 12:42:11 AEST 2018


I've successfully debugged analogous modern code longline with smart
people by judicious use of valgrind. Never underestimate the power of
sending them current source, and running a tool against it with good
diagnostic. Its probable that electric fence would have got there too,
but this method worked for the person in question (event driven code,
C++, linked to the libevent library, lots of malloc/free)

It was quite entertaining for me to do this because back in the 80s
when I worked at Leeds university I had to run student debug clinic,
and the litany was "bring me a fresh listing" which got rid of 3/4 of
the problems up front. So here I am, debugging and the moral
equivalent is "send me a link to the checked in code repository in
github, and valgrind output, and I'll find the problem". I am pretty
sure some of the problems vanished once I got code up to date, before
sending it in.

On Thu, Feb 15, 2018 at 9:50 AM, Dave Horsfall <dave at horsfall.org> wrote:
> On Thu, 15 Feb 2018, George Michaelson wrote:
>
>> I (and I am self-confessed as the worlds least competent programmer)
>> frequently found the delay between where corruption in malloc is applied and
>> where its detected sufficiently confusing that I would have been tempted to
>> follow this well trodden "remove the free()" path.
>
>
> MALLOC_CONF and Electric Fence are your friends; I never released any of my
> dynamic code without first running it past those (and some of my linked
> lists were hideous).
>
> --
> Dave Horsfall DTM (VK2KFU)  "Those who don't understand security will
> suffer."



More information about the TUHS mailing list