<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nx-libs/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c, branch update-workflows</title>
<subtitle>NXv3 (redistributed) 
</subtitle>
<id>https://openid.arctica-project.org/nx-libs/atom?h=update-workflows</id>
<link rel='self' href='https://openid.arctica-project.org/nx-libs/atom?h=update-workflows'/>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/'/>
<updated>2023-04-28T12:39:16+00:00</updated>
<entry>
<title>Update Copyright years</title>
<updated>2023-04-28T12:39:16+00:00</updated>
<author>
<name>Ulrich Sibiller</name>
<email>uli42@gmx.de</email>
</author>
<published>2022-04-29T19:12:35+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=390887b7487e5a769b2fe2a038404ed47e5c8e91'/>
<id>urn:sha1:390887b7487e5a769b2fe2a038404ed47e5c8e91</id>
<content type='text'>
Addresses ArcticaProject/nx-libs#985
</content>
</entry>
<entry>
<title>NXdixfonts.c: Regression fix for db45683a. Fix typo in libXfont1 function call (FreeFontName -&gt; FreeFontNames). Fixes FTBFS on Ubuntu 14.04 and 16.04.</title>
<updated>2020-11-04T12:51:16+00:00</updated>
<author>
<name>Mike Gabriel</name>
<email>mike.gabriel@das-netzwerkteam.de</email>
</author>
<published>2020-11-04T12:51:16+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=5ca9a6b1e0f51b3ff65d1b5d8010ec5a71432078'/>
<id>urn:sha1:5ca9a6b1e0f51b3ff65d1b5d8010ec5a71432078</id>
<content type='text'>
</content>
</entry>
<entry>
<title>NXdixfonts.c: Hard-code the enablement of NXAGENT_DANGEROUS_XFONT_LOOP_EXIT.</title>
<updated>2020-11-03T16:05:52+00:00</updated>
<author>
<name>Mike Gabriel</name>
<email>mike.gabriel@das-netzwerkteam.de</email>
</author>
<published>2020-11-03T16:05:52+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=7da2ee0bd3010a8123838ebfd681169d2636c650'/>
<id>urn:sha1:7da2ee0bd3010a8123838ebfd681169d2636c650</id>
<content type='text'>
</content>
</entry>
<entry>
<title>NXdixfonts.c: Rename BREAK_XFONT_LOOP to NXAGENT_DANGEROUS_XFONT_LOOP_EXIT (better macro name).</title>
<updated>2020-11-03T16:05:28+00:00</updated>
<author>
<name>Mike Gabriel</name>
<email>mike.gabriel@das-netzwerkteam.de</email>
</author>
<published>2020-11-03T16:05:28+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=fbde6d285a2712892ed05f5b9bd9a2987d64d009'/>
<id>urn:sha1:fbde6d285a2712892ed05f5b9bd9a2987d64d009</id>
<content type='text'>
</content>
</entry>
<entry>
<title>NXdixfonts.c: fix memory leak</title>
<updated>2020-11-03T12:59:32+00:00</updated>
<author>
<name>Ulrich Sibiller</name>
<email>uli42@gmx.de</email>
</author>
<published>2020-10-17T23:48:34+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=db45683a6317a8712bbdbff0615d1b8e39b5d57c'/>
<id>urn:sha1:db45683a6317a8712bbdbff0615d1b8e39b5d57c</id>
<content type='text'>
==15332== 2,500 (96 direct, 2,404 indirect) bytes in 6 blocks are definitely lost in loss record 324 of 342
==15332==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15332==    by 0x5748B9E: FontFileStartListFonts (in /usr/lib/x86_64-linux-gnu/libXfont.so.1.4.1)
==15332==    by 0x5748C4A: FontFileStartListFontsAndAliases (in /usr/lib/x86_64-linux-gnu/libXfont.so.1.4.1)
==15332==    by 0x42859A: nxdoListFontsAndAliases (NXdixfonts.c:1163)
==15332==    by 0x42C0E0: nxOpenFont (NXdixfonts.c:1541)
==15332==    by 0x43392E: ProcOpenFont (NXdispatch.c:902)
==15332==    by 0x434585: Dispatch (NXdispatch.c:482)
==15332==    by 0x40EF77: main (main.c:355)

