View Issue Details

IDProjectCategoryView StatusLast Update
0002232unrealircdpublic2015-07-09 19:48
ReporterAngryWolf Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformLinuxOSSuSEOS Version8.1
Product Version3.2.2 
Summary0002232: [CVS] Memory leaks in the new config parser code
DescriptionI have just found out that duplicates of certain configuration directives lead to memory leak problems with the new configuration parser code. For example, allow::ip is one of those directives.
Steps To ReproduceI used the following configuration snippet:

allow
{
ip aaaaaaaa...; // a total of 100 'a' characters.
// previous line repeated 1023 times
hostname *@*;
class clients;
maxperip 1;
}

Additional InformationAfter starting ircd, memory usage is:

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMANDangrywo  26105  0.0  1.1  4992 3052 ?        S    22:55   0:00 /home/angrywolf/IRC/IRCNetwork/Server1/src/ircd


After numerous times of /rehash:

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMANDangrywo  26105 11.2  4.5 13400 11556 ?       S    22:55   0:15 /home/angrywolf/IRC/IRCNetwork/Server1/src/ircd

TagsNo tags attached.
Attached Files
At start.JPG (82,999 bytes)
After 100 rehashes.JPG (82,542 bytes)
3rd party modulesNone

Relationships

child of 0003331 closedsyzop Bug reports due for closing 

Activities

AngryWolf

2004-12-10 16:10

reporter   ~0008589

Oh, my god! Formatting still sucks...

syzop

2004-12-10 17:19

administrator   ~0008590

*editattemptfailed*
lol, well.. we understand what you mean ;).

The fix is that ircstrdup() should be used instead of .. = strdup().
[and make sure the structure was alloced by MyMallocEx and not MyMalloc, but this probably is the case everywhere where it matters anyway]

crazy

2004-12-10 17:27

reporter   ~0008591

just playing with valgind :)

==29816== Reading syms from /home/Leaf2004/Unreal/tmp/99F92DB4.commands.so (0x1BBA8000)
==29816== Reading syms from /home/Leaf2004/Unreal/tmp/71DBED25.cloak.so (0x1B94F000)
==29816== Warning: noted but unhandled ioctl 0x5422 with no size/direction hints
==29816== This could cause spurious value errors to appear.
==29816== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==29816==
==29816== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 28 from 1)
--29816--
--29816-- supp: 28 Ugly strchr error in /lib/ld-2.3.2.so
==29816== malloc/free: in use at exit: 314707 bytes in 4139 blocks.
==29816== malloc/free: 15094 allocs, 10955 frees, 3209574 bytes allocated.

-----

==29816== 84 bytes in 3 blocks are definitely lost in loss record 434 of 494
==29816== at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==29816== by 0x8096006: MyMallocEx (support.c:1672)
==29816== by 0x8080160: _conf_alias (s_conf.c:7809)
==29816== by 0x80730FD: config_run (s_conf.c:2211)

------

==29816== LEAK SUMMARY:
==29816== definitely lost: 84 bytes in 3 blocks.
==29816== possibly lost: 0 bytes in 0 blocks.
==29816== still reachable: 314623 bytes in 4136 blocks.
==29816== suppressed: 0 bytes in 0 blocks.
--29816-- TT/TC: 0 tc sectors discarded.
--29816-- 11509 tt_fast misses.
--29816-- translate: new 9895 (148368 -> 2026800; ratio 136:10)
--29816-- discard 0 (0 -> 0; ratio 0:10).
--29816-- chainings: 7520 chainings, 0 unchainings.
--29816-- dispatch: 5150000 jumps (bb entries); of them 650723 (12%) unchained.
--29816-- 6455/44787 major/minor sched events.
--29816-- reg-alloc: 1871 t-req-spill, 367625+14446 orig+spill uis,
--29816-- 51854 total-reg-rank
--29816-- sanity: 6456 cheap, 259 expensive checks.
--29816-- ccalls: 32444 C calls, 55% saves+restores avoided (105276 bytes)
--29816-- 44316 args, avg 0.88 setup instrs each (10194 bytes)
--29816-- 0% clear the stack (97332 bytes)
--29816-- 13339 retvals, 31% of reg-reg movs avoided (8170 bytes)
==29818== Source and destination overlap in strncpy(0x1BC14B19, 0x1BC14B19, 64)
==29818== at 0x1B904986: strncpy (mac_replace_strmem.c:113)
==29818== by 0x808D4EB: register_user (s_user.c:883)
==29818== by 0x1BBC183A: m_nospoof (m_pingpong.c:187)
==29818== by 0x1BBC1A0E: m_pong (m_pingpong.c:211)

...

stskeeps

2007-04-27 02:35

reporter   ~0013756

Bump. still valid?

stskeeps

2007-06-12 15:28

reporter   ~0014346

Moving here due to lack of feedback.

Stealth

2007-06-12 16:14

reporter   ~0014351

Bug still is valid in 3.3

After starting, %MEM said 1.1
After 100 rehashes, %MEM said 7.6 (increasing an average of 0.065 per rehash)

Attached 2 screenshots, "At start.jpg" taken of top just after starting Unreal, and "After 100 rehashes.jpg" taken of top after 100 rehashes. The 3.3 process is the one highlighted.

syzop

2015-07-09 19:48

administrator   ~0018457

old bug

--> individual bugs instead

Issue History

Date Modified Username Field Change
2004-12-10 16:04 AngryWolf New Issue
2004-12-10 16:04 AngryWolf 3rd party modules => None
2004-12-10 16:10 AngryWolf Note Added: 0008589
2004-12-10 17:15 syzop Steps to Reproduce Updated
2004-12-10 17:15 syzop Additional Information Updated
2004-12-10 17:19 syzop Note Added: 0008590
2004-12-10 17:27 crazy Note Added: 0008591
2004-12-11 16:06 codemastr Steps to Reproduce Updated
2004-12-11 16:07 codemastr Steps to Reproduce Updated
2005-12-10 17:20 syzop Severity major => minor
2007-04-27 02:35 stskeeps Note Added: 0013756
2007-04-27 02:35 stskeeps Status new => acknowledged
2007-06-12 15:27 stskeeps Relationship added child of 0003331
2007-06-12 15:28 stskeeps Note Added: 0014346
2007-06-12 16:14 Stealth Note Added: 0014351
2007-06-12 16:15 Stealth File Added: At start.JPG
2007-06-12 16:15 Stealth File Added: After 100 rehashes.JPG
2015-07-09 19:48 syzop Note Added: 0018457
2015-07-09 19:48 syzop Status acknowledged => closed
2015-07-09 19:48 syzop Assigned To => syzop
2015-07-09 19:48 syzop Resolution open => no change required