ekumenlabs / terminus

Library to create cities and terrains
Apache License 2.0
56 stars 29 forks source link

SVG Tool review with big cities #89

Closed agalbachicar closed 7 years ago

agalbachicar commented 7 years ago

The problem came with a big file, like 90KB. The tool output was the following:

RNDF does not use GPS waypoints [1] 20276 segmentation fault

basicNew commented 7 years ago

The problem doesn't have to do with file size, but with corrupted RNDF files (we have a bug on our side). In the following two samples (that throw different errors) see how segment ids are repeated. Having said that, we are using the visualizer as an RNDF checker also, so we need for it to throw the proper error here.

$ ./rndf_visualizer -g ../../../generated_worlds/city.rndf
RNDF does not use GPS waypoints
Segmentation fault (core dumped)
RNDF_name   city_1
num_segments    12
num_zones   0
format_version  1.0
segment 1
num_lanes   1
segment_name    trunk_2
lane    1.1
num_waypoints   4
lane_width  10
exit    1.1.3   6.1.2
1.1.1   10.001797   65.000000
1.1.2   10.002695   65.000000
1.1.3   10.003548   65.000000
1.1.4   10.003593   65.000000
end_lane
end_segment
segment 2
num_lanes   1
segment_name    trunk_3
lane    2.1
num_waypoints   3
lane_width  10
exit    2.1.2   8.1.2
2.1.1   9.998203    65.000000
2.1.2   9.997350    65.000000
2.1.3   9.997305    65.000000
end_lane
end_segment
segment 3
num_lanes   1
segment_name    trunk_4
lane    3.1
num_waypoints   4
lane_width  10
exit    3.1.3   10.1.2
3.1.1   10.000000   65.002141
3.1.2   10.000000   65.003212
3.1.3   10.000000   65.004229
3.1.4   10.000000   65.004282
end_lane
end_segment
segment 4
num_lanes   1
segment_name    trunk_5
lane    4.1
num_waypoints   3
lane_width  10
exit    4.1.2   12.1.2
4.1.1   10.000000   64.997859
4.1.2   10.000000   64.996842
4.1.3   10.000000   64.996788
end_lane
end_segment
segment 5
num_lanes   1
segment_name    street_6
lane    5.1
num_waypoints   3
lane_width  5
5.1.1   10.003593   65.000000
5.1.2   10.003593   64.999946
5.1.3   10.003593   64.998929
end_lane
end_segment
segment 6
num_lanes   1
segment_name    street_7
lane    6.1
num_waypoints   3
lane_width  5
6.1.1   10.003593   65.000000
6.1.2   10.003593   65.000054
6.1.3   10.003593   65.001071
end_lane
end_segment
segment 7
num_lanes   1
segment_name    street_8
lane    7.1
num_waypoints   3
lane_width  5
7.1.1   9.997305    65.000000
7.1.2   9.997305    65.000054
7.1.3   9.997305    65.001071
end_lane
end_segment
segment 8
num_lanes   1
segment_name    street_9
lane    8.1
num_waypoints   3
lane_width  5
8.1.1   9.997305    65.000000
8.1.2   9.997305    64.999946
8.1.3   9.997305    64.998929
end_lane
end_segment
segment 10
num_lanes   1
segment_name    street_10
lane    10.1
num_waypoints   3
lane_width  5
10.1.1  10.000000   65.004282
10.1.2  10.000045   65.004282
10.1.3  10.000898   65.004282
end_lane
end_segment
segment 10
num_lanes   1
segment_name    street_11
lane    10.1
num_waypoints   3
lane_width  5
10.1.1  10.000000   65.004282
10.1.2  10.000045   65.004282
10.1.3  10.000898   65.004282
end_lane
end_segment
segment 12
num_lanes   1
segment_name    street_12
lane    12.1
num_waypoints   3
lane_width  5
12.1.1  10.000000   64.996788
12.1.2  9.999955    64.996788
12.1.3  9.999102    64.996788
end_lane
end_segment
segment 12
num_lanes   1
segment_name    street_13
lane    12.1
num_waypoints   3
lane_width  5
12.1.1  10.000000   64.996788
12.1.2  9.999955    64.996788
12.1.3  9.999102    64.996788
end_lane
end_segment
end_file
$ ./rndf_visualizer -g ../../../generated_worlds/city.rndf
*** Error in `./rndf_visualizer': malloc(): memory corruption: 0x000000000268e630 ***
Aborted (core dumped)
RNDF_name   city_1
num_segments    9
num_zones   0
format_version  1.0
segment 1
num_lanes   1
segment_name    trunk_2
lane    1.1
num_waypoints   3
lane_width  10
exit    1.1.2   5.1.2
1.1.1   10.001797   65.000000
1.1.2   10.002650   65.000000
1.1.3   10.002695   65.000000
end_lane
end_segment
segment 2
num_lanes   1
segment_name    trunk_3
lane    2.1
num_waypoints   4
lane_width  10
exit    2.1.3   6.1.2
2.1.1   9.998203    65.000000
2.1.2   9.997305    65.000000
2.1.3   9.996452    65.000000
2.1.4   9.996407    65.000000
end_lane
end_segment
segment 3
num_lanes   1
segment_name    trunk_4
lane    3.1
num_waypoints   4
lane_width  10
exit    3.1.3   8.1.2
3.1.1   10.000000   65.002141
3.1.2   10.000000   65.003212
3.1.3   10.000000   65.004229
3.1.4   10.000000   65.004282
end_lane
end_segment
segment 4
num_lanes   1
segment_name    trunk_5
lane    4.1
num_waypoints   4
lane_width  10
exit    4.1.3   9.1.2
4.1.1   10.000000   64.997859
4.1.2   10.000000   64.996788
4.1.3   10.000000   64.995771
4.1.4   10.000000   64.995718
end_lane
end_segment
segment 5
num_lanes   1
segment_name    street_6
lane    5.1
num_waypoints   3
lane_width  5
5.1.1   10.002695   65.000000
5.1.2   10.002695   65.000054
5.1.3   10.002695   65.001071
end_lane
end_segment
segment 6
num_lanes   1
segment_name    street_7
lane    6.1
num_waypoints   3
lane_width  5
6.1.1   9.996407    65.000000
6.1.2   9.996407    65.000054
6.1.3   9.996407    65.001071
end_lane
end_segment
segment 8
num_lanes   1
segment_name    street_8
lane    8.1
num_waypoints   3
lane_width  5
8.1.1   10.000000   65.004282
8.1.2   10.000045   65.004282
8.1.3   10.000898   65.004282
end_lane
end_segment
segment 8
num_lanes   1
segment_name    street_9
lane    8.1
num_waypoints   3
lane_width  5
8.1.1   10.000000   65.004282
8.1.2   10.000045   65.004282
8.1.3   10.000898   65.004282
end_lane
end_segment
segment 9
num_lanes   1
segment_name    street_10
lane    9.1
num_waypoints   3
lane_width  5
9.1.1   10.000000   64.995718
9.1.2   9.999955    64.995718
9.1.3   9.999102    64.995718
end_lane
end_segment
end_file
basicNew commented 7 years ago

@agalbachicar it would be great if you could give this one high priority, having the viewer/checker is pretty important for us now. Thanks!

agalbachicar commented 7 years ago

@basicNew @ernestmc @garyservin, perhaps you find it useful, segments where repeated and as you can see, repeated segments do not have exit points definitions waypoints defined inside the segment may be entry waypoints.