Forgot to attach ...
Description: Avoid crash when there too many windows open to draw at least one char.

Author: Bernhard Übelacker <bernha...@mailbox.org>

Bug-Debian: https://bugs.debian.org/887468
Forwarded: no
Last-Update: 2018-08-07

--- hpanel-0.3.2.orig/hpanel.c
+++ hpanel-0.3.2/hpanel.c
@@ -588,7 +588,7 @@ gui_draw_task (task *tk)
 
 		/* check how many chars can fit */
 		len = strlen (tk->name);
-		while (1)
+		while (len > 0)
 		{
 			XftTextExtents8 (dd, xfs, tk->name, len, &ext);
 			if (ext.width < taskw - (text_x - x) - 2 && len > 0)

apt update
apt install xserver-xorg lightdm openbox pulseaudio xterm psmisc htop mc tmux 
strace dpkg-dev devscripts quilt gdb valgrind systemd-coredump dh-buildinfo
apt install hpanel libxft2-dbgsym libx11-6-dbgsym
apt build-dep hpanel



benutzer@debian:~/hpanel$ wget 
"https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=887468;filename=core;msg=15";
 -O core


directory /home/benutzer/libxft2/orig/xft-2.3.2/debian/source






benutzer@debian:~/hpanel$ gdb -q /usr/bin/hpanel --core core
Reading symbols from /usr/bin/hpanel...(no debugging symbols found)...done.
[New LWP 136993]

warning: Unexpected size of section `.reg-xstate/136993' in core file.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/bin/hpanel'.
Program terminated with signal SIGSEGV, Segmentation fault.

warning: Unexpected size of section `.reg-xstate/136993' in core file.
#0  0x00007fa70cd1b354 in XftGlyphExtents () from 
/usr/lib/x86_64-linux-gnu/libXft.so.2
(gdb) bt
#0  0x00007fa70cd1b354 in XftGlyphExtents () from 
/usr/lib/x86_64-linux-gnu/libXft.so.2
#1  0x00007fa70cd1b64c in XftTextExtents8 () from 
/usr/lib/x86_64-linux-gnu/libXft.so.2
#2  0x0000556790e9a2a2 in ?? ()
#3  0x0000556790e9aade in ?? ()
#4  0x0000556790e9b274 in ?? ()
#5  0x0000556790e99355 in main ()






set width 0
set height 0
set pagination off
directory /home/benutzer/hpanel/orig/hpanel-0.3.2
directory /home/benutzer/libx11/orig/libx11-1.6.5/src/util
directory /home/benutzer/libxft2/orig/xft-2.3.2
directory /home/benutzer/libxft2/orig/xft-2.3.2/include/X11




(gdb) bt full
#0  0x00007fa70cd1b354 in XftGlyphExtents (dpy=dpy@entry=0x556791913010, 
pub=pub@entry=0x556791957770, glyphs=glyphs@entry=0x7ffe32446780, 
nglyphs=nglyphs@entry=-1, extents=extents@entry=0x7ffe32447830) at 
../../src/xftextent.c:50
        font = 0x556791957770
        missing = {0, 1, 768, 32, 9, 2, 238, 214, 341, 2018, 10, 100, 4, 3432, 
7, 13, 4096, 1864, 1738, 1610, 1735, 1763, 8, 1835, 131, 130, 1917, 342, 787, 
1199, 33, 5,1001, 14, 31, 15, 1, 0, 0, 0, 1, 0, 224631424, 32679, 843342932, 
32766, 222831915, 32679, 0, 0, 224632280, 32679, 843342896, 32766, 3612111240, 
1, 224631424, 32679, 843342880, 32766, 201712249, 32679, 1038094023, 0, 
4294967295, 0, 843343136, 32766, 211258264, 32679, 225031056, 32679, 5786813, 
0, 201708696, 32679, 843343216, 0, 0, 0, 843342996, 32766, 224632280, 32679, 
843343296, 32766, 0, 0, 1, 0, 0, 0, 843343336, 32766, 204502296, 32679, 8, 0, 
843345876, 32766, 843345876, 32766, 2442264848, 21863, 2442211344, 21863, 1, 0, 
27263005, 0, 199571703, 32679, 1, 0, 211258264, 32679, 2442211344, 21863, 1, 0, 
27263000, 0, 199571703, 32679, 1, 0, 16, 0, 2442271296, 21863, 2442271296, 
21863, 843345796, 32766, 224631424, 32679, 56872912, 0, 201708696, 32679, 
843343472, 0, 8096, 65535, 843343252, 32766, 2833591552, 2521310727, 843343552, 
32766, 2442260064, 21863, 2442211344, 21863, 2442211344, 21863, 17, 0, 1, 0, 
16, 0, 2833591552, 2521310727, 2442216160, 21863, 1, 0, 27263005, 0, 
2442211344, 21863, 1, 0, 27263005, 0, 2442211344, 21863, 199562427, 32679, 
2442211344, 0, 1, 1, 2442211344, 21863, 2442275560, 21863, 27263004, 0, 
2833591552, 2521310727, 2442463840, 21863, 2442491760, 21863, 843348000, 32766, 
1632, 0...}
        nmissing = 36
        n = <optimized out>
        g = 0x7ffe3244a004
        glyph = <optimized out>
        xftg = <optimized out>
        glyphs_loaded = 1
        x = <optimized out>
        y = <optimized out>
        left = <optimized out>
        right = <optimized out>
        top = <optimized out>
        bottom = <optimized out>
        overall_left = <optimized out>
        overall_right = <optimized out>
        overall_top = <optimized out>
        overall_bottom = <optimized out>
#1  0x00007fa70cd1b64c in XftTextExtents8 (dpy=0x556791913010, 
pub=0x556791957770, string=0x5567919227b0 "", len=-1, extents=0x7ffe32447830) 
at ../../src/xftextent.c:139
        glyphs = 0x7ffe32446780
        glyphs_local = {86, 70, 90, 75, 82, 17, 71, 68, 92, 70, 68, 79, 3, 41, 
85, 82, 81, 87, 3, 51, 68, 74, 72, 3, 16, 3, 48, 82, 93, 76, 79, 79, 68, 3, 41, 
76, 85, 72, 73, 82, 91, 75, 88, 81, 71, 72, 85, 69, 76, 85, 71, 86, 92, 71, 17, 
72, 71, 88, 17, 68, 88, 3, 16, 3, 48, 82, 93, 76, 79, 79, 68, 3, 55, 75, 88, 
81, 71, 72, 85, 69, 76,85, 71, 76, 85, 71, 3, 18, 87, 80, 83, 18, 80, 83, 18, 
3, 16, 3, 18, 87, 80, 83, 18, 87, 72, 71, 74, 85, 68, 87, 72, 71, 85, 68, 87, 
72, 71, 76, 74, 85, 68, 87, 72, 71, 74, 85, 68, 87, 72, 71, 87, 72, 71, 71, 72, 
71, 72, 71, 71, 21, 12, 90, 86, 16, 20, 21, 24, 21, 12, 0, 0, 0, 843344404, 
32766, 225028128, 32679, 843344704, 32766, 0, 0, 1, 0, 768, 0, 225027272, 
32679, 219396472, 32679, 219429472, 32679, 222833587, 32679, 768, 0, 219429472, 
32679, 225027272, 32679, 843344600, 32766, 843344596, 32766, 219396472, 32679, 
219429960, 32679, 219414904, 32679, 843344600, 32766, 430701788, 0, 6729715, 0, 
219429472, 32679, 843344816, 32766, 219396472, 32679...}
        i = 0
#2  0x0000556790e9a2a2 in ?? ()
No symbol table info available.
#3  0x0000556790e9aade in ?? ()
No symbol table info available.
#4  0x0000556790e9b274 in ?? ()
No symbol table info available.
#5  0x0000556790e99355 in main ()
No symbol table info available.
(gdb)


(gdb) bt
#0  0x00007fa70cd1b354 in XftGlyphExtents (dpy=dpy@entry=0x556791913010, 
pub=pub@entry=0x556791957770, glyphs=glyphs@entry=0x7ffe32446780, 
nglyphs=nglyphs@entry=-1, extents=extents@entry=0x7ffe32447830) at 
../../src/xftextent.c:50
#1  0x00007fa70cd1b64c in XftTextExtents8 (dpy=0x556791913010, 
pub=0x556791957770, string=0x5567919227b0 "", len=-1, extents=0x7ffe32447830) 
at ../../src/xftextent.c:139
#2  0x0000556790e9a2a2 in ?? ()
#3  0x0000556790e9aade in ?? ()
#4  0x0000556790e9b274 in ?? ()
#5  0x0000556790e99355 in main ()
(gdb)


#0  0x00007fa70cd1b354 in XftGlyphExtents (dpy=dpy@entry=0x556791913010, 
pub=pub@entry=0x556791957770, glyphs=glyphs@entry=0x7ffe32446780, 
nglyphs=nglyphs@entry=-1, extents=extents@entry=0x7ffe32447830) at 
../../src/xftextent.c:50
50              if (XftFontCheckGlyph (dpy, pub, FcFalse, *g++, missing, 
&nmissing))

#1  0x00007fa70cd1b64c in XftTextExtents8 (dpy=0x556791913010, 
pub=0x556791957770, string=0x5567919227b0 "", len=-1, extents=0x7ffe32447830) 
at ../../src/xftextent.c:139
139         XftGlyphExtents (dpy, pub, glyphs, len, extents);



(gdb) disassemble XftGlyphExtents
Dump of assembler code for function XftGlyphExtents:
   0x00007fa70cd1b2f0 <+0>:     push   %r15
   0x00007fa70cd1b2f2 <+2>:     push   %r14
   0x00007fa70cd1b2f4 <+4>:     xor    %r15d,%r15d
   0x00007fa70cd1b2f7 <+7>:     push   %r13
   0x00007fa70cd1b2f9 <+9>:     push   %r12
   0x00007fa70cd1b2fb <+11>:    mov    %rsi,%r12
   0x00007fa70cd1b2fe <+14>:    push   %rbp
   0x00007fa70cd1b2ff <+15>:    push   %rbx
   0x00007fa70cd1b300 <+16>:    mov    %rdx,%rbp
   0x00007fa70cd1b303 <+19>:    sub    $0x448,%rsp
   0x00007fa70cd1b30a <+26>:    mov    %fs:0x28,%rax
   0x00007fa70cd1b313 <+35>:    mov    %rax,0x438(%rsp)
   0x00007fa70cd1b31b <+43>:    xor    %eax,%eax
   0x00007fa70cd1b31d <+45>:    mov    %ecx,%eax
   0x00007fa70cd1b31f <+47>:    mov    %rdi,(%rsp)
   0x00007fa70cd1b323 <+51>:    lea    0x30(%rsp),%rdi
   0x00007fa70cd1b328 <+56>:    lea    (%rdx,%rax,4),%r14
   0x00007fa70cd1b32c <+60>:    lea    0x2c(%rsp),%rax
   0x00007fa70cd1b331 <+65>:    mov    %r8,0x8(%rsp)
   0x00007fa70cd1b336 <+70>:    movl   $0x0,0x2c(%rsp)
   0x00007fa70cd1b33e <+78>:    mov    %rdx,0x10(%rsp)
   0x00007fa70cd1b343 <+83>:    mov    %rdi,%rbx
   0x00007fa70cd1b346 <+86>:    mov    %ecx,0x1c(%rsp)
   0x00007fa70cd1b34a <+90>:    mov    %rax,%r13
   0x00007fa70cd1b34d <+93>:    jmp    0x7fa70cd1b376 <XftGlyphExtents+134>
   0x00007fa70cd1b34f <+95>:    nop
   0x00007fa70cd1b350 <+96>:    add    $0x4,%rbp
=> 0x00007fa70cd1b354 <+100>:   mov    -0x4(%rbp),%ecx
   0x00007fa70cd1b357 <+103>:   mov    (%rsp),%rdi
   0x00007fa70cd1b35b <+107>:   xor    %edx,%edx



(gdb) print/x $rbp
$1 = 0x7ffe3244a004
(gdb) print/x $rbp - 0x4
$2 = 0x7ffe3244a000
(gdb) x/1xw 0x7ffe3244a000
0x7ffe3244a000: Cannot access memory at address 0x7ffe3244a000




(gdb) disassemble /m 0x00007fa70cd1b34d,0x00007fa70cd1b357
Dump of assembler code from 0x7fa70cd1b34d to 0x7fa70cd1b357:
49          while (n--)
   0x00007fa70cd1b34d <XftGlyphExtents+93>:     jmp    0x7fa70cd1b376 
<XftGlyphExtents+134>
   0x00007fa70cd1b34f <XftGlyphExtents+95>:     nop

50              if (XftFontCheckGlyph (dpy, pub, FcFalse, *g++, missing, 
&nmissing))
   0x00007fa70cd1b350 <XftGlyphExtents+96>:     add    $0x4,%rbp
=> 0x00007fa70cd1b354 <XftGlyphExtents+100>:    mov    -0x4(%rbp),%ecx
   0x00007fa70cd1b357 <XftGlyphExtents+103>:    mov    (%rsp),%rdi
   0x00007fa70cd1b35b <XftGlyphExtents+107>:    xor    %edx,%edx
   0x00007fa70cd1b35d <XftGlyphExtents+109>:    mov    %r13,%r9
   0x00007fa70cd1b360 <XftGlyphExtents+112>:    mov    %rbx,%r8
   0x00007fa70cd1b363 <XftGlyphExtents+115>:    mov    %r12,%rsi
   0x00007fa70cd1b366 <XftGlyphExtents+118>:    callq  0x7fa70cd14c80 
<XftFontCheckGlyph@plt>

End of assembler dump.






(gdb) list XftGlyphExtents
26      XftGlyphExtents (Display            *dpy,
27                       XftFont            *pub,
28                       _Xconst FT_UInt    *glyphs,
29                       int                nglyphs,
30                       XGlyphInfo         *extents)
31      {
32          XftFontInt          *font = (XftFontInt *) pub;
33          FT_UInt             missing[XFT_NMISSING];
34          int                 nmissing;
35          int                 n;
36          _Xconst FT_UInt     *g;
37          FT_UInt             glyph;
38          XftGlyph            *xftg;
39          FcBool              glyphs_loaded;
40          int                 x, y;
41          int                 left, right, top, bottom;
42          int                 overall_left, overall_right;
43          int                 overall_top, overall_bottom;
44
45          g = glyphs;
46          n = nglyphs;
47          nmissing = 0;
48          glyphs_loaded = FcFalse;
49          while (n--)
50              if (XftFontCheckGlyph (dpy, pub, FcFalse, *g++, missing, 
&nmissing))
51                  glyphs_loaded = FcTrue;
52          if (nmissing)
53              XftFontLoadGlyphs (dpy, pub, FcFalse, missing, nmissing);
54          g = glyphs;
55          n = nglyphs;












############
############
############




apt install hpanel libxft2-dbgsym libx11-6-dbgsym
(mkdir -p libxft2/orig; cd libxft2/orig; apt source libxft2)

$ gdb -q /usr/bin/hpanel --core core
(gdb) directory /home/benutzer/libxft2/orig/xft-2.3.2/debian/source
(gdb) bt
#0  0x00007fa70cd1b354 in XftGlyphExtents (dpy=dpy@entry=0x556791913010, 
pub=pub@entry=0x556791957770, glyphs=glyphs@entry=0x7ffe32446780, 
nglyphs=nglyphs@entry=-1, extents=extents@entry=0x7ffe32447830) at 
../../src/xftextent.c:50
#1  0x00007fa70cd1b64c in XftTextExtents8 (dpy=0x556791913010, 
pub=0x556791957770, string=0x5567919227b0 "", len=-1, extents=0x7ffe32447830) 
at ../../src/xftextent.c:139
#2  0x0000556790e9a2a2 in ?? ()
#3  0x0000556790e9aade in ?? ()
#4  0x0000556790e9b274 in ?? ()
#5  0x0000556790e99355 in main ()
(gdb)