FontFileStartListFonts[AndAliases]() allocates some private data. This
data is used by subsequent calls of FontFileListNextFontOrAlias() in a
loop. (Only) the last call to that function will free() the private
data and return with BadFontName.  FontFileListNextFontOrAlias() is
the only libXfont function that free()s the private data.

In nxagent the loop is exited as soon as a font exists both locally
and remote. Therefore the private data would never be free()d.

Solution: do not break the loop but store the first matching result
and let the loop run to the end, ignoring all following results.

Disadvantage: this can mean hundreds of extra iterations for
nothing. I have done no investigation of the time penalty this might
cause.

Unfortunately this is the only clean way I have found so far.

An unclean solution has also been implemented. It can be activated by
defining BREAK_XFONT_LOOP. In that case the private data is handled in
nxagent by taking assumptions about its structure (taken from the
libXfont source). That will break if libXfont changes its internal
handling of the private. Therefore it is discouraged.

An third alternative would be to drop using libXfont from the
system. Instead fork libXfont to the nx-libs tree, add some patches
link to that library statically.

Fixes ArcticaProject/nx-libs#586
</content>
</entry>
<entry>
<title>NXdixfonts.c: some code cleanups</title>
<updated>2020-05-07T12:58:17+00:00</updated>
<author>
<name>Ulrich Sibiller</name>
<email>uli42@gmx.de</email>
</author>
<published>2020-04-09T20:15:41+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=2f61c9296441843c4f62c638d052d88f2b275817'/>
<id>urn:sha1:2f61c9296441843c4f62c638d052d88f2b275817</id>
<content type='text'>
reformat, extend comments, simplify ifdef
</content>
</entry>
<entry>
<title>NXdixfonts.c: fix debugging output</title>
<updated>2020-05-07T12:58:17+00:00</updated>
<author>
<name>Ulrich Sibiller</name>
<email>uli42@gmx.de</email>
</author>
<published>2020-04-09T20:15:12+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=2e50ee079f758c7ea0b066a49674f15c5fa137fa'/>
<id>urn:sha1:2e50ee079f758c7ea0b066a49674f15c5fa137fa</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Font.c: add hint of deliberate pointer misuse</title>
<updated>2020-05-07T12:58:17+00:00</updated>
<author>
<name>Ulrich Sibiller</name>
<email>uli42@gmx.de</email>
</author>
<published>2020-04-09T17:08:11+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=99f541c1e4499ff8fda65c67c2038d5b65c15e67'/>
<id>urn:sha1:99f541c1e4499ff8fda65c67c2038d5b65c15e67</id>
<content type='text'>
</content>
</entry>
<entry>
<title>NXdixfonts.c: mark NX changes</title>
<updated>2020-05-07T12:57:15+00:00</updated>
<author>
<name>Ulrich Sibiller</name>
<email>uli42@gmx.de</email>
</author>
<published>2020-01-19T12:56:47+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=aecebe41db40a2c62e9fca2b8f9c9b5f94e76941'/>
<id>urn:sha1:aecebe41db40a2c62e9fca2b8f9c9b5f94e76941</id>
<content type='text'>
Also add original code to make NX changes obvious. Also change some
lines to match original code.
</content>
</entry>
<entry>
<title>NXdixfonts.c: drop NXAGENT_DEBUG</title>
<updated>2020-05-07T12:57:15+00:00</updated>
<author>
<name>Ulrich Sibiller</name>
<email>uli42@gmx.de</email>
</author>
<published>2020-01-19T11:51:36+00:00</published>
<link rel='alternate' type='text/html' href='https://openid.arctica-project.org/nx-libs/commit/?id=4ad501b3f0b2d2176e7312e544ee4b330286a16e'/>
<id>urn:sha1:4ad501b3f0b2d2176e7312e544ee4b330286a16e</id>
<content type='text'>
and use DEBUG like everywhere else. There were already some TEST lines
using this scheme.

Also indent DEBUG and TEST lines to make the code more readable
</content>
</entry>
</feed>
