Hi,
Is the documentation on Debugging Janus still valid.
I know it used to work but now on Debian 12 (bookworm) I have libasan6 and 8 (gcc 11 and 12 i guess) but I can’t seem to get libasan dependencie for janus bin with ldd or nm.
i guess only steps that is needed are
CFLAGS = …
LDFLAGS = …
./configure …
make
make install
I’m I missing something? DId anyone manage to compile Janus with Adress sanitizers on Debian 12?
Thanks,
mirko
lorenzo
(Lorenzo Miniero)
July 16, 2024, 11:17am
2
They should work but I’m not familiar with Debian 12. We recently modified the instructions you linked, so you can see if the previous syntax works instead: Remove unneeded compiler flags. Increase size for -Wlarger-than to 2M… · meetecho/janus-gateway@f727ba8 · GitHub
Hey Lorenzo,
Doesn’t seem to make any difference, gcc=12.2.0-14 and libasan6 and 8 both installed
/usr/lib/gcc/x86_64-linux-gnu/10/libasan.so
/usr/lib/gcc/x86_64-linux-gnu/12/libasan.so
/usr/lib/x86_64-linux-gnu/libasan.so.6
/usr/lib/x86_64-linux-gnu/libasan.so.8
/usr/lib/x86_64-linux-gnu/libasan.so.8.0.0
/usr/lib/x86_64-linux-gnu/libasan.so.6.0.0
I can’t remember for sure, but I think I last time compiled on Debian10 when I had mem leak issues, so I guess now it is some problem with Debian and gcc and new libasan
Strangly now on Debian10 with libasan4 and 5 and gcc 8.5 I still don’t get ldd to show libasan for janus binary
Seemss to be not related to OS but the way it is linked to janus, for some reason it is not linked
lorenzo
(Lorenzo Miniero)
July 18, 2024, 10:04am
6
Be sure to do a make clean
after you do the new configure with the libasan stuff as explained in the debug doc page. Apart from that, not sure what else to suggest, @atoppi may know more.
1 Like
I do it every time, to be sure.
I got it to be linked but only after I modified CFLAGS in Makefile after compile
I literally just pasted the ones from docs there
CFLAGS = -O0 -g3 -ggdb3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize-address-use-after-scope -fno-sanitize-recover=all -fPIC -fstack-protector-all …
# ldd /opt/janus/bin/janus
linux-vdso.so.1 (0x00007ffd04596000)
libasan.so.5 => /lib/x86_64-linux-gnu/libasan.so.5 (0x00007f2cdfabd000)
libconfig.so.9 => /lib/x86_64-linux-gnu/libconfig.so.9 (0x00007f2cdf8b1000)
I guess it is a problem with picking up ENV variables of CFLAGS and LDFALGS
Ok so apparently this doesn’t work:
CFLAGS="-O0 -g3 -ggdb3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize-address-use-after-scope -fno-sanitize-recover=all"
LDFLAGS="-fsanitize=address"
but instead I have to use export
export CFLAGS="-O0 -g3 -ggdb3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize-address-use-after-scope -fno-sanitize-recover=all"
export LDFLAGS="-fsanitize=address"
then it is fine
maybe I should upgrade to 1.2.3 version? since this is from 1.2.0
https://paste.ubuntu.com/p/hWWRnCQDq5/
Somehow I’m 99% it is related to version of libmicrohttpd
atoppi
(Alessandro Toppi)
July 18, 2024, 10:58am
11
Gave a quick spin to a debian:12 based docker image and everything works as expected.
This is how I’m building Janus
git clone https://github.com/meetecho/janus-gateway.git janus-gateway && \
cd janus-gateway && \
./autogen.sh && ./configure --prefix=/opt/janus CFLAGS="-O0 -g3 -ggdb3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address,undefined -fsanitize-address-use-after-scope -fno-sanitize-recover=all" LDFLAGS="-fsanitize=address,undefined" \
--disable-docs \
--disable-turn-rest-api \
--disable-all-transports \
--disable-all-plugins \
--disable-all-handlers \
--disable-all-loggers \
--disable-post-processing \
--enable-data-channels \
--enable-rest \
--enable-websockets \
--enable-plugin-echotest \
--enable-plugin-videoroom \
&& make -j$(nproc) && make install
Inspection of the binary shows that ASan is being linked.
root@atoppi:~# ldd /opt/janus/bin/janus | grep asan
libasan.so.8 => /lib/x86_64-linux-gnu/libasan.so.8 (0x00007c3bb0bd8000)
atoppi
(Alessandro Toppi)
July 18, 2024, 11:29am
12
Try with latest master.
If this is still happening then proceed opening an issue on github with a reproducer / test case.
1 Like
I compiled janus master and then tried different versions of libmicrohttpd and lately master but all seems to give memory leaks
https://paste.ubuntu.com/p/GpcjmhPMsq/
this is the best report since I compiled master of libmicrohttpd and it also shows pointers.
Is it worth opening issue on Janus github ?
atoppi
(Alessandro Toppi)
July 18, 2024, 1:17pm
14
They might be false positives.
Please double check that every client session is getting destroyed before hitting CTRL-C (E.G. close all browsers tabs or send session destroy request).
1 Like
Indeed they are false positives, so now i have to keep it running to check why it is loosing memory
atoppi
(Alessandro Toppi)
July 19, 2024, 8:30am
16
Are you experiencing memory leaks without any customization to the codebase? If so please prepare a report and open an issue on GitHub.
Yeah indeed, on version 1.2.0, about 0.5GB consumed after about 2 months or so.
Let me try to get libasan to show something useful, then I’ll get back to this or new thread