Unfortunately hpanel has not yet been built for stretch or buster
and has therefore no dbgsym package.


(gdb) disassemble /m 0x00007fa70cd1b34d,0x00007fa70cd1b357
Dump of assembler code from 0x7fa70cd1b34d to 0x7fa70cd1b357:
49          while (n--)
   0x00007fa70cd1b34d <XftGlyphExtents+93>:     jmp    0x7fa70cd1b376 
<XftGlyphExtents+134>
   0x00007fa70cd1b34f <XftGlyphExtents+95>:     nop

50              if (XftFontCheckGlyph (dpy, pub, FcFalse, *g++, missing, 
&nmissing))
   0x00007fa70cd1b350 <XftGlyphExtents+96>:     add    $0x4,%rbp
=> 0x00007fa70cd1b354 <XftGlyphExtents+100>:    mov    -0x4(%rbp),%ecx
   0x00007fa70cd1b357 <XftGlyphExtents+103>:    mov    (%rsp),%rdi
   0x00007fa70cd1b35b <XftGlyphExtents+107>:    xor    %edx,%edx
   0x00007fa70cd1b35d <XftGlyphExtents+109>:    mov    %r13,%r9
   0x00007fa70cd1b360 <XftGlyphExtents+112>:    mov    %rbx,%r8
   0x00007fa70cd1b363 <XftGlyphExtents+115>:    mov    %r12,%rsi
   0x00007fa70cd1b366 <XftGlyphExtents+118>:    callq  0x7fa70cd14c80 
<XftFontCheckGlyph@plt>


(gdb) print/x $rbp
$1 = 0x7ffe3244a004
(gdb) print/x $rbp - 0x4
$2 = 0x7ffe3244a000
(gdb) x/1xw 0x7ffe3244a000
0x7ffe3244a000: Cannot access memory at address 0x7ffe3244a000


