On Tue, 12 Jul 2022, Karl Williamson wrote: >>> If you have valgrind, or clang asan or similar, could you try running >>> that? > I suspect and hope that the attached patch will fix it. No, it does not. It is still broken the same way. However, 0003-locale.c-Add-missing-savepv.patch makes a difference, the number of memory leaks seems to be reduced according to valgrind. You may want to have a look at (the bottom of) https://uwe-dueffert.de/code/perl5.37.1/142_perl5.37.1.sh.log.xz vs. https://uwe-dueffert.de/code/perl5.37.1/142_perl5.37.1+p3.sh.log.xz But the problem is not memory leaks, it is invalid memory access. Which my initial report already suggested (*random* unknown character in a static test case that is not there with perl-5.37.0 and not with debug code and not with valgrind protection). Valgrind supports that theory by "Invalid read of size *" - only with 5.37.1. For that, you may want to have a look at (the top of) https://uwe-dueffert.de/code/perl5.37.1/142_perl5.37.0.sh.log.xz vs. https://uwe-dueffert.de/code/perl5.37.1/142_perl5.37.1+p3.sh.log.xz As this still gives you no clue where stuff breaks, I further reduced the testcase from within texinfo to: https://uwe-dueffert.de/code/perl5.37.1/texinfo-6.8_reduced_problem.tar.xz I stripped anything unneeded from the end of the texi2any perl file and added relevant output, moved as far up as I could to reveal the problem. Everything is still good at $saved_LC_ALL1 = POSIX::setlocale(LC_ALL); , but only a few lines later $saved_LC_ALL2 = POSIX::setlocale(LC_ALL); is broken with unknown characters. The full valgrind output of that reduced case is longer because the stripped end of texi2any produces more memory leaks, but the problem is the memory corruption between getting and printing $saved_LC_ALL1 and $saved_LC_ALL2 as shown in https://uwe-dueffert.de/code/perl5.37.1/142_reduced.sh.log In that logfile $saved_LC_ALL2 looks good only due to valgrind, without valgrind the memory corruption reported inbetween visibly damages $saved_LC_ALL2 (which in texinfos original use-case panics significantly later when trying to setlocale() back to $saved_LC_ALL).Thread Previous | Thread Next