emilk / emilk/loguru

Valgrind memory loss reported for call to pthread_setspecific

Open
#209 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
280
Avg merge
7m
Merged PRs (30d)
4

Description

Good morning,

In a program that uses VTK (see https://gitlab.kitware.com/vtk/vtk) loguru is used as third party logging for VTK. When I run a program that uses VTK and loguru through valgrind, I see the following:

```
==2056936== 8 bytes in 1 blocks are definitely lost in loss record 5 of 20,285
==2056936== at 0x64E50A5: malloc (vg_replace_malloc.c:380)
==2056936== by 0x1512E80D: strdup (in /usr/lib64/libc-2.28.so)
==2056936== by 0x329F8C77: vtkloguru::set_thread_name(char const*) (loguru.cpp:923)
```

It looks like the string passed to `pthread_setspecific` to set the thread name is duplicated with STRDUP, but never freed. Currently this is on line 1033 in loguru.cpp.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.