Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (core dumped) when using filters.python #73

Closed
AlbionS opened this issue Sep 28, 2020 · 10 comments
Closed

Segmentation fault (core dumped) when using filters.python #73

AlbionS opened this issue Sep 28, 2020 · 10 comments

Comments

@AlbionS
Copy link

AlbionS commented Sep 28, 2020

Hi,
I just found a bug using filters.python.

I have been working lately on scaling the intensity to color if a file does not have a color. Recently I found out that it does not work all the time and I kept receiving the error Segmentation fault (core dumped), at first I thought that my python script is not working correctly but that wasn't the case. Some of the files work fine and some not.

To make it easy and to prove that the error is not coming from my script so you wont have to verify it, I changed the fonction just to print something on the console :
rep_col.py

import numpy as np
import sys
print("started")
def scale_color(ins, outs):
        print("inside")
        print("------------------Finished")
        return True

pipeline.json

       [
               "/home/ubuntu/Desktop/test.laz",
                {
                  "type":"filters.python",
                  "script":"/home/ubuntu/Desktop/replace_col.py",
                  "function":"scale_color",
                  "module":"anything",
                  "add_dimension":["Red=uint16","Green=uint16","Blue=uint16"]
                },
                {
                 "filename":  "/home/ubuntu/Desktop/test_.laz"
                 }
        ]

Link to download the files : https://gofile.io/d/0Wnhmv

Exemple of the first file, that it throws the error :
pdal pipeline -i /home/ubuntu/Desktop/pipeline.json

started
Segmentation fault (core dumped)

Exemple of the second file, that it works:
pdal pipeline -i /home/ubuntu/Desktop/pipeline.json

started
inside
------------------Finished

I've installed pdal through conda
pdal --version

----------------------------------------------------------
pdal 2.1.0 (git-version: 1d5e8a)
----------------------------------------------------------

I can provide other files if needed :)
Best Regards,
Albion

@hobu
Copy link
Member

hobu commented Sep 28, 2020

Can you please try 2.2.0 which was recently released. No promises it was fixed there, but there were a number of fixes that might be relevant.

@abellgithub
Copy link
Collaborator

A traceback would also be invaluable.

@AlbionS
Copy link
Author

AlbionS commented Sep 29, 2020

Same error with the 2.2.0:
pdal --version

------------------------------------------------------------------------------------------------------------------------
pdal 2.2.0 (git-version: ff32c2)
------------------------------------------------------------------------------------------------------------------------

@abellgithub
Copy link
Collaborator

I can't reproduce this. You'll have to provide data if you want this addressed. Also note that the provided pipeline input doesn't correspond to the provided python file (python filename is wrong).

@AlbionS
Copy link
Author

AlbionS commented Oct 20, 2020

@abellgithub Thank you for your time. Yeah for the name I know, in my local it's not called the same, it was just to show you how I use it. Here is the link to reproduce this error https://gofile.io/d/fHyIBB
Sincerely,
Albion

@abellgithub abellgithub transferred this issue from PDAL/PDAL Oct 20, 2020
@abellgithub
Copy link
Collaborator

This is caused by an invalid string in the source metadata data not being properly handled by the library.

@abellgithub
Copy link
Collaborator

To be more explicit, there are bytes in description of the a VLR in the source file aren't valid unicode. There is no requirement in the LAS spec that they're valid unicode, but python expects unicode strings.

@AlbionS
Copy link
Author

AlbionS commented Oct 26, 2020

Thank you @abellgithub
Will this be handled in the next version of PDAL ?

@abellgithub
Copy link
Collaborator

It has already been released as part of the python module: https://github.com/PDAL/python/releases/tag/2.3.5

@AlbionS
Copy link
Author

AlbionS commented Nov 5, 2020

Thank you @abellgithub
I never reached to install pdal through pip : ERROR: Could not build wheels for PDAL which use PEP 517 and cannot be installed directly.

I have installed it through conda, so doing "conda update pdal" of my environment will I have the bug fixed for the python filter ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants