Conky exit with "you don't need that many fonts" message

Bug #1271901 reported by David Cancalon
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
conky (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Depending of your configuration, sometimes Conky exit after a random time with the message "you don't need that many fonts, sorry". This occurs when Conky try to use more than 256 fonts (see fonts.c line 73).

Except if you really use more than 256 fonts, this is a bug occurs when you have fonts objects placed after a ${if} block.

Exemple :
${if_match ${upspeedf eth0} > 0}${color2}${endif} ${font PizzaDude Bullets:size=10}O${font}

In this case Conky will allocate too much fonts along the time. Each time the ${if} condition change (true -> false or false -> true) the index of the font object (stored in the "specials" array defined in specials.c) will change and conky will reallocate a new font object (specials.c, function new_font(), line 341). The reason is that s->font_added is set to zero because the font object has been shifted by -1 or +1 in the specials array.

There is a workaround to this issue, but really possible only if you have only a few objects in the ${if} block. The solution consist to add an ${else} block and pad it with dummy objects. Exactly the same number you have in the ${if} block !

${if_match ${upspeedf eth0} > 0}${color2}${else}${color1}${endif} ${font PizzaDude Bullets:size=10}O${font}

In this case Conky will not allocate extra fonts along the time.

I will try to work on a patch for this issue but help will be appreciate :)
And sorry for my English...

ProblemType: Bug
DistroRelease: Ubuntu 12.04.4 LTS
Package: conky 1.9.0-2~ubuntu12.04.1
Uname: 3.2.0-58-generic-pae
Architecture: i386

Revision history for this message
David Cancalon (david-cancalon) wrote :

Bug also created in the conky upstream (sourceforge & github)
https://sourceforge.net/p/conky/bugs/447/
https://github.com/brndnmtthws/conky/issues/41

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in conky (Ubuntu):
status: New → Confirmed
Revision history for this message
Vincent Cheng (vincent-c) wrote :

Fixed in conky/1.9.0-5 (also see https://bugs.debian.org/746477).

Changed in conky (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.