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

Added suppression rules and suppressions file to contrib/valgrind #393

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Luca Ferrari <[email protected]>
Nikita Bugrovsky <[email protected]>
Lawrence Wu <[email protected]>
Yongting You <[email protected]>
Ashutosh Sharma <[email protected]>
16 changes: 16 additions & 0 deletions contrib/valgrind/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Valgrind

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.

# Run memory management detection

``` bash
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
```

# Generate valgrind report with suppressed rules

``` bash
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
```

268 changes: 268 additions & 0 deletions contrib/valgrind/pgagroal.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
#
# pgagroal rules
#

{
pgagroal_bind_host
Memcheck:Leak
match-leak-kinds: reachable
fun:calloc
fun:bind_host
fun:pgagroal_bind
fun:main
}

{
pgagroal_set_proc_title_calloc
Memcheck:Leak
match-leak-kinds: indirect
fun:calloc
fun:pgagroal_set_proc_title
fun:main
}

{
pgagroal_set_proc_title_malloc
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:pgagroal_set_proc_title
fun:main
}

#
# non-pgagroal rules
#

{
dl_open_malloc_inline
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:UnknownInlinedFun
fun:_dl_new_object
fun:_dl_map_object_from_fd
fun:_dl_map_object
fun:dl_open_worker_begin
fun:_dl_catch_exception
fun:dl_open_worker
fun:_dl_catch_exception
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_exception
fun:_dl_catch_error
}

{
dl_open_calloc
Memcheck:Leak
match-leak-kinds: reachable
fun:calloc
fun:UnknownInlinedFun
fun:_dl_check_map_versions
fun:dl_open_worker_begin
fun:_dl_catch_exception
fun:dl_open_worker
fun:_dl_catch_exception
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_exception
fun:_dl_catch_error
fun:_dlerror_run
fun:UnknownInlinedFun
fun:dlopen@@GLIBC_2.34
}

{
dl_open_calloc_inline
Memcheck:Leak
match-leak-kinds: reachable
fun:calloc
fun:UnknownInlinedFun
fun:_dl_new_object
fun:_dl_map_object_from_fd
fun:_dl_map_object
fun:dl_open_worker_begin
fun:_dl_catch_exception
fun:dl_open_worker
fun:_dl_catch_exception
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_exception
fun:_dl_catch_error
}

{
dl_open_worker_malloc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:malloc
fun:strdup
fun:_dl_map_object
fun:dl_open_worker_begin
fun:_dl_catch_exception
fun:dl_open_worker
fun:_dl_catch_exception
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_exception
fun:_dl_catch_error
fun:_dlerror_run
}


{
ev_loop_timers_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:ev_realloc
fun:feed_reverse
fun:timers_reify
fun:ev_run.cold
fun:ev_loop
fun:main
}

{
ev_io_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:ev_realloc
fun:fd_change
fun:ev_io_start.cold
fun:evtimerfd_init
fun:ev_periodic_start.cold
fun:main
}

{
ev_io_management_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:ev_realloc
fun:ev_io_start.cold
fun:start_management
fun:main
}

{
ev_io_uds_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:ev_realloc
fun:ev_io_start.cold
fun:start_uds
fun:main
}

{
ev_io_metrics_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:ev_realloc
fun:ev_io_start.cold
fun:start_metrics
fun:main
}

{
ev_fd_change_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:ev_realloc
fun:fd_change
fun:ev_io_start.cold
fun:main
}

{
ev_periodics_start_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:realloc
fun:ev_realloc
fun:ev_periodic_start.cold
fun:main
}

{
ev_loop_evpipe_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:realloc
fun:ev_realloc
fun:ev_io_start.cold
fun:evpipe_init
fun:ev_signal_start.cold
fun:ev_default_loop
fun:main
}

{
ev_loop_epoll_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:realloc
fun:ev_realloc
fun:epoll_init
fun:epoll_init.isra.0
fun:loop_init
fun:ev_default_loop
fun:main
}

{
ev_run_feed_event_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:realloc
fun:ev_realloc
fun:ev_feed_event.cold
fun:fd_event_nocheck
fun:fd_event
fun:epoll_poll
fun:ev_run
fun:ev_run
fun:ev_loop
fun:main
}

{
ev_invoke_pending_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:add_client
fun:accept_main_cb
fun:ev_invoke_pending
fun:ev_run
fun:ev_run
fun:ev_loop
fun:main
}

{
ev_periodics_realloc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:realloc
fun:ev_realloc
fun:feed_reverse
fun:periodics_reify
fun:ev_run
fun:ev_run.cold
fun:ev_loop
fun:main
}
Loading