Opened 9 years ago

Closed 9 years ago

#3143 closed defect (fixed)

32-bit cunit check crashing

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 2.2.0
Component: postgis Version: master
Keywords: Cc: strk

Description

As Nicklas noted in postgis-devel https://lists.osgeo.org/pipermail/postgis-devel/2015-May/024934.html

Winnie 32-bit runs have been crashing intermittenly on CUnit. Unfortunately it crashes on my pc as well when running mingw in 32-bit mode.

On winnie it crashes more often than not crashing here:

  Test: test_lw_dist2d_seg_arc ...passed
  Test: test_lw_dist2d_arc_arc ...passed
  Test: test_lw_arc_length ...passed
  Test: test_lw_dist2d_pt_ptarrayarc ...passed
  Test: test_lw_dist2d_ptarray_ptarrayarc ...passed
  Test: test_lwgeom_tcpa ...Makefile:80: recipe for target `check'
failed
make[2]: *** [check] Error 5
make[2]: Leaving directory
`/projects/postgis/branches/2.2/liblwgeom/cunit'
Makefile:168: recipe for target `check' failed
make[1]: *** [check] Error 2
make[1]: Leaving directory `/projects/postgis/branches/2.2/liblwgeom'
GNUmakefile:14: recipe for target `check' failed
make: *** [check] Error 1

On mine it consistently crashes here:

liblwgeom code interrupted
liblwgeom code interrupted
liblwgeom code interrupted
passed
  Test: test_lwgeom_locate_along ...passed
  Test: test_lw_dist2d_pt_arc ...passed
  Test: test_lw_dist2d_seg_arc ...passed
  Test: test_lw_dist2d_arc_arc ...passed
  Test: test_lw_arc_length ...passed
  Test: test_lw_dist2d_pt_ptarrayarc ...passed
  Test: test_lw_dist2d_ptarray_ptarrayarc ...passed
  Test: test_lwgeom_tcpa ...passed
  Test: test_lwgeom_is_trajectory ...Geometry is not a LINESTRING Line does
not have M dimension Measure of vertex 1 (1) not bigger than measure of
vertex 0 (1) Measure of vertex 1 (0) not bigger than measure of vertex 0 (1)
Measure of vertex 2 (2) not bigger than measure of vertex 1 (3) passed
Suite: effectivearea
  Test: do_test_lwgeom_effectivearea_lines ...passed
  Test: do_test_lwgeom_effectivearea_polys ...passed
Suite: miscellaneous
  Test: test_misc_force_2d ...Makefile:80: recipe for target `check' failed
make[2]: *** [check] Error 5
make[2]: Leaving directory `/projects/postgis/branches/2.2/liblwgeom/cunit'
Makefile:168: recipe for target `check' failed
make[1]: *** [check] Error 2
make[1]: Leaving directory `/projects/postgis/branches/2.2/liblwgeom'
GNUmakefile:14: recipe for target `check' failed

and if I remark out the crashing tests, it just crashes on the next one.

I did notice some odd code around misc_suite. That suite seems to be defined twice at

line 163 in liblwgeom/cunit/cu_misc.c

Not sure if there was a reason for that.

If I take that extra line out, doesn't crash on my machine. Will commit and see if it fixes the issue.

Change History (12)

comment:1 by robe, 9 years ago

Owner: changed from pramsey to robe

comment:2 by robe, 9 years ago

Committed at r13591

Seems to have fixed my local issue, hopefully makes winnie happy as well.

comment:3 by robe, 9 years ago

reverted at r13592 guess I misunderstood that piece of code and just took the tests out

comment:4 by robe, 9 years ago

Now I'm totally baffled. I thought that line made a difference, but keeping it in or taking it out the tests all seem to run.

Even more baffling is now my cunit is working with it in. Damn I hate liblwgeom installing in /usr/local and not consistently purging itself.

Only explanation I can think of is the act of changing the file forced some garbage somewhere to be purged that make clean wasn't removing. Perhaps our make clean isn't cleaning everything. What is different about winnie is she uses the same workspace for 32-bit and 64-bit runs so she would be more sensitive to issues of cleaning. I just moved her 32-bit run so it runs first now. So far passed. We'll see if it continues to pass. Then I think we need to look at our make clean closely. On jenkins the svn update on first run purges all files not part of SVN (so first run is always clean even if our make clean is defective).

Last edited 9 years ago by robe (previous) (diff)

comment:5 by robe, 9 years ago

Summary: Window 32-bit cunit check crashing intermittently32-bit cunit check crashing

I got winnie to stop crashing by moving the 32-bit 9.4 run above the others. My desktop mysteriously stopped crashing.

It doesn't seem to be a windows issue though because Brian Hamlin got hist 32-bit to crash consistently, so it seems something is wrong possibly how we are clearing memory.

See his pastebin: http://paste.debian.net/191485/

and related threads on postgis-dev

https://lists.osgeo.org/pipermail/postgis-devel/2015-May/024942.html

comment:6 by darkblueb, 9 years ago

in this 32bit Ubuntu VM, it appears to crash every time.. as shown below, it seems to be in lwlinearreferencing.c:1174

Checked out revision 13600.
---
user@lubase-1404:~/srcs/postgis_trunk$ CFLAGS='-g' CXXFLAGS='-g' ./configure --enable-profile
--
  PostGIS is now configured for i686-pc-linux-gnu

 -------------- Compiler Info ------------- 
  C compiler:           gcc -g
  C++ compiler:         g++ -g
  SQL preprocessor:     /usr/bin/cpp -traditional-cpp -w -P

 -------------- Dependencies -------------- 
  GEOS config:          /usr/local/bin/geos-config
  GEOS version:         3.5.0dev
  GDAL config:          /usr/bin/gdal-config
  GDAL version:         1.11.1
  PostgreSQL config:    /usr/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.3.7
  PROJ4 version:        49
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.9.1
  JSON-C support:       yes
  PCRE support:       yes
  PostGIS debug level:  0
  Perl:                 /usr/bin/perl

 --------------- Extensions --------------- 
  PostGIS Raster:       enabled
  PostGIS Topology:     enabled
  SFCGAL support:       disabled
  Address Standardizer support:       enabled

 -------- Documentation Generation -------- 
  xsltproc:             
  xsl style sheets:     
  dblatex:              
  convert:              
  mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtd

---
user@lubase-1404:~/srcs/postgis_trunk$  gdb /home/user/srcs/postgis_trunk/liblwgeom/cunit/.libs/lt-cu_tester
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/user/srcs/postgis_trunk/liblwgeom/cunit/.libs/lt-cu_tester...done.
(gdb) run
Starting program: /home/user/srcs/postgis_trunk/liblwgeom/cunit/.libs/lt-cu_tester 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".


     CUnit - A unit testing framework for C - Version 2.1-2
     http://cunit.sourceforge.net/


Suite: computational_geometry
  Test: test_lw_segment_side ...passed
  Test: test_lw_segment_intersects ...passed
  Test: test_lwline_crossing_short_lines ...passed
  Test: test_lwline_crossing_long_lines ...passed
  Test: test_lwline_crossing_bugs ...passed
  Test: test_lwpoint_set_ordinate ...passed
  Test: test_lwpoint_get_ordinate ...passed
  Test: test_point_interpolate ...passed
  Test: test_lwline_clip ...passed
  Test: test_lwline_clip_big ...passed
  Test: test_lwmline_clip ...passed
  Test: test_geohash_point ...passed
  Test: test_geohash_precision ...passed
  Test: test_geohash ...passed
  Test: test_geohash_point_as_int ...passed
  Test: test_isclosed ...passed
  Test: test_lwgeom_simplify ...passed
Suite: buildarea
  Test: buildarea1 ...passed
  Test: buildarea2 ...passed
  Test: buildarea3 ...passed
  Test: buildarea4 ...passed
  Test: buildarea4b ...passed
  Test: buildarea5 ...passed
  Test: buildarea6 ...passed
  Test: buildarea7 ...passed
Suite: geometry_clean
  Test: test_lwgeom_make_valid ...passed
Suite: clip_by_rectangle
  Test: test_lwgeom_clip_by_rect ...passed
Suite: force_sfs
  Test: test_sfs_11 ...passed
  Test: test_sfs_12 ...passed
  Test: test_sqlmm ...passed
Suite: geodetic
  Test: test_sphere_direction ...passed
  Test: test_sphere_project ...passed
  Test: test_lwgeom_area_sphere ...passed
  Test: test_signum ...passed
  Test: test_gbox_from_spherical_coordinates ...passed
  Test: test_gserialized_get_gbox_geocentric ...passed
  Test: test_clairaut ...passed
  Test: test_edge_intersection ...passed
  Test: test_edge_intersects ...passed
  Test: test_edge_distance_to_point ...passed
  Test: test_edge_distance_to_edge ...passed
  Test: test_lwgeom_distance_sphere ...passed
  Test: test_lwgeom_check_geodetic ...passed
  Test: test_gserialized_from_lwgeom ...passed
  Test: test_spheroid_distance ...passed
  Test: test_spheroid_area ...passed
  Test: test_lwpoly_covers_point2d ...passed
  Test: test_gbox_utils ...passed
  Test: test_vector_angle ...passed
  Test: test_vector_rotate ...passed
  Test: test_lwgeom_segmentize_sphere ...passed
  Test: test_ptarray_contains_point_sphere ...passed
  Test: test_ptarray_contains_point_sphere_iowa ...passed
Suite: GEOS
  Test: test_geos_noop ...passed
  Test: test_geos_subdivide ...
--------
GEOMETRYCOLLECTION(LINESTRING(0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 13,0 14,0 15,0 16,0 17,0 18,0 19,0 20,0 21,0 22,0 23,0 24,0 25,0 26,0 27,0 28,0 29,0 30,0 31,0 32,0 33,0 34,0 35,0 36,0 37,0 38,0 39,0 40,0 41,0 42,0 43,0 44,0 45,0 46,0 47,0 48,0 49,0 50,0 50),LINESTRING(0 50,0 50,0 51,0 52,0 53,0 54,0 55,0 56,0 57,0 58,0 59,0 60,0 61,0 62,0 63,0 64,0 65,0 66,0 67,0 68,0 69,0 70,0 71,0 72,0 73,0 74,0 75,0 76,0 77,0 78,0 79,0 80,0 81,0 82,0 83,0 84,0 85,0 86,0 87,0 88,0 89,0 90,0 91,0 92,0 93,0 94,0 95,0 96,0 97,0 98,0 99,0 100))
--------

--------
GEOMETRYCOLLECTION(LINESTRING(0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 12.5),LINESTRING(0 12.5,0 13,0 14,0 15,0 16,0 17,0 18,0 19,0 20,0 21,0 22,0 23,0 24,0 25),LINESTRING(0 25,0 25,0 26,0 27,0 28,0 29,0 30,0 31,0 32,0 33,0 34,0 35,0 36,0 37,0 37.5),LINESTRING(0 37.5,0 38,0 39,0 40,0 41,0 42,0 43,0 44,0 45,0 46,0 47,0 48,0 49,0 50),LINESTRING(0 50,0 50,0 51,0 52,0 53,0 54,0 55,0 56,0 57,0 58,0 59,0 60,0 61,0 62,0 62.5),LINESTRING(0 62.5,0 63,0 64,0 65,0 66,0 67,0 68,0 69,0 70,0 71,0 72,0 73,0 74,0 75),LINESTRING(0 75,0 75,0 76,0 77,0 78,0 79,0 80,0 81,0 82,0 83,0 84,0 85,0 86,0 87,0 87.5),LINESTRING(0 87.5,0 88,0 89,0 90,0 91,0 92,0 93,0 94,0 95,0 96,0 97,0 98,0 99,0 100))
--------
passed
Suite: homogenize
  Test: test_coll_point ...passed
  Test: test_coll_line ...passed
  Test: test_coll_poly ...passed
  Test: test_coll_coll ...passed
  Test: test_geom ...passed
  Test: test_coll_curve ...passed
