Re: Fix memleak in getdelim.m4

2020-05-24 Thread Tim Rühsen
Hi Bruno, On 23.05.20 22:47, Bruno Haible wrote: > Tim Rühsen wrote: >> - clang-10 with unset CFLAGS (*.clang-10) >> >> And the same set with -fsanitize... (*.sanitize). > > The other differences between the configure results without and with > sanitizers > can be explained by the fact that

Re: Fix memleak in getdelim.m4

2020-05-23 Thread Bruno Haible
Tim Rühsen wrote: > - clang-10 with unset CFLAGS (*.clang-10) > > And the same set with -fsanitize... (*.sanitize). The other differences between the configure results without and with sanitizers can be explained by the fact that these -fsanitize options have the effect that the resulting

Re: Fix memleak in getdelim.m4

2020-05-22 Thread Bruno Haible
Hi Tim, > Well, all made on the _same_ system (my desktop) with just ~35 minutes > in between. > > Since system updates are made manually, it is _very_ unlikely that I > made an update between the tests. :-) > But yes, I made one test without $CC set (so likely with gcc) and the > other one

Re: Fix memleak in getdelim.m4

2020-05-22 Thread Tim Rühsen
Hi Bruno, On 21.05.20 21:31, Bruno Haible wrote: > Hi Tim, > > These comparisons are not so useful, because they not only come from different > compilers (gcc vs. clang) but also from systems with different libcs: there > are differences regarding libm, calloc, thrd_create, pthread_sigmask, and

Re: Fix memleak in getdelim.m4

2020-05-21 Thread Bruno Haible
Hi Tim, These comparisons are not so useful, because they not only come from different compilers (gcc vs. clang) but also from systems with different libcs: there are differences regarding libm, calloc, thrd_create, pthread_sigmask, and other functions. It would be more useful to compare, on the

Re: Fix memleak in getdelim.m4

2020-05-21 Thread Bruno Haible
Paul Eggert wrote: > > - if (memmem (haystack, 3, NULL, 0) != haystack) > > + if (memmem (haystack, 3, (const char *) 1, 0) != haystack) > > This has undefined behavior in general, no? No. memmem is not supposed to access more than NEEDLELEN bytes at NEEDLE. > How about using '""'

Re: Fix memleak in getdelim.m4

2020-05-21 Thread Paul Eggert
On 5/21/20 11:40 AM, Bruno Haible wrote: - if (memmem (haystack, 3, NULL, 0) != haystack) + if (memmem (haystack, 3, (const char *) 1, 0) != haystack) This has undefined behavior in general, no? So some future sanitizer may complain about it, for good reason. How about using '""'

Re: Fix memleak in getdelim.m4

2020-05-21 Thread Bruno Haible
Tim Rühsen wrote: > configure:36833: checking whether memmem works > SUMMARY: UndefinedBehaviorSanitizer: invalid-null-argument This patch should fix it. 2020-05-21 Bruno Haible memmem: Avoid wrong configure results with "clang -fsanitize=undefined". Reported by Tim Rühsen

Re: Fix memleak in getdelim.m4

2020-05-21 Thread Bruno Haible
> The attached patch fixes it. (Please feel free to amend.) Thanks, I've pushed it in your name. Bruno

Re: Fix memleak in getdelim.m4

2020-05-21 Thread Bruno Haible
Hi Tim, > With my getdelim patch applied, this is the summary of sanitizer findings: > > $ egrep 'SUMM|checking' config.log|grep -B1 SUMM > configure:14038: checking for working C stack overflow detection > SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change > conftest.c:379:30 in

Re: Fix memleak in getdelim.m4

2020-05-21 Thread Bruno Haible
Hi Tim, > > You may try to pass '--avoid=gettext' to overcome this. > > ./configure --config-cache ends (stops ?) with > The BISON_I18N macro is used without being preceded by AM_GNU_GETTEXT. Oh well. Then you apparently need '--avoid=gettext --avoid=bison-i18n'. > And I see this output here

Re: Fix memleak in getdelim.m4

2020-05-20 Thread Tim Rühsen
Hi Bruno, On 18.05.20 21:44, Bruno Haible wrote: > Hi Tim, > >>> The way to determine the answer is: >>> 1. Create a test dir of all gnulib modules. >>> 2. Configure it with --config-cache. >>> 3. Configure it with --config-cache and your sanitizer options. >>> 4. Compare the generated

Re: Fix memleak in getdelim.m4

2020-05-20 Thread Tim Rühsen
Hi Bruno, On 20.05.20 00:46, Bruno Haible wrote: > Hi Tim, > >>> rm -rf ../testdir-all; ./gnulib-tool --create-testdir >>> --dir=../testdir-all --single-configure >> >> This results in: >> >> executing autopoint --force >> autopoint: *** The AM_GNU_GETTEXT_VERSION declaration in your

Re: Fix memleak in getdelim.m4

2020-05-19 Thread Bruno Haible
Hi Tim, > > rm -rf ../testdir-all; ./gnulib-tool --create-testdir > > --dir=../testdir-all --single-configure > > This results in: > > executing autopoint --force > autopoint: *** The AM_GNU_GETTEXT_VERSION declaration in your configure.ac >file requires the infrastructure

Re: Fix memleak in getdelim.m4

2020-05-19 Thread Tim Rühsen
On 18.05.20 21:44, Bruno Haible wrote: > Hi Tim, > >>> The way to determine the answer is: >>> 1. Create a test dir of all gnulib modules. >>> 2. Configure it with --config-cache. >>> 3. Configure it with --config-cache and your sanitizer options. >>> 4. Compare the generated config.cache and

Re: Fix memleak in getdelim.m4

2020-05-18 Thread Bruno Haible
Hi Tim, > > The way to determine the answer is: > > 1. Create a test dir of all gnulib modules. > > 2. Configure it with --config-cache. > > 3. Configure it with --config-cache and your sanitizer options. > > 4. Compare the generated config.cache and config.status files. > > I am short on time

Re: Fix memleak in getdelim.m4

2020-05-18 Thread Tim Rühsen
Hi Bruno, On 18.05.20 13:50, Bruno Haible wrote: > Hi Tim, > >> With leak sanitizer on, the test for getdelim fails due to a memory leak. > > Is this the only configure test that fails this way? The only one that fails when running GNU Poke ./configure. > I mean, it's 3 years since we last

Re: Fix memleak in getdelim.m4

2020-05-18 Thread Bruno Haible
Hi Tim, > With leak sanitizer on, the test for getdelim fails due to a memory leak. Is this the only configure test that fails this way? I mean, it's 3 years since we last looked for such configure test failures. [1] The way to determine the answer is: 1. Create a test dir of all gnulib