Skip to content

Commit 981b4ff

Browse files
committed
[#393] Add Valgrind Support
- Added suppression rules in contrib/valgrind/pgagroal.supp file - Added README page for valgrind support - Modified AUTHORS file
1 parent 9012b55 commit 981b4ff

File tree

3 files changed

+285
-0
lines changed

3 files changed

+285
-0
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Luca Ferrari <fluca1978@gmail.com>
88
Nikita Bugrovsky <nbugrovs@redhat.com>
99
Lawrence Wu <lawrence910426@gmail.com>
1010
Yongting You <2010youy01@gmail.com>
11+
Ashutosh Sharma <ash2003sharma@gmail.com>

contrib/valgrind/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Valgrind
2+
3+
The [Valgrind](https://valgrind.org/) tool suite provides a number of debugging and profiling tools that help you make your programs faster and more correct. The most popular and the default of these tools is called **Memcheck**. It can detect many memory-related errors that can lead to crashes and unpredictable behaviour.
4+
5+
# Run memory management detection
6+
7+
``` bash
8+
valgrind --leak-check=full --show-leak-kinds=all --log-file=%p.log --trace-children=yes --track-origins=yes --read-var-info=yes ./pgagroal -c pgagroal.conf -a pgagroal_hba.conf
9+
```
10+
11+
# Generate valgrind report with suppressed rules
12+
13+
``` bash
14+
valgrind --suppressions=../../contrib/valgrind/pgagroal.supp --leak-check=full --show-leak-kinds=all --log-file=%p.log --trace-children=yes --track-origins=yes --read-var-info=yes ./pgagroal -c pgagroal.conf -a pgagroal_hba.conf
15+
```
16+

contrib/valgrind/pgagroal.supp

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
#
2+
# pgagroal rules
3+
#
4+
5+
{
6+
pgagroal_bind_host
7+
Memcheck:Leak
8+
match-leak-kinds: reachable
9+
fun:calloc
10+
fun:bind_host
11+
fun:pgagroal_bind
12+
fun:main
13+
}
14+
15+
{
16+
pgagroal_set_proc_title_calloc
17+
Memcheck:Leak
18+
match-leak-kinds: indirect
19+
fun:calloc
20+
fun:pgagroal_set_proc_title
21+
fun:main
22+
}
23+
24+
{
25+
pgagroal_set_proc_title_malloc
26+
Memcheck:Leak
27+
match-leak-kinds: definite
28+
fun:malloc
29+
fun:pgagroal_set_proc_title
30+
fun:main
31+
}
32+
33+
#
34+
# non-pgagroal rules
35+
#
36+
37+
{
38+
dl_open_malloc_inline
39+
Memcheck:Leak
40+
match-leak-kinds: reachable
41+
fun:malloc
42+
fun:UnknownInlinedFun
43+
fun:_dl_new_object
44+
fun:_dl_map_object_from_fd
45+
fun:_dl_map_object
46+
fun:dl_open_worker_begin
47+
fun:_dl_catch_exception
48+
fun:dl_open_worker
49+
fun:_dl_catch_exception
50+
fun:_dl_open
51+
fun:dlopen_doit
52+
fun:_dl_catch_exception
53+
fun:_dl_catch_error
54+
}
55+
56+
{
57+
dl_open_calloc
58+
Memcheck:Leak
59+
match-leak-kinds: reachable
60+
fun:calloc
61+
fun:UnknownInlinedFun
62+
fun:_dl_check_map_versions
63+
fun:dl_open_worker_begin
64+
fun:_dl_catch_exception
65+
fun:dl_open_worker
66+
fun:_dl_catch_exception
67+
fun:_dl_open
68+
fun:dlopen_doit
69+
fun:_dl_catch_exception
70+
fun:_dl_catch_error
71+
fun:_dlerror_run
72+
fun:UnknownInlinedFun
73+
fun:dlopen@@GLIBC_2.34
74+
}
75+
76+
{
77+
dl_open_calloc_inline
78+
Memcheck:Leak
79+
match-leak-kinds: reachable
80+
fun:calloc
81+
fun:UnknownInlinedFun
82+
fun:_dl_new_object
83+
fun:_dl_map_object_from_fd
84+
fun:_dl_map_object
85+
fun:dl_open_worker_begin
86+
fun:_dl_catch_exception
87+
fun:dl_open_worker
88+
fun:_dl_catch_exception
89+
fun:_dl_open
90+
fun:dlopen_doit
91+
fun:_dl_catch_exception
92+
fun:_dl_catch_error
93+
}
94+
95+
{
96+
dl_open_worker_malloc
97+
Memcheck:Leak
98+
match-leak-kinds: reachable
99+
fun:malloc
100+
fun:malloc
101+
fun:strdup
102+
fun:_dl_map_object
103+
fun:dl_open_worker_begin
104+
fun:_dl_catch_exception
105+
fun:dl_open_worker
106+
fun:_dl_catch_exception
107+
fun:_dl_open
108+
fun:dlopen_doit
109+
fun:_dl_catch_exception
110+
fun:_dl_catch_error
111+
fun:_dlerror_run
112+
}
113+
114+
115+
{
116+
ev_loop_timers_realloc
117+
Memcheck:Leak
118+
match-leak-kinds: reachable
119+
fun:realloc
120+
fun:ev_realloc
121+
fun:feed_reverse
122+
fun:timers_reify
123+
fun:ev_run.cold
124+
fun:ev_loop
125+
fun:main
126+
}
127+
128+
{
129+
ev_io_realloc
130+
Memcheck:Leak
131+
match-leak-kinds: reachable
132+
fun:realloc
133+
fun:ev_realloc
134+
fun:fd_change
135+
fun:ev_io_start.cold
136+
fun:evtimerfd_init
137+
fun:ev_periodic_start.cold
138+
fun:main
139+
}
140+
141+
{
142+
ev_io_management_realloc
143+
Memcheck:Leak
144+
match-leak-kinds: reachable
145+
fun:realloc
146+
fun:ev_realloc
147+
fun:ev_io_start.cold
148+
fun:start_management
149+
fun:main
150+
}
151+
152+
{
153+
ev_io_uds_realloc
154+
Memcheck:Leak
155+
match-leak-kinds: reachable
156+
fun:realloc
157+
fun:ev_realloc
158+
fun:ev_io_start.cold
159+
fun:start_uds
160+
fun:main
161+
}
162+
163+
{
164+
ev_io_metrics_realloc
165+
Memcheck:Leak
166+
match-leak-kinds: reachable
167+
fun:realloc
168+
fun:ev_realloc
169+
fun:ev_io_start.cold
170+
fun:start_metrics
171+
fun:main
172+
}
173+
174+
{
175+
ev_fd_change_realloc
176+
Memcheck:Leak
177+
match-leak-kinds: reachable
178+
fun:realloc
179+
fun:ev_realloc
180+
fun:fd_change
181+
fun:ev_io_start.cold
182+
fun:main
183+
}
184+
185+
{
186+
ev_periodics_start_realloc
187+
Memcheck:Leak
188+
match-leak-kinds: reachable
189+
fun:malloc
190+
fun:realloc
191+
fun:ev_realloc
192+
fun:ev_periodic_start.cold
193+
fun:main
194+
}
195+
196+
{
197+
ev_loop_evpipe_realloc
198+
Memcheck:Leak
199+
match-leak-kinds: reachable
200+
fun:malloc
201+
fun:realloc
202+
fun:ev_realloc
203+
fun:ev_io_start.cold
204+
fun:evpipe_init
205+
fun:ev_signal_start.cold
206+
fun:ev_default_loop
207+
fun:main
208+
}
209+
210+
{
211+
ev_loop_epoll_realloc
212+
Memcheck:Leak
213+
match-leak-kinds: reachable
214+
fun:malloc
215+
fun:realloc
216+
fun:ev_realloc
217+
fun:epoll_init
218+
fun:epoll_init.isra.0
219+
fun:loop_init
220+
fun:ev_default_loop
221+
fun:main
222+
}
223+
224+
{
225+
ev_run_feed_event_realloc
226+
Memcheck:Leak
227+
match-leak-kinds: reachable
228+
fun:malloc
229+
fun:realloc
230+
fun:ev_realloc
231+
fun:ev_feed_event.cold
232+
fun:fd_event_nocheck
233+
fun:fd_event
234+
fun:epoll_poll
235+
fun:ev_run
236+
fun:ev_run
237+
fun:ev_loop
238+
fun:main
239+
}
240+
241+
{
242+
ev_invoke_pending_realloc
243+
Memcheck:Leak
244+
match-leak-kinds: reachable
245+
fun:malloc
246+
fun:add_client
247+
fun:accept_main_cb
248+
fun:ev_invoke_pending
249+
fun:ev_run
250+
fun:ev_run
251+
fun:ev_loop
252+
fun:main
253+
}
254+
255+
{
256+
ev_periodics_realloc
257+
Memcheck:Leak
258+
match-leak-kinds: reachable
259+
fun:malloc
260+
fun:realloc
261+
fun:ev_realloc
262+
fun:feed_reverse
263+
fun:periodics_reify
264+
fun:ev_run
265+
fun:ev_run.cold
266+
fun:ev_loop
267+
fun:main
268+
}

0 commit comments

Comments
 (0)