rsyslog / rsyslog/librelp

Fix seldom another sessionbreak memory leak

Open
#192 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
32
Forks
39
Avg merge
2h 27m
Merged PRs (30d)
7

Description

Another memoryleak appears to be happening but more seldom, see buildbot run:
https://build.rsyslog.com/#/builders/79/builds/323

==5081==
==5081== HEAP SUMMARY:
==5081== in use at exit: 32 bytes in 1 blocks
==5081== total heap usage: 92,822 allocs, 92,821 frees, 3,744,757 bytes allocated
==5081==
==5081== 32 bytes in 1 blocks are definitely lost in loss record 1 of 1
==5081== at 0x4C2B9B5: calloc (vg_replace_malloc.c:711)
==5081== by 0x4E3A41D: addToEpollSet (relp.c:101)
==5081== by 0x4E3AA14: addSessToEpoll (relp.c:147)
==5081== by 0x4E3AA14: relpEngineAddToSess (relp.c:211)
==5081== by 0x4E3AA14: handleConnectionRequest (relp.c:670)
==5081== by 0x4E3AA14: engineEventLoopRun (relp.c:844)
==5081== by 0x4E3B08E: relpEngineRun (relp.c:1024)
==5081== by 0x401C97: main (receive.c:475)
==5081==
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:calloc
fun:addToEpollSet
fun:addSessToEpoll
fun:relpEngineAddToSess
fun:handleConnectionRequest
fun:engineEventLoopRun
fun:relpEngineRun
fun:main
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked buildbot run and trace the allocation path through addToEpollSet, addSessToEpoll, and relpEngineAddToSess in relp.c, with receive.c as the caller entry point. Determine where the 32-byte allocation loses ownership during session handling. Done means the scenario no longer reports a definite leak under Valgrind.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.