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 in intersection #21

Closed
ghazel opened this issue Feb 2, 2012 · 2 comments
Closed

segmentation fault in intersection #21

ghazel opened this issue Feb 2, 2012 · 2 comments

Comments

@ghazel
Copy link

ghazel commented Feb 2, 2012

I know the projection is mismatched, but a segfault seems extreme:

require 'rgeo'
f = RGeo::Geographic.simple_mercator_factory
loc = f.line_string([f.point(-123, 37), f.point(-122, 38)])
f2 = f.projection_factory
loc2 = f2.line_string([f2.point(-123, 37), f2.point(-122, 38)])
p loc.envelope.intersection(loc2.envelope)
p loc2.envelope.intersection(loc.envelope)

produces:

#<RGeo::Geographic::ProjectedPolygonImpl:0x-2447e002 "POLYGON ((-122.0 37.0, -123.0 37.0, -123.0 38.0, -122.0 38.0, -122.0 37.0))">
rgeo_bug.rb:7: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-linux]

Aborted

gdb says:

(gdb) bt
#0  0x004e5f20 in rgeo_convert_to_geos_geometry (factory=3085063400, obj=3085036880, type=4) at factory.c:361
#1  0x004e4b46 in method_geometry_intersection (self=3085062080, rhs=3085036880) at geometry.c:660
#2  0x00159a6c in call_cfunc (func=0x4e4b05 <method_geometry_intersection>, recv=<value optimized out>, len=1, argc=1, argv=0xbfffeb10) at eval.c:5784
#3  0x00164850 in rb_call0 (klass=3086034680, recv=3085062080, id=20161, oid=20161, argc=1, argv=0xbfffeb10, body=0xb7f1176c, flags=0) at eval.c:5928
#4  0x001649e5 in rb_call (klass=3086034680, recv=3085062080, mid=20161, argc=1, argv=0xbfffeb10, scope=0, self=<value optimized out>) at eval.c:6176
#5  0x00161e23 in rb_eval (self=3086960980, n=0xb7ea1408) at eval.c:3506
#6  0x0015f5cb in rb_eval (self=3086960980, n=0xb7ea13e0) at eval.c:3516
#7  0x00170214 in ruby_exec_internal () at eval.c:1654
#8  0x00170254 in ruby_exec () at eval.c:1674
#9  0x00170289 in ruby_run () at eval.c:1684
#10 0x08048655 in main (argc=2, argv=0xbffff614, envp=0xbffff620) at main.c:48

rgeo-0.3.2, libgeos-3.3.1

@dazuma
Copy link
Member

dazuma commented Feb 21, 2012

Thanks. I was able to reproduce this on ruby 1.8.7. (1.9.x versions seem to be immune.) I'll get a fix out today.

@dazuma
Copy link
Member

dazuma commented Mar 3, 2012

This was fixed in release 0.3.4. Sorry, forgot to close out this issue.

@dazuma dazuma closed this as completed Mar 3, 2012
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

2 participants