From: Paul Floyd Date: Tue, 14 Nov 2023 07:30:05 +0000 (+0100) Subject: Bug 437790 - valgrind reports "Conditional jump or move depends on uninitialised... X-Git-Tag: VALGRIND_3_23_0~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39589df4d30e981022e6677051783892f2907998;p=thirdparty%2Fvalgrind.git Bug 437790 - valgrind reports "Conditional jump or move depends on uninitialised value" in memchr of macOS 10.12-10.15 --- diff --git a/.gitignore b/.gitignore index 6dca0059a4..369d49404c 100644 --- a/.gitignore +++ b/.gitignore @@ -1115,6 +1115,7 @@ /memcheck/tests/darwin/Makefile.in /memcheck/tests/darwin/aio /memcheck/tests/darwin/aligned_alloc +/memcheck/tests/darwin/bug437790 /memcheck/tests/darwin/deep_badparam /memcheck/tests/darwin/env /memcheck/tests/darwin/ioctl-tiocsbrk diff --git a/NEWS b/NEWS index 5578caf4df..6736f58b2a 100644 --- a/NEWS +++ b/NEWS @@ -25,12 +25,16 @@ are not entered into bugzilla tend to get forgotten about or ignored. 401284 False positive "Source and destination overlap in strncat" +437790 valgrind reports "Conditional jump or move depends on uninitialised + value" in memchr of macOS 10.12-10.15 460616 disInstr(arm64): unhandled instruction 0x4E819402 (dotprod/ASIMDDP) 475498 Add reallocarray wrapper 476320 Build failure with GCC -476535 Difference in allocation size for massif/tests/overloaded-new between clang++/libc++ and g++/libstdc++ +476535 Difference in allocation size for massif/tests/overloaded-new between + clang++/libc++ and g++/libstdc++ 476780 Extend strlcat and strlcpy wrappers to GNU libc -476787 Build of Valgrind 3.21.0 fails when SOLARIS_PT_SUNDWTRACE_THRP is defined +476787 Build of Valgrind 3.21.0 fails when SOLARIS_PT_SUNDWTRACE_THRP is + defined To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/memcheck/tests/darwin/Makefile.am b/memcheck/tests/darwin/Makefile.am index c180964dd6..648f533ee4 100644 --- a/memcheck/tests/darwin/Makefile.am +++ b/memcheck/tests/darwin/Makefile.am @@ -8,6 +8,7 @@ noinst_HEADERS = scalar.h EXTRA_DIST = \ aio.stderr.exp aio.vgtest \ aligned_alloc.stderr.exp aligned_alloc.vgtest \ + bug437790.vgtest bug437790.stderr.exp bug437790.stderr.out \ deep_badparam.stderr.exp deep_badparam.stdout.exp deep_badparam.vgtest \ env.stderr.exp env.vgtest \ ioctl-tiocsbrk.stderr.exp ioctl-tiocsbrk.vgtest \ @@ -22,6 +23,7 @@ EXTRA_DIST = \ check_PROGRAMS = \ aio \ aligned_alloc \ + bug437790 \ deep_badparam \ env \ ioctl-tiocsbrk \ diff --git a/memcheck/tests/darwin/bug437790.c b/memcheck/tests/darwin/bug437790.c new file mode 100644 index 0000000000..ffb6b42fb0 --- /dev/null +++ b/memcheck/tests/darwin/bug437790.c @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + char strval[100]; + int len = sprintf(strval, "%.7G", 10.); + if(memchr(strval, '.', len)) + printf("IF len %d\n", len); + else + printf("ELSE len %d\n", len); +} + diff --git a/memcheck/tests/darwin/bug437790.stderr.exp b/memcheck/tests/darwin/bug437790.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/memcheck/tests/darwin/bug437790.stdout.exp b/memcheck/tests/darwin/bug437790.stdout.exp new file mode 100644 index 0000000000..19e78d7b89 --- /dev/null +++ b/memcheck/tests/darwin/bug437790.stdout.exp @@ -0,0 +1 @@ +ELSE len 2 diff --git a/memcheck/tests/darwin/bug437790.vgtest b/memcheck/tests/darwin/bug437790.vgtest new file mode 100644 index 0000000000..b016e1a11c --- /dev/null +++ b/memcheck/tests/darwin/bug437790.vgtest @@ -0,0 +1,2 @@ +prog: bug437790 +vgopts: -q diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c index 9a2eda6737..16c1bd2f9b 100644 --- a/shared/vg_replace_strmem.c +++ b/shared/vg_replace_strmem.c @@ -999,6 +999,10 @@ static inline void my_exit ( int x ) /* _platform_memchr$VARIANT$Haswell */ MEMCHR(libsystemZuplatformZddylib, _platform_memchr$VARIANT$Haswell) # endif +# if DARWIN_VERS >= DARWIN_10_12 + /* _platform_memchr$VARIANT$Base */ + MEMCHR(libsystemZuplatformZddylib, _platform_memchr$VARIANT$Base) +#endif #elif defined(VGO_solaris) MEMCHR(VG_Z_LIBC_SONAME, memchr)