News for hackers. Stuff that matters.
Re:Aaron Swartz's Thoughts on djb (2009) by sanxiyn on Friday March 06, 2015 @01:48AM (#9155909)
djb aims to write bug-free programs and actively works on improving the process to do so. While Bellard is a great programmer, I don't think Bellard aims to write bug-free programs.

See section 8 of http://cr.yp.to/cv/activities-20050107.pdf

There are more people who aims to write bug-free programs, but most of them seem to use formal verification. djb seems pretty unique in aiming bug-free programs in normal programming and getting close.

Re: Bellard software quality. Fuzzing found 1120 bugs in FFmpeg. While Bellard's code is only small part of entire FFmpeg, FFmpeg is very far from being bug-free.

http://googleonlinesecurity.blogspot.com/2014/01/ffmpeg-and-...

Re:Aaron Swartz's Thoughts on djb (2009) by schoen on Friday March 06, 2015 @02:38AM (#9156021)
I was shocked (and impressed) when I looked at some of djb's code and saw that he put his "the return value of every syscall must be checked" view into practice so consistently that every single printf() (not only fprintf()!) was inside an if block that checked whether it succeeded in writing to stdout or not.

Of course, printf() does have a return value ("Upon successful return, these functions return the number of characters printed"), and it can fail... but it takes a considerable consistency of purpose to decide to deal with that possibility explicitly every single time.

Re:Aaron Swartz's Thoughts on djb (2009) by mercurial on Friday March 06, 2015 @05:29AM (#9156435)
I think this says as much about djb's abilities as about C's limitations.
Re:Aaron Swartz's Thoughts on djb (2009) by riffraff on Friday March 06, 2015 @05:05AM (#9156389)
out of curiosity, what do you (does he) do if printf fails?
Re:Aaron Swartz's Thoughts on djb (2009) by svckr on Friday March 06, 2015 @05:33AM (#9156440)
From qmail/qmail-pw2u.c (linked somewhere above):

    void die_write()
    {
      substdio_putsflush(subfderr,"qmail-pw2u: fatal: unable to write output\n");
      _exit(111);
    }

    /* ... */
    if (substdio_puts(subfdout,uugh) == -1) die_write();
    if (substdio_puts(subfdout,dashcolon) == -1) die_write();
    if (substdio_put(subfdout,x,i) == -1) die_write();
    /* ... */
Re:Aaron Swartz's Thoughts on djb (2009) by chris_wot on Saturday March 07, 2015 @07:13AM (#9161662)
So what does he do when substudio_putsflush has an error?
Re:Aaron Swartz's Thoughts on djb (2009) by schoen on Monday March 09, 2015 @07:35PM (#9174875)
Well, the process will still exit unconditionally immediately afterwards, attempting to signal an error via its return code. It's hard to do better than that in the context of a real operating system.
Re:Aaron Swartz's Thoughts on djb (2009) by Tomte on Friday March 06, 2015 @03:10AM (#9156100)
> See section 8 of http://cr.yp.to/cv/activities-20050107.pdf

Last sentence in the paper:

"I won't be satisfied until I've put the entire security industry out of work."

That's nothing short of amazing.

Re:Aaron Swartz's Thoughts on djb (2009) by drinchev on Friday March 06, 2015 @03:37AM (#9156176)
Another one from Section 8

> Bug-elimination research, like other user-interface research, is highly nonmathematical. The goal is to have users, in this case programmers, make as few mistakes as possible in achieving their desired effects. We don’t have any way to model this—to model human psychology—except by experiment. We can’t even recognize mistakes without a human’s help. (If you can write a program to recognize a class of mistakes, great—we’ll incorporate your program into the user interface, eliminating those mistakes—but we still won’t be able to recognize the remaining mistakes.) I’ve seen many mathematicians bothered by this lack of formalization; they ask nonsensical questions like “How can you prove that you don’t have any bugs?” So I sneak out of the department, take off my mathematician’s hat, and continue making progress towards the goal.