then type shutdown. Then the accel-pppd will crash due to memory leaks. Here is the ASAN report:
=================================================================
==555172==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 36720 byte(s) in 1530 object(s) allocated from:
#0 0x49a9fd in malloc /home/brian/src/llvm_releases/llvm-project/llvm/utils/release/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
#1 0x7f84d9f0579e in add_range /root/projects/accel-ppp/accel-pppd/extra/ippool.c:176:8
#2 0x7f84d9f04107 in ippool_init2 /root/projects/accel-ppp/accel-pppd/extra/ippool.c:642:5
#3 0x7f84dd58e63d in triton_load_modules /root/projects/accel-ppp/accel-pppd/triton/triton.c:704:3
#4 0x547018 in main /root/projects/accel-ppp/accel-pppd/main.c:402:6
#5 0x7f84dce280b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
Direct leak of 640 byte(s) in 4 object(s) allocated from:
#0 0x49a9fd in malloc /home/brian/src/llvm_releases/llvm-project/llvm/utils/release/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
#1 0x7f84dd58ae3a in create_thread /root/projects/accel-ppp/accel-pppd/triton/triton.c:302:36
#2 0x7f84dd58e987 in triton_run /root/projects/accel-ppp/accel-pppd/triton/triton.c:744:7
#3 0x54704d in main /root/projects/accel-ppp/accel-pppd/main.c:407:2
#4 0x7f84dce280b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
SUMMARY: AddressSanitizer: 37360 byte(s) leaked in 1534 allocation(s).
There are some memery leak bugs.
The memory allocated to
pool
inippool_init2
is not free when exits. https://github.com/xebd/accel-ppp/blob/ff91c7376f2a6200be7ea90d36411e1acb4cd9c8/accel-pppd/extra/ippool.c#L602-L666Similarly, the memory allocated to
threads
is not free when exits or reloads the configure file https://github.com/xebd/accel-ppp/blob/ff91c7376f2a6200be7ea90d36411e1acb4cd9c8/accel-pppd/triton/triton.c#L22 reload code: https://github.com/xebd/accel-ppp/blob/ff91c7376f2a6200be7ea90d36411e1acb4cd9c8/accel-pppd/triton/triton.c#L66-L81Steps to reproduce(for example)
access-pppd
The running configuration
/etc/accel-ppp.conf
is (which is not important for reproducing):127.0.0.1:2001
usingnc
:then type
shutdown
. Then theaccel-pppd
will crash due to memory leaks. Here is the ASAN report: