[pdal] seg-fault when compressing zero points with lazperf

Andrew Bell andrew.bell.ia at gmail.com
Tue Jan 18 06:54:23 PST 2022


Here's the ticket...

On Tue, Jan 18, 2022 at 9:52 AM Andrew Bell <andrew.bell.ia at gmail.com>
wrote:

> I've already fixed this, but I can't locate the PR right now. I'll write
> again when I find it.
>
> On Tue, Jan 18, 2022 at 9:48 AM Jim Klassen <klassen.js at gmail.com> wrote:
>
>> 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.
>>
>> 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).
>>
>>
>> liblaszip: 3.4.1-6-gc7b67ca
>> laz-perf: 3.0.0-1-g03ed832
>> pdal: ac8068c7d
>>
>>
>> $ cat lasperf.fail.txt
>> X,Y,Z
>>
>> $ pdal info lasperf.fail.txt
>> {
>>    "file_size": 7,
>>    "filename": "lasperf.fail.txt",
>>    "now": "2022-01-18T08:19:08-0600",
>>    "pdal_version": "2.3.0 (git-version: ac8068)",
>>    "reader": "readers.text",
>>    "stats":
>>    {
>>      "statistic":
>>      [
>>        {
>>          "average": 0,
>>          "count": 0,
>>          "maximum": -1.797693135e+308,
>>          "minimum": 1.797693135e+308,
>>          "name": "X",
>>          "position": 0,
>>          "stddev": 0,
>>          "variance": 0
>>        },
>>        {
>>          "average": 0,
>>          "count": 0,
>>          "maximum": -1.797693135e+308,
>>          "minimum": 1.797693135e+308,
>>          "name": "Y",
>>          "position": 1,
>>          "stddev": 0,
>>          "variance": 0
>>        },
>>        {
>>          "average": 0,
>>          "count": 0,
>>          "maximum": -1.797693135e+308,
>>          "minimum": 1.797693135e+308,
>>          "name": "Z",
>>          "position": 2,
>>          "stddev": 0,
>>          "variance": 0
>>        }
>>      ]
>>    }
>> }
>> $ pdal translate lasperf.fail.txt lasperf.fail.laz
>> --writers.las.compression=laszip
>> $ pdal translate lasperf.fail.txt lasperf.fail.laz
>> --writers.las.compression=lazperf
>> Segmentation fault
>> $ gdb --args pdal translate lasperf.fail.txt lasperf.fail.laz
>> --writers.las.compression=lazperf
>> GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
>> Copyright (C) 2021 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later <
>> http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.
>> Type "show copying" and "show warranty" for details.
>> This GDB was configured as "x86_64-linux-gnu".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> <https://www.gnu.org/software/gdb/bugs/>.
>> Find the GDB manual and other documentation resources online at:
>>      <http://www.gnu.org/software/gdb/documentation/>.
>>
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word"...
>> Reading symbols from pdal...
>> (No debugging symbols found in pdal)
>> (gdb) run
>> Starting program: /apps/PointClouds/pdal/2.3.0-ac8068c7d-laszip/bin/pdal
>> translate lasperf.fail.txt lasperf.fail.laz
>> --writers.las.compression=lazperf
>> [Thread debugging using libthread_db enabled]
>> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007ffff7e0c4d9 in pdal::LazPerfVlrCompressorImpl::done (this=0x4c2ea0)
>>      at
>> /apps/PointClouds/pdal/src/pdal/pdal/compression/LazPerfVlrCompression.cpp:101
>> 101            m_compressor->done();
>> (gdb) print m_compressor
>> $1 = std::shared_ptr<lazperf::las_compressor> (empty) = {get() = 0x0}
>> (gdb) quit
>> A debugging session is active.
>>
>>      Inferior 1 [process 283225] will be killed.
>>
>> Quit anyway? (y or n) y
>> $
>>
>> _______________________________________________
>> pdal mailing list
>> pdal at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/pdal
>>
>
>
> --
> Andrew Bell
> andrew.bell.ia at gmail.com
>


-- 
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20220118/3b2f61f8/attachment-0001.html>


More information about the pdal mailing list