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.

segmentation fault from LineString.interpolate()

See original GitHub issue

@snorfalorpagus, here you go:

Expected behavior and actual behavior.

Should throw a traceback or warning when attempting to interpolate a point along a LINESTRING EMPTY object, but instead crashes the kernel.

Steps to reproduce the problem

  • gist in notebook that results in a dead kernel (and see .png end of issue report)
  • this code chunk (below) results in a segmentation fault:
# python shapely_interpolate_segmentation_fault.py
import faulthandler
faulthandler.enable()
from shapely.geometry import Point, LineString
test_line = LineString(((0,0), (1,1), (2,1)))
print(test_line)
empty_line = test_line.parallel_offset(10., side='right')
print(empty_line)
empty_line.interpolate(.5, normalized=True)
$ python shapely_interpolate_segmentation_fault.py
LINESTRING (0 0, 1 1, 2 1)
LINESTRING EMPTY
Fatal Python error: Segmentation fault

Current thread 0x000000010ce7f5c0 (most recent call first):
  File "/Users/user/miniconda3/envs/py3_at1866/lib/python3.6/site-packages/shapely/linref.py", line 22 in __call__
  File "/Users/user/miniconda3/envs/py3_at1866/lib/python3.6/site-packages/shapely/geometry/base.py", line 777 in interpolate
  File "/Users/user/miniconda3/envs/py3_at1866/lib/python3.6/site-packages/shapely/impl.py", line 37 in wrapper
  File "shapely_interpolate_segmentation_fault.py", line 9 in <module>
Segmentation fault: 11

Operating system

  • Mac OS X 10.14

Shapely version and provenance

  • 1.6b4 installed from conda

dead_kernel

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
kannescommented, Nov 1, 2018
1reaction
snorfalorpaguscommented, Nov 3, 2018

+ a simple unit test

Read more comments on GitHub >

github_iconTop Results From Across the Web

segmentation fault from LineString.interpolate() #653 - GitHub
Should throw a traceback or warning when attempting to interpolate a point along a LINESTRING EMPTY object, but instead crashes the kernel.
Read more >
Segmentation fault when running scipy interpolate
This isn't necessarily an answer but just more info, when I execute that exact code I get this as output all as error...
Read more >
How to Interpolate Along a Linestring - Atomic Spin
The Simple Case: Interpolate on a Line Segment. If we have a single line segment of two points, we want to do a...
Read more >
Interpolating Points using Shapely - GIS Stack Exchange
Given a distance in metres (x) and two coordinate pairs in lat/lon format (which form a line segment), I am trying to find...
Read more >
https://raw.githubusercontent.com/Toblerity/Shapel...
Segmentation faults from interpolating on an empty linestring are prevented by #655. - A missing special case for rectangular polygons has been added...
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