Package: htmldoc
Version: 1.8.24-2
Severity: important
Tags: patch

I tried to compile the documentation of privoxy using htmldoc and had
to notice, that it runs into segmentation faults.  I reduced the html
file to a minimal one:

$ htmldoc -t pdf -f test.pdf test.html
PAGES: 3
Segmentation fault

$ cat test.html 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">

<html>
<head>
  <title>baz</title>
</head>

<body>
  <h1>bar</h1>

  <ul>
    <li>foo</li>
  </ul>
</body>
</html>

When this happens I see the following message in the kernel log
(dmesg):
htmldoc[31826]: segfault at 000000fa00623260 rip 00002aaaabf59961 rsp 
00007fffff84efd0 error 4
htmldoc[32421]: segfault at 000000fa00622370 rip 00002aaaabf59961 rsp 
00007fffffdfbd80 error 4
htmldoc[32425]: segfault at 000000fa00622370 rip 00002aaaabf59961 rsp 
00007ffffff66440 error 4
(one line per htmldoc run).

The problem does not exist on a i386 sid system, but as you can see,
it happens on nearly every html file on amd64.

I just got the new upstream version 1.8.25 (compiles out of the box
with the debian 1.8.24-2 diff) and with this version all problems seem
to have gone away.

In the strace output I see, that the problem occurs while/after
reading Symbol.afm and in the changelog of 1.8.25 I found the
following entry:
      - HTMLDOC could crash when loading the Symbol.afm file
        (STR #93)
So I had a look at this bug report (http://www.htmldoc.org/str.php?L93)
and found a point to SVN version 1428, which solves this problem.

I extracted the patch from SVN 1428 and this one-line patch solves the
problem for me.

This is quite important to me, because htmldoc is a build dependency
of privoxy and if htmldoc runs into segmentation faults when compiling
the privoxy documentation, the privoxy packages are broken (at least
on amd64, but I fear that the same happens on other 64 bit
architectures as well).

If you aren't able to create a new package soon, please tell me, so I
can upload an NMU.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (50, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14.3ro2
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages htmldoc depends on:
ii  htmldoc-common           1.8.24-2        Common arch-independent files for 
ii  libc6                    2.3.5-8.1       GNU C Library: Shared libraries an
ii  libfltk1.1               1.1.6-10        Fast Light Toolkit shared librarie
ii  libjpeg62                6b-11           The Independent JPEG Group's JPEG 
ii  libpng12-0               1.2.8rel-5      PNG library - runtime
ii  libssl0.9.7              0.9.7g-5        SSL shared libraries
ii  libstdc++6               4.0.2-5         The GNU Standard C++ Library v3
ii  libx11-6                 6.8.2.dfsg.1-11 X Window System protocol client li
ii  libxext6                 6.8.2.dfsg.1-11 X Window System miscellaneous exte
ii  libxft2                  2.1.7-1         FreeType-based font drawing librar
ii  xlibs                    6.8.2.dfsg.1-11 X Window System client libraries m
ii  zlib1g                   1:1.2.3-9       compression library - runtime

htmldoc recommends no packages.

-- no debconf information

Tschoeeee

        Roland

-- 
 * [EMAIL PROTECTED] * http://www.spinnaker.de/ *
Index: htmldoc/ps-pdf.cxx
===================================================================
--- htmldoc/ps-pdf.cxx  (Revision 1427)
+++ htmldoc/ps-pdf.cxx  (Revision 1428)
@@ -12387,7 +12387,7 @@
          if (sscanf(line, "%*s%d%*s%*s%d", &ch, &width) != 2)
            continue;
 
-         if (ch < 256)
+         if (ch >= 0 && ch < 256)
            widths[ch] = width;
        }
       }

Reply via email to