Re: [xml] clang reports a few problems in libxml2



On Wed, Sep 02, 2009 at 02:38:39PM +0200, Jim Meyering wrote:
On request,

  Yup, thanks Jim !

I ran clang against libxml2.  The result is a nice html summary,
but the total weighs in at 220MB, uncompressed.  Here's the browsable
result:
[...]
Note that some of these are definitely false positives.

But here's a legitimate bug in xmlslave.c:

  http://meyering.net/code/tmp/clang/libxml2-vs-clang-syntax-checker/report-5Qxdd7.html#EndPath

    if (doc != NULL)
        oldenc = doc->encoding;                   // one-line "then" clause
      if (ctxt->encoding != NULL) {             // not part of "if block"
          doc->encoding = BAD_CAST ctxt->encoding;
      } else if (doc->encoding != NULL) {
          encoding = doc->encoding;
      }
    }

  I went though all of them (173) there is an awful lot of redondant
reports, a reasonable amount of false positive, or rather systematic
checks that may not turn out realistic in real execution (like
ctxt->sax2 changing during a function call), but I think this raised
half a dozen real bugs, and allowed me to add safety check in places
where they shouldn't be really needed, but still good as a safety
feature.
  All changes now commited to git !

  The reports are pretty good except for the amount of duplication and
the size of the HTML generated :-)

 so thanks again for running the test, I think you can now safely clean
that tree up !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]