question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

streamlines_evenly_spaced_2D: Segmentation fault when using vtk==8.2.0

See original GitHub issue

Describe the bug, what’s wrong, and what you expect: When my test plot of a dipole field, changing some of the default parameters leads to a segmentation fault. I’m using the git dev0 version (e79c03369dcaf57292ae6b7b366410d82debcee7), NOT the 0.13.3 release (which does not have the streamlines_evenly_spaced_2d feature).

I have also tested the data in Paraview using the corresponding filter and it worked fine.


To Reproduce

Please include a code snippet to reproduce the bug in the block below:

# Full code https://gist.github.com/liangwang0734/5d734a82dedefcfeaf078ffa9f18eb60
        streamlines = grid.streamlines_evenly_spaced_2D(
            vectors='bfield',
            start_position=(-0.6, 0, 0),
            integrator_type=2,
            step_length=0.2,
            step_unit='cl',
            max_steps=2000,
            terminal_speed=1e-12,
            interpolator_type='point',
            separating_distance=10,
            separating_distance_ratio=0.004,  # default is None
            closed_loop_maximum_distance=0.5,
            loop_angle=20,
            minimum_number_of_loop_points=4,
            compute_vorticity=True)


Screenshots If applicable, add screenshots to help explain your problem.


System Information: Please run the following code wherever you are experiencing the bug and paste the output below. This report helps us track down bugs and it is critical to addressing your bug:

# Get system info
import pyvista as pv
print(pv.Report())
  Date: Fri Jul 09 22:40:43 2021 EDT

                OS : Linux
            CPU(s) : 8
           Machine : x86_64
      Architecture : 64bit
               RAM : 31.2 GiB
       Environment : Python
        GPU Vendor : NVIDIA Corporation
      GPU Renderer : NVIDIA GeForce MX130/PCIe/SSE2
       GPU Version : 4.5.0 NVIDIA 465.31

  Python 3.8.5 (default, Sep  4 2020, 07:30:14)  [GCC 7.3.0]

           pyvista : 0.31.dev0
               vtk : 8.2.0
             numpy : 1.19.2
           imageio : 2.9.0
           appdirs : 1.4.4
            scooby : 0.5.7
            meshio : 4.4.6
        matplotlib : 3.3.2
           IPython : 7.25.0
             scipy : 1.6.2
              tqdm : 4.49.0

  Intel(R) Math Kernel Library Version 2020.0.4 Product Build 20200917 for
  Intel(R) 64 architecture applications

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MatthewFlammcommented, Jul 14, 2021

Sounds like you uncovered a bug in vtk that was fixed. I will update the title so it is easier to find for others that run into the same issue.

1reaction
MatthewFlammcommented, Jul 10, 2021

Thanks for testing this new feature before release. I cannot test your code directly for a little over a week, but I have some comments/questions until then. Is the segfault occurring during the streamline generation or plotting in matplotlib?

I find it isn’t uncommon for seg faults to occur in the streamlines filter with choices of small numbers for the separating_distance and separating_distance_ratio. separating_distance_ratio in particular sets the distance to terminate adjacent streamlines according to separating_distance*separating_distance_ratio, so your value is equal to .04 cell lengths. You can try increasing separating_distance_ratio and see if it helps. It is unclear what the default value is in the underlying vtk filter.

I have also tested the data in Paraview using the corresponding filter and it worked fine.

Was this with the exact same parameters that fails here? I’m not sure that the defaults in paraview are the same as in the underlying vtk filter or the values used in pyvista.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segmentation fault when using graph function (vtk 6.1, Qt5. ...
I have no idea how this error occurs. I have recompiled VTK in debug mode and get more debug info. This is the...
Read more >
Segmentation fault in Visualizer demo - Support
Hello, I am new to using VTK. Sorry if this very basic question. But I am unable to proceed with my own project....
Read more >
Segmentation fault when building with VTKm
Hello! I'm trying to build ParaView with VTKm enabled but all binaries (paraview, pvpython, and servers) failed with SIGSEGV (segmentation ...
Read more >
vtkStaticCellLocator results into a segmentation fault when ...
I get a segmentation fault when I try to use vtkStaticCellLocator's FindCell in parallel using OpenMP. Sequentially runs just fine.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found