Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#811 closed defect (fixed)

Fixed an unhandled exception: 0xC0000090: Floating-point invalid operation.

Reported by: sunxunfeng Owned by: strk
Priority: major Milestone: 3.6.1
Component: Core Version: main
Severity: Critical Keywords: unhandled exception Floating-point invalid
Cc:

Description

To fix an unhandled exception: 0xC0000090: Floating-point invalid operation, have to modify src/algorithm/LineIntersector.cpp line 874 from:

#if COMPUTE_Z
	double minZ0 = n00.z < n01.z ? n00.z : n01.z;
	double minZ1 = n10.z < n11.z ? n10.z : n11.z;
	double maxZ0 = n00.z > n01.z ? n00.z : n01.z;
	double maxZ1 = n10.z > n11.z ? n10.z : n11.z;
	double intMinZ = minZ0 > minZ1 ? minZ0 : minZ1;
	double intMaxZ = maxZ0 < maxZ1 ? maxZ0 : maxZ1;
	double intMidZ = (intMinZ + intMaxZ) / 2.0;
	normPt.z = intMidZ;
	n00.z -= normPt.z;
	n01.z -= normPt.z;
	n10.z -= normPt.z;
	n11.z -= normPt.z;
#endif

To:

#if COMPUTE_Z
	if( !ISNAN(n00.z) )
	{
		double minZ0 = n00.z < n01.z ? n00.z : n01.z;
		double minZ1 = n10.z < n11.z ? n10.z : n11.z;
		double maxZ0 = n00.z > n01.z ? n00.z : n01.z;
		double maxZ1 = n10.z > n11.z ? n10.z : n11.z;
		double intMinZ = minZ0 > minZ1 ? minZ0 : minZ1;
		double intMaxZ = maxZ0 < maxZ1 ? maxZ0 : maxZ1;
		double intMidZ = (intMinZ + intMaxZ) / 2.0;
		normPt.z = intMidZ;
		n00.z -= normPt.z;
		n01.z -= normPt.z;
		n10.z -= normPt.z;
		n11.z -= normPt.z;	
	}
#endif

Attachments (3)

0xC0000090.jpg (168.9 KB ) - added by sunxunfeng 7 years ago.
LineIntersector.cpp.patch (1.2 KB ) - added by sunxunfeng 7 years ago.
OverlayOp.cpp.patch (461 bytes ) - added by sunxunfeng 7 years ago.

Download all attachments as: .zip

Change History (8)

by sunxunfeng, 7 years ago

Attachment: 0xC0000090.jpg added

by sunxunfeng, 7 years ago

Attachment: LineIntersector.cpp.patch added

by sunxunfeng, 7 years ago

Attachment: OverlayOp.cpp.patch added

comment:1 by strk, 7 years ago

Resolution: fixed
Status: newclosed

In 4334:

Protect from computations against NaN numbers

Fixes an unhandled exception:
0xC0000090: Floating-point invalid operation.

Closes #811 - thanks sunxunfeng

comment:2 by strk, 7 years ago

In 4335:

Protect from computations against NaN numbers

Fixes an unhandled exception:
0xC0000090: Floating-point invalid operation.

Closes #811 for 3.6 branch - thanks sunxunfeng

comment:3 by Sandro Santilli <strk@…>, 7 years ago

In 341d8c9/git:

Protect from computations against NaN numbers

Fixes an unhandled exception:
0xC0000090: Floating-point invalid operation.

Closes #811 - thanks sunxunfeng

git-svn-id: http://svn.osgeo.org/geos/trunk@4334 5242fede-7e19-0410-aef8-94bd7d2200fb

comment:4 by Sandro Santilli <strk@…>, 7 years ago

In 341d8c9/git:

Protect from computations against NaN numbers

Fixes an unhandled exception:
0xC0000090: Floating-point invalid operation.

Closes #811 - thanks sunxunfeng

git-svn-id: http://svn.osgeo.org/geos/trunk@4334 5242fede-7e19-0410-aef8-94bd7d2200fb

comment:5 by Sandro Santilli <strk@…>, 7 years ago

In 341d8c9/git:

Protect from computations against NaN numbers

Fixes an unhandled exception:
0xC0000090: Floating-point invalid operation.

Closes #811 - thanks sunxunfeng

git-svn-id: http://svn.osgeo.org/geos/trunk@4334 5242fede-7e19-0410-aef8-94bd7d2200fb

Note: See TracTickets for help on using tickets.