Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak detected on stopping server #2505

Closed
karelbrascamp opened this issue Dec 23, 2020 · 4 comments
Closed

Memory leak detected on stopping server #2505

karelbrascamp opened this issue Dec 23, 2020 · 4 comments

Comments

@karelbrascamp
Copy link

karelbrascamp commented Dec 23, 2020

We just compiled the latest version, and we keep getting the following error when stopping the server:

Dec 23 14:08:45 senprtc03 janus[14447]: Stopping server, please wait...
Dec 23 14:08:45 senprtc03 systemd[1]: Stopping Janus WebRTC Server...
Dec 23 14:09:11 senprtc03 janus[14447]: Bye!
Dec 23 14:09:11 senprtc03 janus[14447]: =================================================================
Dec 23 14:09:11 senprtc03 janus[14447]: ==14447==ERROR: LeakSanitizer: detected memory leaks
Dec 23 14:09:11 senprtc03 janus[14447]: Direct leak of 12104 byte(s) in 1 object(s) allocated from:
Dec 23 14:09:11 senprtc03 janus[14447]:     #0 0x7f8164a28b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
Dec 23 14:09:11 senprtc03 janus[14447]:     #1 0x7f81585e4c51 in nn_msgqueue_init (/usr/lib/x86_64-linux-gnu/libnanomsg.so.4+0x1fc51)
Dec 23 14:09:11 senprtc03 janus[14447]: SUMMARY: AddressSanitizer: 12104 byte(s) leaked in 1 allocation(s).
Dec 23 14:09:11 senprtc03 systemd[1]: janus.service: Main process exited, code=exited, status=1/FAILURE
Dec 23 14:09:11 senprtc03 systemd[1]: janus.service: Failed with result 'exit-code'.
Dec 23 14:09:11 senprtc03 systemd[1]: Stopped Janus WebRTC Server.
Dec 23 14:09:11 senprtc03 systemd[1]: Started Janus WebRTC Server.

we built this version like this:

  1. make clean
  2. ./autogen.sh
  3. ./configure --prefix=/opt/janus --disable-mqtt-event-handler --disable-nanomsg-event-handler --disable-gelf-event-handler --disable-rabbitmq-event-handler --disable-plugin-voicemail --enable-openssl --enable-sample-event-handler CFLAGS="-O1 -g3 -ggdb3 -fno-omit-frame-pointer -fsanitize=address -fno-sanitize-recover=all -fsanitize-address-use-after-scope" LDFLAGS="-fsanitize=address"
  4. make
  5. make install

OS is OS is UB18.04 LTS

We haven't experienced this error in earlier versions we compiled in the same manner.

@karelbrascamp
Copy link
Author

Updated to 18.04.5 LTS, same result.

@lminiero
Copy link
Member

lminiero commented Dec 23, 2020

Looks like a non important leak, in the Nanomsg transport or event handler. Anyway, the trace you shared is incomplete, and not useful I'm afraid: we don't call nn_msgqueue_init anywhere in the code.

@karelbrascamp
Copy link
Author

karelbrascamp commented Dec 23, 2020

Allright, just mentioning it.
When turning off libasan the crash faulty exit doesn't occur. The core dump in case you're interested, although it does't add too much.

@lminiero
Copy link
Member

A memory leak is not a crash: libasan is just mentioning things that weren't freed. Anyway, closing as I can't replicate it: I always have libasan active in my Janus setup, and there's no such leak for Nanomsg plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants