<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    I noticed another related but likely different issue too.  It looks
    like zero point laz files made with pdal are invalid (compressed
    with laszip or lazperf w/patch).  Zero point las files appear OK.<br>
    <br>
    $ pdal translate lasperf.fail.txt lasperf.fail.las<br>
    $ pdal translate lasperf.fail.txt lasperf.fail.laz
    --writers.las.compression=laszip<br>
    <br>
    $ ls -l lasperf.fail.la?<br>
    -rw-r--r-- 1 jimk jimk 227 Jan 18 08:53 lasperf.fail.las<br>
    -rw-r--r-- 1 jimk jimk 349 Jan 18 08:54 lasperf.fail.laz<br>
    <br>
    $ pdal info lasperf.fail.laz<br>
    PDAL: Unexpected end of file.<br>
    <br>
    $ pdal info lasperf.fail.las<br>
    {<br>
      "file_size": 227,<br>
      "filename": "lasperf.fail.las",<br>
      "now": "2022-01-18T08:53:14-0600",<br>
      "pdal_version": "2.3.0 (git-version: ac8068)",<br>
      "reader": "readers.las",<br>
      "stats":<br>
      {<br>
        "statistic":<br>
        [<br>
          {<br>
            "average": 0,<br>
            "count": 0,<br>
            "maximum": -1.797693135e+308,<br>
            "minimum": 1.797693135e+308,<br>
            "name": "X",<br>
            "position": 0,<br>
            "stddev": 0,<br>
            "variance": 0<br>
          },<br>
    ...<br>
    <br>
    <div class="moz-cite-prefix">On 1/18/22 08:54, Andrew Bell wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CACJ51z0WV_fCGN9nZadUkYsv-+G4B8i4fTYq-jcHEeZQ4tFX_g@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Trying again... here's the ticket... <a
          href="https://github.com/PDAL/PDAL/issues/3652"
          moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/PDAL/PDAL/issues/3652</a></div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, Jan 18, 2022 at 9:54
          AM Andrew Bell <<a href="mailto:andrew.bell.ia@gmail.com"
            moz-do-not-send="true" class="moz-txt-link-freetext">andrew.bell.ia@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">Here's the ticket...</div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Tue, Jan 18, 2022 at
              9:52 AM Andrew Bell <<a
                href="mailto:andrew.bell.ia@gmail.com" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">andrew.bell.ia@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">I've already fixed this, but I can't locate
                the PR right now. I'll write again when I find it.</div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Tue, Jan 18, 2022
                  at 9:48 AM Jim Klassen <<a
                    href="mailto:klassen.js@gmail.com" target="_blank"
                    moz-do-not-send="true" class="moz-txt-link-freetext">klassen.js@gmail.com</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">It appears there is
                  a seg-fault in pdal when compressing a file with zero
                  points with lazperf.  Using laszip correctly creates
                  an empty laz file.  With at least one point into the
                  source file both laszip and lazperf work as expected.<br>
                  <br>
                  My guess is LazPerfVlrCompressorImpl::compress() is
                  never getting called, so m_compressor is null, but
                  that condition isn't being checked in
                  LazPerfVlrCompressorImpl::done() before calling
                  m_compress->done().  I'm not sure how much of
                  LazPerfVlrCompressorImpl::done() should be skipped if
                  m_compressor is null (there were no points to
                  process).<br>
                  <br>
                  <br>
                  liblaszip: 3.4.1-6-gc7b67ca<br>
                  laz-perf: 3.0.0-1-g03ed832<br>
                  pdal: ac8068c7d<br>
                  <br>
                  <br>
                  $ cat lasperf.fail.txt<br>
                  X,Y,Z<br>
                  <br>
                  $ pdal info lasperf.fail.txt<br>
                  {<br>
                     "file_size": 7,<br>
                     "filename": "lasperf.fail.txt",<br>
                     "now": "2022-01-18T08:19:08-0600",<br>
                     "pdal_version": "2.3.0 (git-version: ac8068)",<br>
                     "reader": "readers.text",<br>
                     "stats":<br>
                     {<br>
                       "statistic":<br>
                       [<br>
                         {<br>
                           "average": 0,<br>
                           "count": 0,<br>
                           "maximum": -1.797693135e+308,<br>
                           "minimum": 1.797693135e+308,<br>
                           "name": "X",<br>
                           "position": 0,<br>
                           "stddev": 0,<br>
                           "variance": 0<br>
                         },<br>
                         {<br>
                           "average": 0,<br>
                           "count": 0,<br>
                           "maximum": -1.797693135e+308,<br>
                           "minimum": 1.797693135e+308,<br>
                           "name": "Y",<br>
                           "position": 1,<br>
                           "stddev": 0,<br>
                           "variance": 0<br>
                         },<br>
                         {<br>
                           "average": 0,<br>
                           "count": 0,<br>
                           "maximum": -1.797693135e+308,<br>
                           "minimum": 1.797693135e+308,<br>
                           "name": "Z",<br>
                           "position": 2,<br>
                           "stddev": 0,<br>
                           "variance": 0<br>
                         }<br>
                       ]<br>
                     }<br>
                  }<br>
                  $ pdal translate lasperf.fail.txt lasperf.fail.laz
                  --writers.las.compression=laszip<br>
                  $ pdal translate lasperf.fail.txt lasperf.fail.laz
                  --writers.las.compression=lazperf<br>
                  Segmentation fault<br>
                  $ gdb --args pdal translate lasperf.fail.txt
                  lasperf.fail.laz --writers.las.compression=lazperf<br>
                  GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git<br>
                  Copyright (C) 2021 Free Software Foundation, Inc.<br>
                  License GPLv3+: GNU GPL version 3 or later <<a
                    href="http://gnu.org/licenses/gpl.html"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true" class="moz-txt-link-freetext">http://gnu.org/licenses/gpl.html</a>><br>
                  This is free software: you are free to change and
                  redistribute it.<br>
                  There is NO WARRANTY, to the extent permitted by law.<br>
                  Type "show copying" and "show warranty" for details.<br>
                  This GDB was configured as "x86_64-linux-gnu".<br>
                  Type "show configuration" for configuration details.<br>
                  For bug reporting instructions, please see:<br>
                  <<a href="https://www.gnu.org/software/gdb/bugs/"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true" class="moz-txt-link-freetext">https://www.gnu.org/software/gdb/bugs/</a>>.<br>
                  Find the GDB manual and other documentation resources
                  online at:<br>
                       <<a
                    href="http://www.gnu.org/software/gdb/documentation/"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true" class="moz-txt-link-freetext">http://www.gnu.org/software/gdb/documentation/</a>>.<br>
                  <br>
                  For help, type "help".<br>
                  Type "apropos word" to search for commands related to
                  "word"...<br>
                  Reading symbols from pdal...<br>
                  (No debugging symbols found in pdal)<br>
                  (gdb) run<br>
                  Starting program:
                  /apps/PointClouds/pdal/2.3.0-ac8068c7d-laszip/bin/pdal
                  translate lasperf.fail.txt lasperf.fail.laz
                  --writers.las.compression=lazperf<br>
                  [Thread debugging using libthread_db enabled]<br>
                  Using host libthread_db library
                  "/lib/x86_64-linux-gnu/libthread_db.so.1".<br>
                  <br>
                  Program received signal SIGSEGV, Segmentation fault.<br>
                  0x00007ffff7e0c4d9 in
                  pdal::LazPerfVlrCompressorImpl::done (this=0x4c2ea0)<br>
                       at
/apps/PointClouds/pdal/src/pdal/pdal/compression/LazPerfVlrCompression.cpp:101<br>
                  101            m_compressor->done();<br>
                  (gdb) print m_compressor<br>
                  $1 = std::shared_ptr<lazperf::las_compressor>
                  (empty) = {get() = 0x0}<br>
                  (gdb) quit<br>
                  A debugging session is active.<br>
                  <br>
                       Inferior 1 [process 283225] will be killed.<br>
                  <br>
                  Quit anyway? (y or n) y<br>
                  $<br>
                  <br>
                  _______________________________________________<br>
                  pdal mailing list<br>
                  <a href="mailto:pdal@lists.osgeo.org" target="_blank"
                    moz-do-not-send="true" class="moz-txt-link-freetext">pdal@lists.osgeo.org</a><br>
                  <a
                    href="https://lists.osgeo.org/mailman/listinfo/pdal"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/pdal</a><br>
                </blockquote>
              </div>
              <br clear="all">
              <div><br>
              </div>
              -- <br>
              <div dir="ltr">Andrew Bell<br>
                <a href="mailto:andrew.bell.ia@gmail.com"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">andrew.bell.ia@gmail.com</a></div>
            </blockquote>
          </div>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div dir="ltr">Andrew Bell<br>
            <a href="mailto:andrew.bell.ia@gmail.com" target="_blank"
              moz-do-not-send="true" class="moz-txt-link-freetext">andrew.bell.ia@gmail.com</a></div>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">Andrew Bell<br>
        <a href="mailto:andrew.bell.ia@gmail.com" target="_blank"
          moz-do-not-send="true" class="moz-txt-link-freetext">andrew.bell.ia@gmail.com</a></div>
    </blockquote>
    <br>
  </body>
</html>