-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please MSAN #395
Please MSAN #395
Conversation
Algunenano
commented
Apr 17, 2019
will we msan on travis? |
It's not there yet. Before this patch I see 120 warnings in liblwgeom unit tests and after this 67 warnings, but the remaining ones are related to either json or geos, so to investigate those I'd need to build those dependencies with MSAN (and without optimizations if possible) and check whether they are bugs and how/where to patch them. |
SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:960:6 in compare_by_envarea ==9239==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x55e44ad0691b in compare_by_envarea /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:959:6 postgis#1 0x7eff5a46d7c4 in msort_with_tmp.part.0 (/usr/lib/libc.so.6+0x397c4) postgis#2 0x7eff5a46d895 in __GI___qsort_r (/usr/lib/libc.so.6+0x39895) postgis#3 0x55e44aced5ef in findFaceHoles /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:971:2 postgis#4 0x55e44acec356 in LWGEOM_GEOS_buildArea /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:1125:2 postgis#5 0x55e44acefc7c in lwgeom_buildarea /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:1170:7 postgis#6 0x55e44a67d11b in buildarea7 /home/raul/dev/public/postgis/liblwgeom/cunit/cu_buildarea.c:314:9 postgis#7 0x7eff5b3fd117 (/usr/lib/libcunit.so.1+0x4117) postgis#8 0x7eff5b3fd3b1 (/usr/lib/libcunit.so.1+0x43b1) postgis#9 0x7eff5b3fd7b6 in CU_run_all_tests (/usr/lib/libcunit.so.1+0x47b6) postgis#10 0x55e44a82fdbe in main /home/raul/dev/public/postgis/liblwgeom/cunit/cu_tester.c:177:13 postgis#11 0x7eff5a458222 in __libc_start_main (/usr/lib/libc.so.6+0x24222) postgis#12 0x55e44a5c407d in _start (/home/raul/dev/public/postgis/liblwgeom/cunit/cu_tester+0x2607d) Uninitialized value was stored to memory at #0 0x55e44ad06863 in compare_by_envarea /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:957:9 postgis#1 0x7eff5a46d7c4 in msort_with_tmp.part.0 (/usr/lib/libc.so.6+0x397c4) Uninitialized value was created by a heap allocation #0 0x55e44a5f3c5d in __interceptor_malloc (/home/raul/dev/public/postgis/liblwgeom/cunit/cu_tester+0x55c5d) postgis#1 0x55e44aab99b1 in default_allocator /home/raul/dev/public/postgis/liblwgeom/lwutil.c:91:14 postgis#2 0x55e44aabd1f3 in lwalloc /home/raul/dev/public/postgis/liblwgeom/lwutil.c:229:14 postgis#3 0x55e44acecbf9 in newFace /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:923:12 postgis#4 0x55e44acec11e in LWGEOM_GEOS_buildArea /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:1122:14 postgis#5 0x55e44acefc7c in lwgeom_buildarea /home/raul/dev/public/postgis/liblwgeom/lwgeom_geos.c:1170:7 postgis#6 0x55e44a67d11b in buildarea7 /home/raul/dev/public/postgis/liblwgeom/cunit/cu_buildarea.c:314:9 postgis#7 0x7eff5b3fd117 (/usr/lib/libcunit.so.1+0x4117)
f69a519
to
5da2a5f
Compare
lwout_twkb.c:170:9: runtime error: implicit conversion from type 'long long' of value 10000000000 (64-bit, signed) to type 'int' changed the value to 1410065408 (32-bit, signed)
e6eb62d
to
2f2bfa3
Compare
lwout_wkb.c:288:16: runtime error: implicit conversion from type 'char' of value -16 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 240 (8-bit, unsigned) lwout_wkb.c:654:27: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483663 (32-bit, unsigned) to type 'int' changed the value to -2147483633 (32-bit, signed) lwout_wkb.c:213:16: runtime error: implicit conversion from type 'char' of value -128 (8-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 128 (8-bit, unsigned) lwout_wkb.c:607:27: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147483651 (32-bit, unsigned) to type 'int' changed the value to -2147483645 (32-bit, signed)
shp2pgsql-core.c:839:22: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'DBFFieldType' changed the value to 4294967295 (32-bit, unsigned)
2f2bfa3
to
ccea341
Compare
runtime error: implicit conversion from type 'int32' (aka 'int') of value -1 (32-bit, signed) to type 'uint32' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned) UndefinedBehaviorSanitizer: undefined-behavior lwgeom_functions_basic.c:2237:10 in
43f75c4
to
e6cceb9
Compare
runtime error: implicit conversion from type 'unsigned int' of value 4294967295 (32-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed) UndefinedBehaviorSanitizer: undefined-behavior ptarray.c:333:13 in
runtime error: implicit conversion from type 'int32' (aka 'int') of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned) UndefinedBehaviorSanitizer: undefined-behavior lwgeom_functions_basic.c:2310:11 in
acb4dd2
to
42753ed
Compare
Auto by clang-format
611a6b6
to
b0fa109
Compare
I'm breaking this into several commits / PRs |