(gdb) list XftGlyphExtents
26      XftGlyphExtents (Display            *dpy,
27                       XftFont            *pub,
28                       _Xconst FT_UInt    *glyphs,
29                       int                nglyphs,
30                       XGlyphInfo         *extents)
31      {
32          XftFontInt          *font = (XftFontInt *) pub;
33          FT_UInt             missing[XFT_NMISSING];
34          int                 nmissing;
35          int                 n;
36          _Xconst FT_UInt     *g;
37          FT_UInt             glyph;
38          XftGlyph            *xftg;
39          FcBool              glyphs_loaded;
40          int                 x, y;
41          int                 left, right, top, bottom;
42          int                 overall_left, overall_right;
43          int                 overall_top, overall_bottom;
44
45          g = glyphs;
46          n = nglyphs;
47          nmissing = 0;
48          glyphs_loaded = FcFalse;
49          while (n--)
50              if (XftFontCheckGlyph (dpy, pub, FcFalse, *g++, missing, 
&nmissing))
51                  glyphs_loaded = FcTrue;
52          if (nmissing)
53              XftFontLoadGlyphs (dpy, pub, FcFalse, missing, nmissing);
54          g = glyphs;
55          n = nglyphs;



(gdb) list XftTextExtents8
117     XftTextExtents8 (Display            *dpy,
118                      XftFont            *pub,
119                      _Xconst FcChar8    *string,
120                      int                len,
121                      XGlyphInfo         *extents)
122     {
123         FT_UInt         *glyphs, glyphs_local[NUM_LOCAL];
124         int             i;
125
126         if (len <= NUM_LOCAL)
127             glyphs = glyphs_local;
128         else
129         {
130             glyphs = malloc (len * sizeof (FT_UInt));
131             if (!glyphs)
132             {
133                 memset (extents, '\0', sizeof (XGlyphInfo));
134                 return;
135             }
136         }
137         for (i = 0; i < len; i++)
138             glyphs[i] = XftCharIndex (dpy, pub, string[i]);
139         XftGlyphExtents (dpy, pub, glyphs, len, extents);
140         if (glyphs != glyphs_local)
141             free (glyphs);
142     }



(gdb) bt full
#0  0x00007fa70cd1b354 in XftGlyphExtents (dpy=dpy@entry=0x556791913010, 
pub=pub@entry=0x556791957770, glyphs=glyphs@entry=0x7ffe32446780, 
nglyphs=nglyphs@entry=-1, extents=extents@entry=0x7ffe32447830) at 
../../src/xftextent.c:50
        font = 0x556791957770
        missing = {0, 1, 768, 32, 9, 2, 238, 214, 341, 2018, 10, 100, 4, 3432, 
7, 13, 4096, 1864, 1738, 1610, 1735, 1763, 8, 1835, 131, 130, 1917, 342, 787, 
1199, 33, 5,1001, 14, 31, 15, 1, 0, 0, 0, 1, 0, 224631424, 32679, 843342932, 
32766, 222831915, 32679, 0, 0, 224632280, 32679, 843342896, 32766, 3612111240, 
1, 224631424, 32679, 843342880, 32766, 201712249, 32679, 1038094023, 0, 
4294967295, 0, 843343136, 32766, 211258264, 32679, 225031056, 32679, 5786813, 
0, 201708696, 32679, 843343216, 0, 0, 0, 843342996, 32766, 224632280, 32679, 
843343296, 32766, 0, 0, 1, 0, 0, 0, 843343336, 32766, 204502296, 32679, 8, 0, 
843345876, 32766, 843345876, 32766, 2442264848, 21863, 2442211344, 21863, 1, 0, 
27263005, 0, 199571703, 32679, 1, 0, 211258264, 32679, 2442211344, 21863, 1, 0, 
27263000, 0, 199571703, 32679, 1, 0, 16, 0, 2442271296, 21863, 2442271296, 
21863, 843345796, 32766, 224631424, 32679, 56872912, 0, 201708696, 32679, 
843343472, 0, 8096, 65535, 843343252, 32766, 2833591552, 2521310727, 843343552, 
32766, 2442260064, 21863, 2442211344, 21863, 2442211344, 21863, 17, 0, 1, 0, 
16, 0, 2833591552, 2521310727, 2442216160, 21863, 1, 0, 27263005, 0, 
2442211344, 21863, 1, 0, 27263005, 0, 2442211344, 21863, 199562427, 32679, 
2442211344, 0, 1, 1, 2442211344, 21863, 2442275560, 21863, 27263004, 0, 
2833591552, 2521310727, 2442463840, 21863, 2442491760, 21863, 843348000, 32766, 
1632, 0...}
        nmissing = 36
        n = <optimized out>
        g = 0x7ffe3244a004
        glyph = <optimized out>
        xftg = <optimized out>
        glyphs_loaded = 1
        x = <optimized out>
        y = <optimized out>
        left = <optimized out>
        right = <optimized out>
        top = <optimized out>
        bottom = <optimized out>
        overall_left = <optimized out>
        overall_right = <optimized out>
        overall_top = <optimized out>
        overall_bottom = <optimized out>
