fixed memory leaks.

This commit is contained in:
Martin Preuss
2025-03-23 16:58:07 +01:00
parent ebce002614
commit 52eb92a00c
14 changed files with 292 additions and 7 deletions

View File

@@ -120,8 +120,9 @@ int main(int argc, char **argv)
_runService(aqh, eventLoop); _runService(aqh, eventLoop);
//AqHomeData_Fini(aqh); AqHomeDataServer_Fini(aqh);
AQH_Object_free(aqh); AQH_Object_free(aqh);
AQH_EventLoop_free(eventLoop);
GWEN_Gui_SetGui(NULL); GWEN_Gui_SetGui(NULL);
GWEN_Gui_free(gui); GWEN_Gui_free(gui);

View File

@@ -126,6 +126,7 @@ void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
} }
GWEN_DB_Group_free(xo->dbArgs); GWEN_DB_Group_free(xo->dbArgs);
AQH_Storage_free(xo->storage); AQH_Storage_free(xo->storage);
AQH_MsgRequest_free(xo->requestTree);
free(xo->pidFile); free(xo->pidFile);
GWEN_FREE_OBJECT(xo); GWEN_FREE_OBJECT(xo);
@@ -304,6 +305,24 @@ int _setupIpc(AQH_OBJECT *o, AQHOME_SERVER *xo, GWEN_DB_NODE *dbArgs)
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
* fini
* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
*/
int AqHomeDataServer_Fini(AQH_OBJECT *o)
{
AQHOME_SERVER *xo;
xo=GWEN_INHERIT_GETDATA(AQH_OBJECT, AQHOME_SERVER, o);
if (xo) {
if (xo->pidFile)
remove(xo->pidFile);
}
}
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx /* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
* signal handler * signal handler
* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

View File

@@ -33,6 +33,7 @@
AQH_OBJECT *AqHomeDataServer_new(AQH_EVENT_LOOP *eventLoop); AQH_OBJECT *AqHomeDataServer_new(AQH_EVENT_LOOP *eventLoop);
int AqHomeDataServer_Init(AQH_OBJECT *o, int argc, char **argv); int AqHomeDataServer_Init(AQH_OBJECT *o, int argc, char **argv);
int AqHomeDataServer_Fini(AQH_OBJECT *o);
int AqHomeDataServer_GetTimeout(const AQH_OBJECT *o); int AqHomeDataServer_GetTimeout(const AQH_OBJECT *o);
int AqHomeDataServer_GetClientNum(const AQH_OBJECT *o); int AqHomeDataServer_GetClientNum(const AQH_OBJECT *o);

View File

@@ -130,6 +130,7 @@ int main(int argc, char **argv)
AQH_MqttLogServer_Fini(aqh); AQH_MqttLogServer_Fini(aqh);
AQH_Object_free(aqh); AQH_Object_free(aqh);
AQH_EventLoop_free(eventLoop);
GWEN_Gui_SetGui(NULL); GWEN_Gui_SetGui(NULL);
GWEN_Gui_free(gui); GWEN_Gui_free(gui);

View File

@@ -156,8 +156,15 @@ void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
AQH_Object_free(xo->mqttEndpoint); AQH_Object_free(xo->mqttEndpoint);
AQH_Object_free(xo->brokerEndpoint); AQH_Object_free(xo->brokerEndpoint);
AQHMQTT_Device_List_free(xo->availableDeviceList);
AQHMQTT_Device_List_free(xo->registeredDeviceList);
GWEN_DB_Group_free(xo->dbArgs);
free(xo->deviceFile);
free(xo->pidFile);
free(xo->mqttAddress);
free(xo->mqttClientId);
free(xo->brokerAddress);
free(xo->brokerClientId);
GWEN_FREE_OBJECT(xo); GWEN_FREE_OBJECT(xo);
} }

View File

@@ -115,8 +115,9 @@ int main(int argc, char **argv)
_runService(aqh, eventLoop); _runService(aqh, eventLoop);
//AQH_NodeServer_Fini(aqh); AQH_NodeServer_Fini(aqh);
AQH_Object_free(aqh); AQH_Object_free(aqh);
AQH_EventLoop_free(eventLoop);
GWEN_Gui_SetGui(NULL); GWEN_Gui_SetGui(NULL);
GWEN_Gui_free(gui); GWEN_Gui_free(gui);

View File

@@ -178,6 +178,9 @@ void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
AQH_Object_free(xo->ipcEndpoint); AQH_Object_free(xo->ipcEndpoint);
AQH_Object_free(xo->ttyEndpoint); AQH_Object_free(xo->ttyEndpoint);
AQH_Object_free(xo->brokerEndpoint); AQH_Object_free(xo->brokerEndpoint);
AQHNODE_Device_List_free(xo->deviceDefList);
GWEN_DB_Group_free(xo->dbArgs);
AQH_MsgRequest_free(xo->requestTree);
AQH_NodeDb_free(xo->nodeDb); AQH_NodeDb_free(xo->nodeDb);
free(xo->dbFile); free(xo->dbFile);

View File

@@ -161,6 +161,7 @@ int main(int argc, char **argv)
AQH_ReactServer_Fini(aqh); AQH_ReactServer_Fini(aqh);
AQH_Object_free(aqh); AQH_Object_free(aqh);
AQH_EventLoop_free(eventLoop);
GWEN_Gui_SetGui(NULL); GWEN_Gui_SetGui(NULL);
GWEN_Gui_free(gui); GWEN_Gui_free(gui);

View File

@@ -150,7 +150,13 @@ void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
xo=(AQH_REACT_SERVER*) p; xo=(AQH_REACT_SERVER*) p;
AQH_Object_free(xo->brokerEndpoint); AQH_Object_free(xo->brokerEndpoint);
GWEN_DB_Group_free(xo->dbArgs);
free(xo->pidFile);
free(xo->varsFile);
free(xo->brokerAddress);
free(xo->brokerClientId);
AQHREACT_Unit_List_free(xo->unitList);
AQH_Vars_free(xo->localVars);
GWEN_FREE_OBJECT(xo); GWEN_FREE_OBJECT(xo);
} }

View File

@@ -46,6 +46,7 @@ void AQHREACT_Unit_free(AQHREACT_UNIT *unit)
GWEN_INHERIT_FINI(AQHREACT_UNIT, unit); GWEN_INHERIT_FINI(AQHREACT_UNIT, unit);
free(unit->typeName); free(unit->typeName);
free(unit->description); free(unit->description);
free(unit->id);
AQHREACT_Port_List_free(unit->outputPortList); AQHREACT_Port_List_free(unit->outputPortList);
AQHREACT_Port_List_free(unit->inputPortList); AQHREACT_Port_List_free(unit->inputPortList);
AQHREACT_Param_List_free(unit->paramList); AQHREACT_Param_List_free(unit->paramList);

View File

@@ -246,8 +246,12 @@ int _hasDateChanged(AQHREACT_UNIT *unit)
GWEN_DATE *today; GWEN_DATE *today;
today=GWEN_Date_CurrentDate(); today=GWEN_Date_CurrentDate();
if (GWEN_Date_Compare(today, xunit->date)!=0)
if (GWEN_Date_Compare(today, xunit->date)!=0) {
GWEN_Date_free(today);
return 1; return 1;
}
GWEN_Date_free(today);
} }
} }

238
aqhome-react.vg Normal file
View File

@@ -0,0 +1,238 @@
==2732905== Memcheck, a memory error detector
==2732905== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==2732905== Using Valgrind-3.19.0-8d3c8034b8-20220411 and LibVEX; rerun with -h for copyright info
==2732905== Command: 0-build/apps/aqhome-react/aqhome-react -p ./aqhome-react.pid -V ./aqhome-react.vars -ba 127.0.0.1 -T 350
==2732905== Parent PID: 2732904
==2732905==
--2732905--
--2732905-- Valgrind options:
--2732905-- --tool=memcheck
--2732905-- --trace-children=yes
--2732905-- -v
--2732905-- --log-file=aqhome-react.vg
--2732905-- --leak-check=full
--2732905-- --show-reachable=yes
--2732905-- --track-origins=yes
--2732905-- --num-callers=50
--2732905-- --keep-stacktraces=alloc-and-free
--2732905-- Contents of /proc/version:
--2732905-- Linux version 6.1.0-31-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07)
--2732905--
--2732905-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand-rdseed
--2732905-- Page sizes: currently 4096, max supported 4096
--2732905-- Valgrind library directory: /usr/libexec/valgrind
--2732905-- Reading syms from /home/martin/projekte/c/0_current/hausbus/aqhome/0-build/apps/aqhome-react/aqhome-react
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
--2732905-- Considering /usr/lib/debug/.build-id/f4/bc47db467906580a47640e01e6d901e2642a7b.debug ..
--2732905-- .. build-id is valid
--2732905-- Reading syms from /usr/libexec/valgrind/memcheck-amd64-linux
--2732905-- Considering /usr/lib/debug/.build-id/82/26c2aa6b808ebd5a6fafb694a7fb3287f33590.debug ..
--2732905-- .. build-id is valid
--2732905-- object doesn't have a dynamic symbol table
--2732905-- Scheduler: using generic scheduler lock implementation.
--2732905-- Reading suppressions file: /usr/libexec/valgrind/default.supp
==2732905== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2732905-by-martin-on-???
==2732905== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-2732905-by-martin-on-???
==2732905== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-2732905-by-martin-on-???
==2732905==
==2732905== TO CONTROL THIS PROCESS USING vgdb (which you probably
==2732905== don't want to do, unless you know exactly what you're doing,
==2732905== or are doing some strange experiment):
==2732905== /usr/bin/vgdb --pid=2732905 ...command...
==2732905==
==2732905== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==2732905== /path/to/gdb 0-build/apps/aqhome-react/aqhome-react
==2732905== and then give GDB the following command
==2732905== target remote | /usr/bin/vgdb --pid=2732905
==2732905== --pid is optional if only one valgrind process is running
==2732905==
--2732905-- REDIR: 0x40238e0 (ld-linux-x86-64.so.2:strlen) redirected to 0x580bb0e2 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--2732905-- REDIR: 0x40220c0 (ld-linux-x86-64.so.2:index) redirected to 0x580bb0fc (vgPlain_amd64_linux_REDIR_FOR_index)
--2732905-- Reading syms from /usr/libexec/valgrind/vgpreload_core-amd64-linux.so
--2732905-- Considering /usr/lib/debug/.build-id/ad/f1388be4d8781737b0c83fe111a5a9c6e930aa.debug ..
--2732905-- .. build-id is valid
--2732905-- Reading syms from /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so
--2732905-- Considering /usr/lib/debug/.build-id/d8/ec66cffcb23a75c3f15940674d6028709121f8.debug ..
--2732905-- .. build-id is valid
==2732905== WARNING: new redirection conflicts with existing -- ignoring it
--2732905-- old: 0x040238e0 (strlen ) R-> (0000.0) 0x580bb0e2 vgPlain_amd64_linux_REDIR_FOR_strlen
--2732905-- new: 0x040238e0 (strlen ) R-> (2007.0) 0x048468a0 strlen
--2732905-- REDIR: 0x40222e0 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4847780 (strcmp)
--2732905-- REDIR: 0x4021550 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x484b1a0 (mempcpy)
--2732905-- Reading syms from /home/martin/projekte/c/0_current/hausbus/aqhome/0-build/aqhome/libaqhome.so.0.0.8
--2732905-- Reading syms from /usr/local/lib/libgwenhywfar.so.79.12.0
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libm.so.6
--2732905-- Considering /usr/lib/debug/.build-id/6d/201df2cb50847f0ed42da4158c3a608d578f03.debug ..
--2732905-- .. build-id is valid
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libc.so.6
--2732905-- Considering /usr/lib/debug/.build-id/c0/47672cae7964324658491e7dee26748ae5d2f8.debug ..
--2732905-- .. build-id is valid
==2732905== WARNING: new redirection conflicts with existing -- ignoring it
--2732905-- old: 0x04bad5d0 (memalign ) R-> (1011.0) 0x04845bc0 memalign
--2732905-- new: 0x04bad5d0 (memalign ) R-> (1017.0) 0x04845b90 aligned_alloc
==2732905== WARNING: new redirection conflicts with existing -- ignoring it
--2732905-- old: 0x04bad5d0 (memalign ) R-> (1011.0) 0x04845bc0 memalign
--2732905-- new: 0x04bad5d0 (memalign ) R-> (1017.0) 0x04845b60 aligned_alloc
==2732905== WARNING: new redirection conflicts with existing -- ignoring it
--2732905-- old: 0x04bad5d0 (memalign ) R-> (1011.0) 0x04845bc0 memalign
--2732905-- new: 0x04bad5d0 (memalign ) R-> (1017.0) 0x04845b90 aligned_alloc
==2732905== WARNING: new redirection conflicts with existing -- ignoring it
--2732905-- old: 0x04bad5d0 (memalign ) R-> (1011.0) 0x04845bc0 memalign
--2732905-- new: 0x04bad5d0 (memalign ) R-> (1017.0) 0x04845b60 aligned_alloc
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libgpg-error.so.0.33.1
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libgnutls.so.30.34.3
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.3.0
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libidn2.so.0.3.8
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libunistring.so.2.2.0
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libtasn1.so.6.6.3
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libnettle.so.8.6
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libhogweed.so.6.6
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1
--2732905-- object doesn't have a symbol table
--2732905-- Reading syms from /usr/lib/x86_64-linux-gnu/libffi.so.8.1.2
--2732905-- object doesn't have a symbol table
--2732905-- REDIR: 0x4bb3510 (libc.so.6:strnlen) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb35a0 (libc.so.6:strpbrk) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb16c0 (libc.so.6:strcmp) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bc64a0 (libc.so.6:wcsnlen) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0800 (libc.so.6:memset) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bc4de0 (libc.so.6:wcslen) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bafe30 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bc4c10 (libc.so.6:wcschr) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb15b0 (libc.so.6:index) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb35d0 (libc.so.6:rindex) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bc4ca0 (libc.so.6:wcscmp) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0a40 (libc.so.6:stpncpy) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bc51f0 (libc.so.6:wmemchr) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb33c0 (libc.so.6:strncmp) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0ab0 (libc.so.6:strcasecmp) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb2920 (libc.so.6:strcspn) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bc4d30 (libc.so.6:wcscpy) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb1530 (libc.so.6:strcat) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb32b0 (libc.so.6:strncasecmp_l) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bafd40 (libc.so.6:bcmp) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0770 (libc.so.6:memrchr) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb1630 (libc.so.6:strchrnul) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb28a0 (libc.so.6:strcpy) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0b50 (libc.so.6:strcasecmp_l) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb3180 (libc.so.6:strlen) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb3460 (libc.so.6:strncpy) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb09c0 (libc.so.6:stpcpy) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0550 (libc.so.6:memmove) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
==2732905== Preferring higher priority redirection:
--2732905-- old: 0x04c66940 (__memcpy_avx_unalign) R-> (2018.0) 0x04848a60 __memcpy_avx_unaligned_erms
--2732905-- new: 0x04c66940 (__memcpy_avx_unalign) R-> (2018.1) 0x0484a2b0 memmove
--2732905-- REDIR: 0x4bafcc0 (libc.so.6:memchr) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb3790 (libc.so.6:strspn) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0660 (libc.so.6:mempcpy) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb3210 (libc.so.6:strncasecmp) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb0900 (libc.so.6:rawmemchr) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4bb3350 (libc.so.6:strncat) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4c2a050 (libc.so.6:__memcpy_chk) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
--2732905-- REDIR: 0x4c2a160 (libc.so.6:__memmove_chk) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
==2732905== WARNING: new redirection conflicts with existing -- ignoring it
--2732905-- old: 0x04c66900 (__memcpy_chk_avx_una) R-> (2030.0) 0x0484b290 __memcpy_chk
--2732905-- new: 0x04c66900 (__memcpy_chk_avx_una) R-> (2024.0) 0x0484ac30 __memmove_chk
--2732905-- REDIR: 0x4bb3f30 (libc.so.6:strstr) redirected to 0x48371b0 (_vgnU_ifunc_wrapper)
==2732905== WARNING: new redirection conflicts with existing -- ignoring it
--2732905-- old: 0x04c66900 (__memcpy_chk_avx_una) R-> (2030.0) 0x0484b290 __memcpy_chk
--2732905-- new: 0x04c66900 (__memcpy_chk_avx_una) R-> (2024.0) 0x0484ac30 __memmove_chk
--2732905-- REDIR: 0x4c6ca10 (libc.so.6:__strrchr_avx2) redirected to 0x48462e0 (rindex)
--2732905-- REDIR: 0x4c6a0c0 (libc.so.6:__strlen_avx2) redirected to 0x4846780 (strlen)
--2732905-- REDIR: 0x4c661e0 (libc.so.6:__memcmp_avx2_movbe) redirected to 0x4849aa0 (bcmp)
--2732905-- REDIR: 0x4c6b790 (libc.so.6:__strncmp_avx2) redirected to 0x4846ed0 (strncmp)
--2732905-- REDIR: 0x4c693a0 (libc.so.6:__strchr_avx2) redirected to 0x4846460 (index)
--2732905-- REDIR: 0x4c697d0 (libc.so.6:__strcmp_avx2) redirected to 0x4847680 (strcmp)
--2732905-- REDIR: 0x4bac8f0 (libc.so.6:malloc) redirected to 0x4840740 (malloc)
--2732905-- REDIR: 0x4c66940 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x484a2b0 (memmove)
--2732905-- REDIR: 0x4bad6a0 (libc.so.6:calloc) redirected to 0x4845540 (calloc)
--2732905-- REDIR: 0x4c66900 (libc.so.6:__memcpy_chk_avx_unaligned_erms) redirected to 0x484b290 (__memcpy_chk)
--2732905-- REDIR: 0x4baceb0 (libc.so.6:free) redirected to 0x4843110 (free)
--2732905-- REDIR: 0x4c68320 (libc.so.6:__strcasecmp_avx2) redirected to 0x4847050 (strcasecmp)
--2732905-- REDIR: 0x4c65f40 (libc.so.6:__memchr_avx2) redirected to 0x4847800 (memchr)
--2732905-- REDIR: 0x4bc41b0 (libc.so.6:__strstr_sse2_unaligned) redirected to 0x484b3a0 (strstr)
--2732905-- REDIR: 0x4bad0f0 (libc.so.6:realloc) redirected to 0x48457b0 (realloc)
--2732905-- REDIR: 0x4c67480 (libc.so.6:__rawmemchr_avx2) redirected to 0x484acd0 (rawmemchr)
--2732905-- REDIR: 0x4c695e0 (libc.so.6:__strchrnul_avx2) redirected to 0x484aca0 (strchrnul)
--2732905-- REDIR: 0x4c668f0 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x484adb0 (mempcpy)
--2732905-- REDIR: 0x4c67340 (libc.so.6:__memset_avx2_unaligned_erms) redirected to 0x484a1c0 (memset)
--2732905-- REDIR: 0x4c675e0 (libc.so.6:__stpcpy_avx2) redirected to 0x4849b60 (stpcpy)
--2732905-- REDIR: 0x4c6c740 (libc.so.6:__strnlen_avx2) redirected to 0x4846720 (strnlen)
==2732905==
==2732905== HEAP SUMMARY:
==2732905== in use at exit: 192 bytes in 12 blocks
==2732905== total heap usage: 8,221 allocs, 8,209 frees, 1,218,973 bytes allocated
==2732905==
==2732905== Searching for pointers to 12 not-freed blocks
==2732905== Checked 279,376 bytes
==2732905==
==2732905== 48 bytes in 6 blocks are still reachable in loss record 1 of 2
==2732905== at 0x48407B4: malloc (vg_replace_malloc.c:381)
==2732905== by 0x4D323C0: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D33B9F: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4E112D6: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D32339: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D333DE: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D2E788: gcry_control (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4943601: GWEN_Crypt3_ModuleInit (cryptkey.c:36)
==2732905== by 0x49234C9: GWEN_Init (gwenhywfar.c:265)
==2732905== by 0x4921F98: GWEN_LibInit (init.c:48)
==2732905== by 0x40049CD: call_init (dl-init.c:74)
==2732905== by 0x40049CD: call_init (dl-init.c:26)
==2732905== by 0x4004AB3: _dl_init (dl-init.c:121)
==2732905== by 0x401AA7F: ??? (in /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
==2732905== by 0x8: ???
==2732905== by 0x1FFF000212: ???
==2732905== by 0x1FFF000239: ???
==2732905== by 0x1FFF00023C: ???
==2732905== by 0x1FFF00024F: ???
==2732905== by 0x1FFF000252: ???
==2732905== by 0x1FFF000266: ???
==2732905== by 0x1FFF00026A: ???
==2732905== by 0x1FFF000274: ???
==2732905== by 0x1FFF000277: ???
==2732905==
==2732905== 144 bytes in 6 blocks are still reachable in loss record 2 of 2
==2732905== at 0x48407B4: malloc (vg_replace_malloc.c:381)
==2732905== by 0x4D323C0: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D33B9F: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4E112C9: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D32339: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D333DE: ??? (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4D2E788: gcry_control (in /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1)
==2732905== by 0x4943601: GWEN_Crypt3_ModuleInit (cryptkey.c:36)
==2732905== by 0x49234C9: GWEN_Init (gwenhywfar.c:265)
==2732905== by 0x4921F98: GWEN_LibInit (init.c:48)
==2732905== by 0x40049CD: call_init (dl-init.c:74)
==2732905== by 0x40049CD: call_init (dl-init.c:26)
==2732905== by 0x4004AB3: _dl_init (dl-init.c:121)
==2732905== by 0x401AA7F: ??? (in /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
==2732905== by 0x8: ???
==2732905== by 0x1FFF000212: ???
==2732905== by 0x1FFF000239: ???
==2732905== by 0x1FFF00023C: ???
==2732905== by 0x1FFF00024F: ???
==2732905== by 0x1FFF000252: ???
==2732905== by 0x1FFF000266: ???
==2732905== by 0x1FFF00026A: ???
==2732905== by 0x1FFF000274: ???
==2732905== by 0x1FFF000277: ???
==2732905==
==2732905== LEAK SUMMARY:
==2732905== definitely lost: 0 bytes in 0 blocks
==2732905== indirectly lost: 0 bytes in 0 blocks
==2732905== possibly lost: 0 bytes in 0 blocks
==2732905== still reachable: 192 bytes in 12 blocks
==2732905== suppressed: 0 bytes in 0 blocks
==2732905==
==2732905== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

View File

@@ -35,6 +35,7 @@ void AQH_EventLoop_free(AQH_EVENT_LOOP *eventLoop)
if (eventLoop) { if (eventLoop) {
AQH_Object_List2_free(eventLoop->timerObjectList); AQH_Object_List2_free(eventLoop->timerObjectList);
AQH_Object_List2_free(eventLoop->fdObjectList); AQH_Object_List2_free(eventLoop->fdObjectList);
GWEN_FREE_OBJECT(eventLoop);
} }
} }

View File

@@ -87,6 +87,7 @@ void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
if (xo->fdObject) { if (xo->fdObject) {
AQH_Object_Disable(xo->fdObject); AQH_Object_Disable(xo->fdObject);
AQH_Object_free(xo->fdObject); AQH_Object_free(xo->fdObject);
GWEN_RingBuffer_free(xo->ringBuffer);
xo->fdObject=NULL; xo->fdObject=NULL;
} }
GWEN_FREE_OBJECT(xo); GWEN_FREE_OBJECT(xo);
@@ -379,7 +380,7 @@ int AQH_MsgReader_ReadRemainderFromRingbuffer(AQH_OBJECT *o)
} }
} }
else { else {
DBG_ERROR(AQH_LOGDOMAIN, "Nothing to read??"); DBG_INFO(AQH_LOGDOMAIN, "Nothing to read??");
} }
} }
return 0; return 0;