Bug #2530

Parfait analysis errors

Added by kukackajiri 10 months ago. Updated 8 months ago.

Status:FixedStart date:2013-11-18
Priority:LowDue date:
Assignee:stbuehler% Done:

100%

Category:-
Target version:1.4.34
Missing in 1.5.x:No

Description

Parfait reports some errors (e.g. memory leaks, unclosed file descriptor) in Lighttpd version 1.4.33, an attached patch file will fix them.

07-parfait-errors.patch Magnifier (5.66 KB) kukackajiri, 2013-11-18 15:01

src_array.c.patch Magnifier (347 Bytes) kukackajiri, 2013-11-18 15:13

src_fdevent.c.patch Magnifier (302 Bytes) kukackajiri, 2013-11-18 15:13

src_configfile.c.patch Magnifier (2.61 KB) kukackajiri, 2013-11-18 15:13

src_lemon.c.patch Magnifier (532 Bytes) kukackajiri, 2013-11-18 15:13

src_lempar.c.patch Magnifier (472 Bytes) kukackajiri, 2013-11-18 15:13

src_mod_mysql_vhost.c.patch Magnifier (853 Bytes) kukackajiri, 2013-11-18 15:13

src_mod_webdav.c.patch Magnifier (608 Bytes) kukackajiri, 2013-11-18 15:13

09.parfait-community-requests.patch Magnifier (1.67 KB) kukackajiri, 2013-12-09 17:55

09.parfait-community-requests.patch Magnifier - correct one (1.26 KB) kukackajiri, 2013-12-09 17:58

Associated revisions

Revision 2929
Added by stbuehler 8 months ago

[mod_mysql_vhost] fix memory leak on config init (#2530)

From: Stefan Bühler <>

Revision 2930
Added by stbuehler 8 months ago

[mod_webdav] fix fd leak found with parfait (fixes #2530, thx kukackajiri)

From: Stefan Bühler <>

Revision 2931
Added by stbuehler 8 months ago

add two asserts to help parfait (#2530)

From: Stefan Bühler <>

History

#1 Updated by kukackajiri 10 months ago

Update - I split patch file into smaller patches for easier comments. They are named by file they patch, as there is no dependency between them.

#2 Updated by stbuehler 10 months ago

Splitting a patch into patch per file doesn't make review easier. If you wanted to split by something you could have grouped by severity, parfait annotations (which i won't apply), false positives, ...

#3 Updated by stbuehler 10 months ago

I'll probably apply:
  • mod_webdav fd leak: this is a real one, although if opening the upload tmpfiles fails we are screwed anyway.
  • mod_mysql_vhost: leak on config init, looks like one buffer per block. also leaks in "non error" cases.
These won't get applied:
  • lemon.c: don't care, it's just the parser generator
  • fdevent.c: misses the error cases. already fixed in svn (found with clang analyzer)
  • array.c/array_replace: du is not allowed to be NULL (maybe add assert())
  • configfile.c array_insert_unique() call: if array_insert_unique fails here there are deeper problems.. the keys are supposed to be unique in that stage. (maybe add assert())
  • configfile.c modules/prepends NULL checks: i'd rather have a segfault if this happens (maybe add assert())
  • parfait annotations: as i already said, i'm not applying those

The problem with assert() is that it could be optimized away, so we can't do anything "real" in the standard assert() (only boolean checks without side effects).

#4 Updated by stbuehler 10 months ago

  • Target version set to 1.4.34

#5 Updated by kukackajiri 9 months ago

I changed those patches: array.c, configfile.c to use assert as you asked, here it is.

#6 Updated by kukackajiri 9 months ago

I'm sorry, wrong file - I accidentally uploaded my patch for patched version, here is correct one.

#7 Updated by stbuehler 8 months ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2930.

Also available in: Atom