#1  0x00007fa70cd1b64c in XftTextExtents8 (dpy=0x556791913010, 
pub=0x556791957770, string=0x5567919227b0 "", len=-1, extents=0x7ffe32447830) 
at ../../src/xftextent.c:139
        glyphs = 0x7ffe32446780
        glyphs_local = {86, 70, 90, 75, 82, 17, 71, 68, 92, 70, 68, 79, 3, 41, 
85, 82, 81, 87, 3, 51, 68, 74, 72, 3, 16, 3, 48, 82, 93, 76, 79, 79, 68, 3, 41, 
76, 85, 72, 73, 82, 91, 75, 88, 81, 71, 72, 85, 69, 76, 85, 71, 86, 92, 71, 17, 
72, 71, 88, 17, 68, 88, 3, 16, 3, 48, 82, 93, 76, 79, 79, 68, 3, 55, 75, 88, 
81, 71, 72, 85, 69, 76,85, 71, 76, 85, 71, 3, 18, 87, 80, 83, 18, 80, 83, 18, 
3, 16, 3, 18, 87, 80, 83, 18, 87, 72, 71, 74, 85, 68, 87, 72, 71, 85, 68, 87, 
72, 71, 76, 74, 85, 68, 87, 72, 71, 74, 85, 68, 87, 72, 71, 87, 72, 71, 71, 72, 
71, 72, 71, 71, 21, 12, 90, 86, 16, 20, 21, 24, 21, 12, 0, 0, 0, 843344404, 
32766, 225028128, 32679, 843344704, 32766, 0, 0, 1, 0, 768, 0, 225027272, 
32679, 219396472, 32679, 219429472, 32679, 222833587, 32679, 768, 0, 219429472, 
32679, 225027272, 32679, 843344600, 32766, 843344596, 32766, 219396472, 32679, 
219429960, 32679, 219414904, 32679, 843344600, 32766, 430701788, 0, 6729715, 0, 
219429472, 32679, 843344816, 32766, 219396472, 32679...}
        i = 0




After rebuilding hpanel and starting many xterm's:

Program received signal SIGSEGV, Segmentation fault.
0x00007fd9e594d364 in XftGlyphExtents (dpy=dpy@entry=0x55c072ed2260, 
pub=pub@entry=0x55c072f1edd0, glyphs=glyphs@entry=0x7ffd6f6611f0, 
nglyphs=nglyphs@entry=-1, extents=extents@entry=0x7ffd6f662254) at 
../../src/xftextent.c:50
50              if (XftFontCheckGlyph (dpy, pub, FcFalse, *g++, missing, 
&nmissing))
(gdb) bt
#0  0x00007fd9e594d364 in XftGlyphExtents (dpy=dpy@entry=0x55c072ed2260, 
pub=pub@entry=0x55c072f1edd0, glyphs=glyphs@entry=0x7ffd6f6611f0, 
nglyphs=nglyphs@entry=-1, extents=extents@entry=0x7ffd6f662254) at 
../../src/xftextent.c:50
#1  0x00007fd9e594d656 in XftTextExtents8 (dpy=0x55c072ed2260, 
pub=0x55c072f1edd0, string=0x55c072ee5aa0 "benutzer@debian: ~", len=-1, 
extents=0x7ffd6f662254) at ../../src/xftextent.c:139
#2  0x000055c071a5953f in gui_draw_task (tk=0x55c072ee2d70) at hpanel.c:593
#3  0x000055c071a59cba in gui_draw_taskbar () at hpanel.c:848
#4  0x000055c071a5a414 in handle_propertynotify (win=948, at=364) at 
hpanel.c:1139
#5  0x000055c071a58655 in main (argc=<optimized out>, argv=<optimized out>) at 
hpanel.c:1276


(gdb) list gui_draw_task
557             draw_line (x + 3, 2, x + 3, WINHEIGHT - 3);
558     }
559
560     void
561     gui_draw_task (task *tk)
562     {
563             int len;
564             int x = tk->pos_x;
565             int taskw = tk->width;
566     #ifdef XFT
567             XGlyphInfo ext;
568             XftColor col;
569     #endif
570
571             if (!tk->name)
572                     return;
573
574             gui_draw_vline (x);
575
576             if (tk->focused)
577             {
578                     draw_box (x, taskw);
579             } else
580             {
581                     set_foreground (0);               /* mid gray */
582                     fill_rect (x + 2, 0, taskw - 1, WINHEIGHT);
583             }
584
585             {
586                     register int text_x = x + TEXTPAD + TEXTPAD + ICONWIDTH;
587     #ifdef XFT
588
589                     /* check how many chars can fit */
590                     len = strlen (tk->name);
591                     while (1)
592                     {
593                             XftTextExtents8 (dd, xfs, tk->name, len, &ext);
594                             if (ext.width < taskw - (text_x - x) - 2 && len 
> 0)
595                                     break;
596                             len--;
597                     }

Reply via email to