Opened 5 years ago

Closed 5 years ago

#2774 closed defect (fixed)

Conditional jump or move depends on uninitialised value(s)

Reported by: strk Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.0.7
Component: liblwgeom Version: 2.0.x
Keywords: Cc:

Description

According to valgrind, test_lwgeom_distance_sphere shows uninitialized values errors:

==7337== Conditional jump or move depends on uninitialised value(s)
==7337==    at 0x4E65C04: gbox_merge (g_box.c:231)
==7337==    by 0x4E6BE8E: ptarray_calculate_gbox_geodetic (lwgeodetic.c:2521)
==7337==    by 0x4E6C009: lwgeom_calculate_gbox_geodetic (lwgeodetic.c:2553)
==7337==    by 0x4E6DCDE: lwgeom_distance_spheroid (lwgeodetic.c:2115)
==7337==    by 0x40DB32: test_lwgeom_distance_sphere (cu_geodetic.c:1234)
==7337==    by 0x509BBAA: ??? (in /usr/lib/libcunit.so.1.0.1)
==7337==    by 0x509BE85: ??? (in /usr/lib/libcunit.so.1.0.1)
==7337==    by 0x509C19F: CU_run_all_tests (in /usr/lib/libcunit.so.1.0.1)
==7337==    by 0x4050EF: main (cu_tester.c:136)
==7337== 

Attachments (1)

uninit.patch (343 bytes) - added by pramsey 5 years ago.
init edge box first?

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by strk

Component: postgisliblwgeom
Milestone: PostGIS 2.1.4
Priority: highcritical
Version: trunk2.1.x

2.1 branch (pre 2.1.4) is also affected

comment:2 Changed 5 years ago by strk

To reproduce:

cd liblwgeom/cunit && libtool --mode=execute valgrind --workaround-gcc296-bugs=yes ./cu_tester test_lwgeom_distance_sphere

comment:3 Changed 5 years ago by strk

Milestone: PostGIS 2.1.4PostGIS 2.0.7
Priority: criticalblocker
Version: 2.1.x2.0.x

2.0 branch (pre 2.0.7) is also affected

Changed 5 years ago by pramsey

Attachment: uninit.patch added

init edge box first?

comment:4 Changed 5 years ago by pramsey

Does this patch help? I don't have valgrind on OSX at the moment.

comment:5 Changed 5 years ago by strk

It does,test_lwgeom_distance_sphere runs with no memory errors applying that patch (still has some leaks, but that's a different issue)

comment:6 Changed 5 years ago by strk

Resolution: fixed
Status: newclosed

I've committed the patch in 2.0 branch as r12673, 2.1 branch as r12674, trunk as r12676

Note: See TracTickets for help on using tickets.