A bug in vtkPythonAlgorithm

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

A bug in vtkPythonAlgorithm

Prabhu Ramachandran-3

Hi all,


vtkPythonAlgorithm is very nice and along with the dataset adapter code is really very convenient for Python users.

I just found a bug with the vtkPythonAlgorithm.  I haven't had the chance to look at the error or debug it but thought I'd quickly share the issue.  Basically if any of the required methods raise an exception, you get a segfault and no error/traceback.  Attached is a simple example based on Berk's really nice blog post.

I've left one incorrect line of code in the ProcessRequest method to show the segfault but this error could have been in any of the methods and you'll end up with a segfault. I've left these commented out.  I tested this with VTK 8.1.1 but not with master.

Thank you!

cheers,

Prabhu



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers


vtk_alg.py (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: A bug in vtkPythonAlgorithm

Utkarsh Ayachit
Prabhu,

With `master` (v8.1.1-2403-g4ba8e48), the script doesn't seem to
segfault. I suspect this may have fixed it:
https://gitlab.kitware.com/vtk/vtk/commit/4b477bb56784adf4fb345757f158036f16b0e747

Utkarsh
On Sun, Jul 29, 2018 at 7:15 PM Prabhu Ramachandran
<[hidden email]> wrote:

>
> Hi all,
>
>
> vtkPythonAlgorithm is very nice and along with the dataset adapter code is really very convenient for Python users.
>
> I just found a bug with the vtkPythonAlgorithm.  I haven't had the chance to look at the error or debug it but thought I'd quickly share the issue.  Basically if any of the required methods raise an exception, you get a segfault and no error/traceback.  Attached is a simple example based on Berk's really nice blog post.
>
> I've left one incorrect line of code in the ProcessRequest method to show the segfault but this error could have been in any of the methods and you'll end up with a segfault. I've left these commented out.  I tested this with VTK 8.1.1 but not with master.
>
> Thank you!
>
> cheers,
>
> Prabhu
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtk-developers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: A bug in vtkPythonAlgorithm

Prabhu Ramachandran-3
On 7/30/18 11:34 AM, Utkarsh Ayachit wrote:
Prabhu,

With `master` (v8.1.1-2403-g4ba8e48), the script doesn't seem to
segfault. I suspect this may have fixed it:
https://gitlab.kitware.com/vtk/vtk/commit/4b477bb56784adf4fb345757f158036f16b0e747

Thank you for checking and the fix!  Fancy time machine you have there. :)

cheers,
Prabhu

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: A bug in vtkPythonAlgorithm

Utkarsh Ayachit
> Thank you for checking and the fix!  Fancy time machine you have there. :)

Haha! I think this is more due to my spoon-bending clairvoyance ;).
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers