Project

General

Profile

Bug #4749

ilbd_run_probe() has several problems with resource releasing

Added by Serghei Samsi over 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
networking
Start date:
2015-11-10
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

ILB daemon RSS continuously grows if it has active rules with health-check.
RSS growth during an hour:
102657 daemon 3604K 2280K sleep 59 0 0:00:00 0.1% ilbd/1
102657 daemon 3604K 2328K sleep 59 0 0:00:00 0.0% ilbd/1
102657 daemon 3604K 2584K sleep 59 0 0:00:00 0.0% ilbd/1
102657 daemon 3608K 2620K sleep 59 0 0:00:02 0.8% ilbd/1
102657 daemon 3736K 2748K sleep 59 0 0:00:17 0.0% ilbd/1

truss output shows that the problem in ilbd_run_probe() which doesn't release resources after usage of posix_spawn_file_actions_* and posix_spawnattr_*:

/1@1:    2.6014 -> libc:posix_spawn_file_actions_init(0x8047c9c, 0x4, 0x82, 0x1789)
/1@1:    2.6168 <- libc:posix_spawn_file_actions_init() = 0
/1@1:    2.6184 -> libc:posix_spawnattr_init(0x8047c98, 0x4, 0x82, 0x1789)
/1@1:    2.6345   -> libc:lmalloc()
/1@1:    2.6498     -> libc:getbucketnum()
/1@1:    2.6659     <- libc:getbucketnum() = 0
/1@1:    2.6674     -> libc:lmutex_lock()
/1@1:    2.6831     <- libc:lmutex_lock() = 0xfef2c1c0
/1@1:    2.6846     -> libc:lmutex_unlock()
/1@1:    2.7017     <- libc:lmutex_unlock() = 0
/1@1:    2.7032   <- libc:lmalloc() = 0xfeace680

Another detected problem is double-freeing memory due to incorrect position of destroy_argv() on line 1359 if test condition evaluates to true on line 1367 (file usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c)


Subtasks

Bug #6452: ilbd leaks lmalloc() memory due to posix_spawn() sloppinessClosedDan McDonald2015-11-10

Actions
#1

Updated by Serghei Samsi over 6 years ago

  • Status changed from New to In Progress
  • % Done changed from 10 to 50

Please review http://mtc.md/sscdvp/webrevs/issue_4749/

Regards,
Serghei Samsi

#2

Updated by Electric Monk about 5 years ago

  • Status changed from In Progress to Closed

git commit 808b84d02d9e58543ac8cde2701dec91a8c237f0

commit  808b84d02d9e58543ac8cde2701dec91a8c237f0
Author: Serghei Samsi <sscdvp@gmail.com>
Date:   2015-11-12T19:05:42.000Z

    4749 ilbd_run_probe() has several problems with resource releasing
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF