assertion failed! File geos_ts_c.cpp, Line 3472 when searching or sanitizing geometries

74 views
Skip to first unread message

SaultDon

unread,
Aug 5, 2014, 6:55:14 PM8/5/14
to spatiali...@googlegroups.com
I've been noticing a crash in Spatialite GUI 1.8.0 when attempting to search a spatialite db for potential geometry errors (ie, Check Geometries), or repairing them (ie, Sanitize Geometries) the program crashes with the following error,

Assertion failed!

Program: \\FileServer.sfna.local\RedirectedFolders\dcameron\desktop\spatialite_gui.exe
File: geos_ts_c.cpp, Line 3472

Expression: 0 != cs

Same crash happens in Linux. The error above is from Windows 8.1 64 bit.

As a small workaround for now, I can search and repair geometries for individual layers if I right-click their GEOMETRY columns instead, but just not bulk for the entire db.




Donovan

GiuMas

unread,
Apr 20, 2015, 7:34:03 PM4/20/15
to spatiali...@googlegroups.com


On Win7 x64 using the 'official' binaries for spatialite-gui (both x86 amd x64), I got the same assertion failed. I am puzzled by the two different runtime libraries..

a.fu...@lqt.it

unread,
Apr 21, 2015, 3:16:05 AM4/21/15
to spatiali...@googlegroups.com
On Mon, 20 Apr 2015 16:34:03 -0700 (PDT), GiuMas wrote:
> On Win7 x64 using the 'official' binaries for spatialite-gui (both
> x86
> amd x64), I got the same assertion failed. I am puzzled by the two
> different runtime libraries..
>

Hi Giuseppe,

your DB probably contains few "highly toxic" invalid Geometries
causing the reported assertion/crash.

anyway, this is not the expected behavior of SpatiaLite: even
when encountering a badly damaged geometry a sudden crash is
never expected; a softest exception handling (e.g. reporting
an error message) should always be the rule.

if you could send me a copy of the offending DB-file it will
be really useful in order to perform a full debugging session
so to apply some appropriate fix.

bye Sandro

GiuMas

unread,
Apr 21, 2015, 9:57:02 AM4/21/15
to spatiali...@googlegroups.com


Hi Sandro,

Thank you for looking at my issue!

After your answer, I have attempted to use the same SQL as the one in the Spatialite Cookbook for the Mothers-Children problem.. and I got the same error.

Just to check that is not an issue with my PC settings and DLL hell, I have also run it on a virtual machine (the Microsoft-crafted IE11.vmx), and I have got the same error.

To reproduce the error, I open the downloaded Spatialite-gui, then I execute in it:

CREATE TABLE mothers (
  first_name TEXT NOT NULL,
  last_name TEXT NOT NULL,
  CONSTRAINT pk_mothers
    PRIMARY KEY (last_name, first_name));

SELECT AddGeometryColumn('mothers', 'home_location',
  4326, 'POINT', 'XY', 1);

CREATE TABLE children (
  first_name TEXT NOT NULL,
  last_name TEXT NOT NULL,
  mom_first_nm TEXT NOT NULL,
  mom_last_nm TEXT NOT NULL,
  gender TEXT NOT NULL
    CONSTRAINT sex CHECK (
      gender IN ('M', 'F')),
  CONSTRAINT pk_childs
    PRIMARY KEY (last_name, first_name),
  CONSTRAINT fk_childs
    FOREIGN KEY (mom_last_nm, mom_first_nm)
      REFERENCES mothers (last_name, first_name));

INSERT INTO mothers (first_name, last_name, home_location)
  VALUES ('Stephanie', 'Smith',
    ST_GeomFromText('POINT(0.8 52.1)', 4326));

INSERT INTO mothers (first_name, last_name, home_location)
  VALUES ('Antoinette', 'Dupont',
    ST_GeomFromText('POINT(4.7 45.6)', 4326));

INSERT INTO mothers (first_name, last_name, home_location)
  VALUES ('Maria', 'Rossi',
    ST_GeomFromText('POINT(11.2 43.2)', 4326));

INSERT INTO children
    (first_name, last_name, mom_first_nm, mom_last_nm, gender)
  VALUES ('George', 'Brown', 'Stephanie', 'Smith', 'M');

INSERT INTO children
    (first_name, last_name, mom_first_nm, mom_last_nm, gender)
  VALUES ('Janet', 'Brown', 'Stephanie', 'Smith', 'F');

INSERT INTO children
    (first_name, last_name, mom_first_nm, mom_last_nm, gender)
  VALUES ('Chantal', 'Petit', 'Antoinette', 'Dupont', 'F');

INSERT INTO children
    (first_name, last_name, mom_first_nm, mom_last_nm, gender)
  VALUES ('Henry', 'Petit', 'Antoinette', 'Dupont', 'M');

INSERT INTO children
    (first_name, last_name, mom_first_nm, mom_last_nm, gender)
  VALUES ('Luigi', 'Bianchi', 'Maria', 'Rossi', 'M');



After that, I click the icon 'Check geometries' and select a folder. After the selection, it crashes. I do nothing else than this.

Same issue if I create an "in-memory" db.

As asked, I attach the created SQLite db.

Cheers,
Giuseppe
db2.sqlite

a.fu...@lqt.it

unread,
Apr 21, 2015, 10:30:27 AM4/21/15
to spatiali...@googlegroups.com
On Tue, 21 Apr 2015 06:57:02 -0700 (PDT), GiuMas wrote:
> After that, I click the icon 'Check geometries' and select a folder.
> After the selection, it crashes. I do nothing else than this.
>

Hi Giuseppe,

your latest clarification explains all.
There is nothing wrong neither in your DB nor in libspatialite 4.2.0;
anyway the "check geometries" GUI wizzard contained a nasty bug
causing a sudden crash.

switching to the more recent spatialite_gui based on libspatialite
4.2.1-RC1 will definitely resolve your issue.

http://www.gaia-gis.it/gaia-sins/windows-bin-x86-test/spatialite_gui-4.2.1-rc1-win-x86.7z
http://www.gaia-gis.it/gaia-sins/windows-bin-amd64-test/spatialite_gui-4.2.1-rc1-win-amd64.7z

bye Sandro

Jukka Rahkonen

unread,
Apr 21, 2015, 10:33:25 AM4/21/15
to spatiali...@googlegroups.com, GiuMas
GiuMas wrote 2015-04-21 16:57:


>
> After that, I click the icon 'Check geometries' and select a folder.
> After the selection, it crashes. I do nothing else than this.
>
> Same issue if I create an "in-memory" db.
>
> As asked, I attach the created SQLite db.

Hi,

I opened your database with 64-bit version of spatialite-gui 1.8.0-devel
on Windows7. I selected the "home_location" field and ran Check
geometries. No crash happens for me and the html files in c:\temp where
I pointed them are OK.

However, I could fool the program by directing the output to "Program
files" where there is no write access. This affects only the "Check
geometries" button from the toolbar, not the LWGEOM Check Geometries
from the right click menu. That function correctly warns that selected
directory can't be used for writing.

-Jukka Rahkonen-

GiuMas

unread,
Apr 21, 2015, 10:36:48 AM4/21/15
to spatiali...@googlegroups.com

That fixed the error! For you info, the same bug seems to be in spatialite_gui-RL2-rc0-win-amd64.

Thank you,
Giuseppe
Reply all
Reply to author
Forward
0 new messages