Suite: encoded_polyline_input
  Test: in_encoded_polyline_test_geoms ...passed
  Test: in_encoded_polyline_test_precision ...passed
Suite: geojson_input
  Test: in_geojson_test_srid ...passed
  Test: in_geojson_test_bbox ...passed
  Test: in_geojson_test_geoms ...passed
Suite: twkb_input
  Test: test_twkb_in_point ...passed
  Test: test_twkb_in_linestring ...passed
  Test: test_twkb_in_polygon ...passed
  Test: test_twkb_in_multipoint ...passed
  Test: test_twkb_in_multilinestring ...passed
  Test: test_twkb_in_multipolygon ...passed
  Test: test_twkb_in_collection ...passed
  Test: test_twkb_in_precision ...passed
Suite: serialization/deserialization
  Test: test_typmod_macros ...passed
  Test: test_flags_macros ...passed
  Test: test_serialized_srid ...SRID value -3005 converted to the officially unknown SRID value 0
passed
  Test: test_gserialized_from_lwgeom_size ...passed
  Test: test_gbox_serialized_size ...passed
  Test: test_lwgeom_from_gserialized ...passed
  Test: test_lwgeom_count_vertices ...passed
  Test: test_on_gser_lwgeom_count_vertices ...passed
  Test: test_geometry_type_from_string ...passed
  Test: test_lwcollection_extract ...passed
  Test: test_lwgeom_free ...passed
  Test: test_lwgeom_flip_coordinates ...passed
  Test: test_f2d ...passed
  Test: test_lwgeom_clone ...passed
  Test: test_lwgeom_force_clockwise ...passed
  Test: test_lwgeom_calculate_gbox ...passed
  Test: test_lwgeom_is_empty ...passed
  Test: test_lwgeom_same ...passed
  Test: test_lwline_from_lwmpoint ...passed
  Test: test_lwgeom_as_curve ...passed
Suite: measures
  Test: test_mindistance2d_tolerance ...passed
  Test: test_rect_tree_contains_point ...passed
  Test: test_rect_tree_intersects_tree ...passed
  Test: test_lwgeom_segmentize2d ...liblwgeom code interrupted
liblwgeom code interrupted
liblwgeom code interrupted
liblwgeom code interrupted
passed
  Test: test_lwgeom_locate_along ...passed
  Test: test_lw_dist2d_pt_arc ...passed
  Test: test_lw_dist2d_seg_arc ...passed
  Test: test_lw_dist2d_arc_arc ...passed
  Test: test_lw_arc_length ...passed
  Test: test_lw_dist2d_pt_ptarrayarc ...passed
  Test: test_lw_dist2d_ptarray_ptarrayarc ...passed
  Test: test_lwgeom_tcpa ...*** Error in `/home/user/srcs/postgis_trunk/liblwgeom/cunit/.libs/lt-cu_tester': free(): invalid next size (fast): 0x081361c0 ***

Program received signal SIGABRT, Aborted.
0xb7fdd424 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7fdd424 in __kernel_vsyscall ()
#1  0xb7d79607 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#2  0xb7d7ca33 in __GI_abort () at abort.c:89
#3  0xb7db3e53 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0xb7eb0edc "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#4  0xb7dbe33a in malloc_printerr (action=<optimized out>, 
    str=0xb7eb107c "free(): invalid next size (fast)", ptr=0x81361c0) at malloc.c:4996
#5  0xb7dbefad in _int_free (av=0xb7ef5420 <main_arena>, p=<optimized out>, have_lock=0)
    at malloc.c:3840
#6  0xb7f9802b in default_freeor (mem=0x81361c0) at lwutil.c:100
#7  0xb7f9828f in lwfree (mem=0x81361c0) at lwutil.c:177
#8  0xb7f9eb52 in lwgeom_tcpa (g1=0x8136160, g2=0x8135928, mindist=0xbfffef90)
    at lwlinearreferencing.c:1174
#9  0x08060737 in test_lwgeom_tcpa () at cu_measures.c:963
#10 0xb7f4345c in ?? () from /usr/lib/libcunit.so.1
#11 0xb7f43747 in ?? () from /usr/lib/libcunit.so.1
#12 0xb7f43cc2 in CU_run_all_tests () from /usr/lib/libcunit.so.1
#13 0xb7f4716f in CU_basic_run_tests () from /usr/lib/libcunit.so.1
#14 0x08076075 in main (argc=1, argv=0xbffff204) at cu_tester.c:152
(gdb)

comment:7 by darkblueb, 9 years ago

this is the (truncated) verbose output mentioned above :

PostGIS is now configured for i686-pc-linux-gnu

 -------------- Compiler Info ------------- 
  C compiler:           gcc -g -O2
  C++ compiler:         g++ -g -O2
  SQL preprocessor:     /usr/bin/cpp -traditional-cpp -w -P

 -------------- Dependencies -------------- 
  GEOS config:          /usr/local/bin/geos-config
  GEOS version:         3.5.0dev
  GDAL config:          /usr/bin/gdal-config
  GDAL version:         1.11.1
  PostgreSQL config:    /usr/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.3.7
  PROJ4 version:        49
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.9.1
  JSON-C support:       yes
  PCRE support:       yes
  PostGIS debug level:  4
  Perl:                 /usr/bin/perl

 --------------- Extensions --------------- 
  PostGIS Raster:       enabled
  PostGIS Topology:     enabled
  SFCGAL support:       disabled
  Address Standardizer support:       enabled

 -------- Documentation Generation -------- 
  xsltproc:             
  xsl style sheets:     
  dblatex:              
  convert:              
  mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtd

user@lubase-1404:~/srcs/postgis_trunk$ svn info
Path: .
Working Copy Root Path: /home/user/srcs/postgis_trunk
URL: http://svn.osgeo.org/postgis/trunk
Relative URL: ^/trunk
Repository Root: http://svn.osgeo.org/postgis
Repository UUID: b70326c6-7e19-0410-871a-916f4a2858ee
Revision: 13594
Node Kind: directory
Schedule: normal
Last Changed Author: robe
Last Changed Rev: 13594
Last Changed Date: 2015-05-31 13:30:47 -0700 (Sun, 31 May 2015)

==

user@lubase-1404:~/srcs/postgis_trunk$ make check
/usr/bin/perl utils/svn_repo_revision.pl
Not updating existing rev file at 13594
for s in liblwgeom libpgcommon postgis regress raster topology loader utils doc ; do \
		echo "---- Making all in ${s}"; \
		make -C ${s} all || exit 1; \
	done;
---- Making all in liblwgeom
make[1]: Entering directory `/home/user/srcs/postgis_trunk/liblwgeom'
: -i lwin_wkt_lex.l
make[1]: Leaving directory `/home/user/srcs/postgis_trunk/liblwgeom'
---- Making all in libpgcommon
make[1]: Entering directory `/home/user/srcs/postgis_trunk/libpgcommon'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/user/srcs/postgis_trunk/libpgcommon'
---- Making all in postgis
make[1]: Entering directory `/home/user/srcs/postgis_trunk/postgis'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/user/srcs/postgis_trunk/postgis'
---- Making all in regress
make[1]: Entering directory `/home/user/srcs/postgis_trunk/regress'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/user/srcs/postgis_trunk/regress'
---- Making all in raster
make[1]: Entering directory `/home/user/srcs/postgis_trunk/raster'
make -C rt_core
make[2]: Entering directory `/home/user/srcs/postgis_trunk/raster/rt_core'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/user/srcs/postgis_trunk/raster/rt_core'

for s in liblwgeom libpgcommon postgis regress raster topology loader utils doc ; do \
		echo "---- Making check in ${s}"; \
		make -C ${s} check || exit 1; \
	done;
---- Making check in liblwgeom
make[1]: Entering directory `/home/user/srcs/postgis_trunk/liblwgeom'
: -i lwin_wkt_lex.l
make -C cunit check
make[2]: Entering directory `/home/user/srcs/postgis_trunk/liblwgeom/cunit'
/bin/bash ../../libtool --mode=link gcc -g -O2  -Wall -Wmissing-prototypes -I/usr/local/include  -I.. -o cu_tester cu_algorithm.o cu_bytebuffer.o cu_buildarea.o cu_clean.o cu_print.o cu_misc.o cu_ptarray.o cu_geodetic.o cu_geos.o cu_tree.o cu_measures.o cu_effectivearea.o cu_node.o cu_clip_by_rect.o cu_libgeom.o cu_split.o cu_stringbuffer.o cu_triangulate.o cu_homogenize.o cu_force_sfs.o cu_out_twkb.o cu_out_wkt.o cu_out_wkb.o cu_out_gml.o cu_out_kml.o cu_out_geojson.o cu_out_svg.o cu_out_encoded_polyline.o cu_surface.o cu_out_x3d.o cu_in_geojson.o cu_in_twkb.o cu_in_wkb.o cu_in_wkt.o cu_in_encoded_polyline.o cu_varint.o cu_tester.o ../liblwgeom.la -L/usr/local/lib -lgeos_c -lcunit -lm
libtool: link: gcc -g -O2 -Wall -Wmissing-prototypes -I/usr/local/include -I.. -o .libs/cu_tester cu_algorithm.o cu_bytebuffer.o cu_buildarea.o cu_clean.o cu_print.o cu_misc.o cu_ptarray.o cu_geodetic.o cu_geos.o cu_tree.o cu_measures.o cu_effectivearea.o cu_node.o cu_clip_by_rect.o cu_libgeom.o cu_split.o cu_stringbuffer.o cu_triangulate.o cu_homogenize.o cu_force_sfs.o cu_out_twkb.o cu_out_wkt.o cu_out_wkb.o cu_out_gml.o cu_out_kml.o cu_out_geojson.o cu_out_svg.o cu_out_encoded_polyline.o cu_surface.o cu_out_x3d.o cu_in_geojson.o cu_in_twkb.o cu_in_wkb.o cu_in_wkt.o cu_in_encoded_polyline.o cu_varint.o cu_tester.o  ../.libs/liblwgeom.so -L/usr/local/lib /usr/local/lib/libgeos_c.so -lcunit -lm


     CUnit - A unit testing framework for C - Version 2.1-2
     http://cunit.sourceforge.net/

[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2

Suite: computational_geometry
  Test: test_lw_segment_side ...passed
  Test: test_lw_segment_intersects ...[lwalgorithm.c:lw_segment_intersects:404] pq1=4.24399158143648e-314 pq2=-nan
[lwalgorithm.c:lw_segment_intersects:405] qp1=-nan qp2=-nan
[lwalgorithm.c:lw_segment_intersects:404] pq1=-nan pq2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:405] qp1=4.24399158143648e-314 qp2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:404] pq1=-nan pq2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:405] qp1=2.12199579047121e-314 qp2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:404] pq1=-nan pq2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:405] qp1=2.12199579096527e-314 qp2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:404] pq1=-nan pq2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:405] qp1=2.12199579096527e-314 qp2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:404] pq1=-nan pq2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:405] qp1=2.12199579047121e-314 qp2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:404] pq1=2.12199579047121e-314 pq2=-nan
[lwalgorithm.c:lw_segment_intersects:405] qp1=-nan qp2=-nan
[lwalgorithm.c:lw_segment_intersects:404] pq1=2.12199579096527e-314 pq2=2.96439387504748e-323
[lwalgorithm.c:lw_segment_intersects:405] qp1=-nan qp2=2.96439387504748e-323
[lwalgorithm.c:lw_segment_intersects:404] pq1=2.12199579047121e-314 pq2=-nan
[lwalgorithm.c:lw_segment_intersects:405] qp1=-nan qp2=-nan
[lwalgorithm.c:lw_segment_intersects:404] pq1=4.94065645841247e-324 pq2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:405] qp1=4.24399158143648e-314 qp2=2.12199579392967e-314
[lwalgorithm.c:lw_segment_intersects:404] pq1=2.12199579047121e-314 pq2=-nan
[lwalgorithm.c:lw_segment_intersects:405] qp1=4.94065645841247e-324 qp2=-nan
[lwalgorithm.c:lw_segment_intersects:404] pq1=-nan pq2=2.96439387504748e-323
[lwalgorithm.c:lw_segment_intersects:405] qp1=2.12199579096527e-314 qp2=2.96439387504748e-323
[lwalgorithm.c:lw_segment_intersects:404] pq1=2.12199579096527e-314 pq2=2.96439387504748e-323
[lwalgorithm.c:lw_segment_intersects:405] qp1=-nan qp2=2.96439387504748e-323
passed
  Test: test_lwline_crossing_short_lines ...[lwout_wkt.c:lwgeom_to_wkt_sb:590] lwgeom_to_wkt_sb: type LineString, hasz 2, hasm 0
........
  Test: test_lwgeom_tcpa ...[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825e7c0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x82606d0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825dcc8
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_point_new:309] entered
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825c6e8
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825ebb0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x82606d0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825dcc8
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825c6e8
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825e7c0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x82606d0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[g_box.c:lwgeom_calculate_gbox_cartesian:634] lwgeom_calculate_gbox got type (2) - LineString
[g_box.c:ptarray_calculate_gbox_cartesian:508] ptarray_calculate_gbox Z: 0 M: 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264578, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264590, zmflag 1
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[g_box.c:lwgeom_calculate_gbox_cartesian:634] lwgeom_calculate_gbox got type (2) - LineString
[g_box.c:ptarray_calculate_gbox_cartesian:508] ptarray_calculate_gbox Z: 0 M: 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645e0, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645f8, zmflag 1
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825dcc8
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825c6e8
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[g_box.c:lwgeom_calculate_gbox_cartesian:634] lwgeom_calculate_gbox got type (2) - LineString
[g_box.c:ptarray_calculate_gbox_cartesian:508] ptarray_calculate_gbox Z: 0 M: 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264578, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264590, zmflag 1
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[g_box.c:lwgeom_calculate_gbox_cartesian:634] lwgeom_calculate_gbox got type (2) - LineString
[g_box.c:ptarray_calculate_gbox_cartesian:508] ptarray_calculate_gbox Z: 0 M: 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645e0, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645f8, zmflag 1
[measures3d.c:lwgeom_mindistance3d:189] lwgeom_mindistance3d is called
[measures3d.c:lwgeom_mindistance3d_tolerance:201] lwgeom_mindistance3d_tolerance is called
[measures3d.c:lw_dist3d_recursive:238] lw_dist3d_recursive is called with type1=2, type2=2
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[measures3d.c:lw_dist3d_distribute_bruteforce:315] lw_dist3d_distribute_bruteforce is called with typ1=2, type2=2
[measures3d.c:lw_dist3d_line_line:485] lw_dist3d_line_line is called
[measures3d.c:lw_dist3d_ptarray_ptarray:670] lw_dist3d_ptarray_ptarray called (points: 2-2)
[lwgeom_api.c:getPoint3dz_p:319] getPoint3dz_p called on array of 3-dimensions / 2 pts
[lwgeom_api.c:getPoint3dz_p:319] getPoint3dz_p called on array of 3-dimensions / 2 pts
[lwgeom_api.c:getPoint3dz_p:319] getPoint3dz_p called on array of 3-dimensions / 2 pts
[lwgeom_api.c:getPoint3dz_p:319] getPoint3dz_p called on array of 3-dimensions / 2 pts
[measures3d.c:lw_dist3d_pt_pt:638] lw_dist3d_pt_pt called (with points: p1.x=0.000000, p1.y=0.000000,p1.z=0.000000,p2.x=0.000000, p2.y=0.000000,p2.z=0.000000)
[measures3d.c:lw_dist3d_ptarray_ptarray:701] mindist_ptarray_ptarray; seg 1 * seg 1, dist = 0

[measures3d.c:lw_dist3d_ptarray_ptarray:703]  seg1-seg1 dist: 0.000000, mindist: 0.000000
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x825e7c0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwin_wkt.c:wkt_parser_ptarray_new:293] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_ptarray_add_coord:254] entered
[lwin_wkt.c:wkt_parser_linestring_new:343] entered
[lwline.c:lwline_construct:34] lwline_construct called.
[lwline.c:lwline_construct:41] lwline_construct type=2
[lwin_wkt.c:wkt_parser_geometry_new:847] entered
[lwin_wkt.c:wkt_parser_geometry_new:848] geom 0x82606d0
[lwin_wkt.c:wkt_parser_geometry_new:849] srid 0
[lwgeom.c:lwgeom_set_srid:1537] entered with srid=0
[lwin_wkt_parse.y:lwgeom_parse_wkt:69] wkt_yyparse returned 0
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[g_box.c:lwgeom_calculate_gbox_cartesian:634] lwgeom_calculate_gbox got type (2) - LineString
[g_box.c:ptarray_calculate_gbox_cartesian:508] ptarray_calculate_gbox Z: 0 M: 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264578, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264590, zmflag 1
[lwgeom.c:lwgeom_is_empty:1301] lwgeom_is_empty: got type LineString
[g_box.c:lwgeom_calculate_gbox_cartesian:634] lwgeom_calculate_gbox got type (2) - LineString
[g_box.c:ptarray_calculate_gbox_cartesian:508] ptarray_calculate_gbox Z: 0 M: 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645e0, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645f8, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264578, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264590, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645e0, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645f8, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264578, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264590, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264578, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x8264590, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645e0, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645f8, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645e0, zmflag 1
[lwgeom_api.c:getPoint4d_p:230] getPoint4d_p called.
[lwgeom_api.c:getPoint4d_p:236] ptr 0x82645f8, zmflag 1
*** Error in `/home/user/srcs/postgis_trunk/liblwgeom/cunit/.libs/lt-cu_tester': free(): invalid next size (fast): 0x0825ebb0 ***
make[2]: *** [check] Aborted (core dumped)
make[2]: Leaving directory `/home/user/srcs/postgis_trunk/liblwgeom/cunit'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/home/user/srcs/postgis_trunk/liblwgeom'
make: *** [check] Error 1
user@lubase-1404:~/srcs/postgis_trunk$ 

comment:8 by pramsey, 9 years ago

Cc: strk added

I'll leave @strk to fix this, but I'm pretty sure the problem is at https://trac.osgeo.org/postgis/browser/trunk/liblwgeom/lwlinearreferencing.c#L1102 where sizeof(double*) should be sizeof(double). That would explain why 32bit systems have conniptions, while my 64bit one just gets a bit widgity.

comment:9 by pramsey, 9 years ago

Also at https://trac.osgeo.org/postgis/browser/trunk/liblwgeom/lwlinearreferencing.c#L1107

  nmvals += ptarray_collect_mvals(l2->points, tmin, tmax, &(mvals[nmvals]));

scares the bleepers out of me, I think it should be

  nmvals += ptarray_collect_mvals(l2->points, tmin, tmax, mvals + nmvals);

comment:10 by pramsey, 9 years ago

I've put my suggestions into a commit at r13601

comment:11 by darkblueb, 9 years ago

tested multiple runs of make check in the same 32bit VM, with r13601; crash in lwlinearreferencing.c has not occurred at all; tests are running to completion every time

comment:12 by robe, 9 years ago

Resolution: fixed
Status: newclosed

great.

Note: See TracTickets for help on using tickets.