On Fri, Nov 26, 2021 at 01:03:40PM +0100, Dominik Vogt wrote:
> Stuck with this one, ideas welcome:
>
> On Wed, Nov 24, 2021 at 03:22:54PM +0100, Dominik Vogt wrote:
> > ==8482== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost
> > in loss record 184 of 536
> > ==8482==at 0x48386AF: malloc (in
> > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
> > ==8482==by 0x483ADE7: realloc (in
> > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
> > ==8482==by 0x4CE950B: XCreateFontSet (in
> > /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0)
> > ==8482==by 0x18EB64: FlocaleGetFontSet (Flocale.c:1152)
> > ==8482==by 0x18FD81: FlocaleGetFontOrFontSet (Flocale.c:1302)
> > ==8482==by 0x18FD81: FlocaleLoadFont (Flocale.c:1479)
> > ==8482==by 0x14A314: CMD_DefaultFont (builtins.c:3160)
It seems this is a bug in libx11-1.7.2. The attached simple test
program also has the leak.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
#include
#include
#include
#include
#define FN "7x13"
int main(int argc, char **argv)
{
Display *dpy;
int i;
char *locale;
locale = setlocale(LC_CTYPE, "");
assert(locale);
dpy = XOpenDisplay(":0");
assert(dpy);
for (i = 0; i < 10; i++)
{
XFontSet fs;
char **ml;
int mc;
fs = XCreateFontSet(dpy, FN, &ml, &mc, NULL);
if (fs)
{
if (ml)
XFreeStringList(ml);
XFreeFontSet(dpy, fs);
}
}
exit(0);
}