<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Missing NSS libs in the chroot cause loolforkit to segfault on PDF export"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=121429">121429</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Missing NSS libs in the chroot cause loolforkit to segfault on PDF export
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice Online
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>guilhem@fripost.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On Debian systems, extra libraries have to be copied to the systemplate chroot,
namely /usr/lib/$TRIPLET/nss/*.so and /usr/lib/$TRIPLET/libsqlite3.so.* (where
$TRIPLET is the architecture triplet, typically "x86_64-linux-gnu").

These libraries don't show up in `ldd /path/to/xpdfimport`, but omitting them
in the chroot (partially) breaks NSS.  In particular, exporting a document to
PDF, either directly in LOOL or using its API with `curl -F
data=@/path/to/doc.odt <a href="http://127.0.0.1:9980/lool/convert-to/pdf">http://127.0.0.1:9980/lool/convert-to/pdf</a>`, causes
loolforkit to segfault.  AFAICT from a debug trace, this is because the PDF
writer calls ::comphelper::Hash which in turns triggers a null pointer
dereference in libnss's HASH_Begin.

Making loolwsd-systemplate-setup copy these libraries to the chroot fixed the
PDF export issue on our instance.  The problem might be Debian-specific as
RedHat-based distros don't have that "nss" sub-directory (instead libfreebl3.so
and friends are copied directly in /lib; not sure if on these systems the
chroot has a crippled libnss or not).

System info: LOOLWSD 6.1.3, LOKit 6.1.3.2</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>