# Dummy publishers leaking

**URL:** <https://janus.discourse.group/t/dummy-publishers-leaking/1591>\
**Category:** General\
**Created:** [April 11, 2025, 3:11pm UTC](https://janus.discourse.group/t/dummy-publishers-leaking/1591 "2025-04-11T15:11:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![m08pvv](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/m08pvv/32/379_2.png) [@m08pvv](https://janus.discourse.group/u/m08pvv)\
**Post date:** [April 11, 2025, 3:11pm UTC](https://janus.discourse.group/t/dummy-publishers-leaking/1591/1 "2025-04-11T15:11:17Z")

</div>

Profiled a leak and got following refcount info:  
[plugins/janus\_videoroom.c:janus\_videoroom\_create\_dummy\_publisher:3149:init] 0x615000196b38 (1)  
[plugins/janus\_videoroom.c:janus\_videoroom\_create\_dummy\_publisher:3169:increase] 0x615000196b38 (2)  
[plugins/janus\_videoroom.c:janus\_videoroom\_create\_dummy\_publisher:3215:increase] 0x615000196b38 (3)  
[plugins/janus\_videoroom.c:janus\_videoroom\_create\_dummy\_publisher:3248:increase] 0x615000196b38 (4)  
[plugins/janus\_videoroom.c:janus\_videoroom\_publisher\_dereference:2751:decrease] 0x615000196b38 (3)

There are many such cases, so it seems that it’s either a leak or we use dummy publishers somehow wrong.

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [April 11, 2025, 3:30pm UTC](https://janus.discourse.group/t/dummy-publishers-leaking/1591/2 "2025-04-11T15:30:51Z")

</div>

Are you destroying the room dummy publishers are in?

---

<div class="post-metadata">

**Author:** ![m08pvv](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/m08pvv/32/379_2.png) [@m08pvv](https://janus.discourse.group/u/m08pvv)\
**Post date:** [April 14, 2025, 5:24am UTC](https://janus.discourse.group/t/dummy-publishers-leaking/1591/3 "2025-04-14T05:24:24Z")

</div>

Yes, we have dummy publishers in the room that we destroy.  
I also noticed that creation of publisher stream for dummy publisher does janus\_refcount\_increase(&publisher-\>ref); but janus\_videoroom\_publisher\_stream\_free doesn’t decrement it - looks suspicious for me.

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [April 14, 2025, 8:08am UTC](https://janus.discourse.group/t/dummy-publishers-leaking/1591/4 "2025-04-14T08:08:09Z")

</div>

Then please open an issue on GitHub and I’ll have a look when I have some time.

---

<div class="post-metadata">

**Author:** ![m08pvv](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/m08pvv/32/379_2.png) [@m08pvv](https://janus.discourse.group/u/m08pvv)\
**Post date:** [April 15, 2025, 7:12am UTC](https://janus.discourse.group/t/dummy-publishers-leaking/1591/5 "2025-04-15T07:12:45Z")

</div>

> <https://github.com/meetecho/janus-gateway/issues/3537>
>
> \*\*What version of Janus is this happening on?\*\*
> 505d97d7fee6bc6370f28bf5e51d491c…c5716b27
> 
> \*\*Have you tested a more recent version of Janus too?\*\*
> it's latest master so far
> 
> \*\*Was this working before?\*\*
> no idea
> 
> \*\*Is there a gdb or libasan trace of the issue?\*\*
> some refcount logs: https://gist.github.com/m08pvv/46cc52ec5b7d6134c7b4a3de7d874b66
> (full log is from a branch where I tried to add a decrease in janus\_videoroom\_publisher\_stream\_free)
> 
> \*\*Additional context\*\*
> we use dummy publishers and recordings
> tried to add a decrease in janus\_videoroom\_publisher\_stream\_free, but it seems that it wasn't called (at least it's not in the log which contains all output)
