bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testsuite failures of gawk 5.2.0


From: Andreas Schwab
Subject: Re: Testsuite failures of gawk 5.2.0
Date: Tue, 06 Sep 2022 10:58:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.91 (gnu/linux)

On Sep 05 2022, Andreas Schwab wrote:

> On s390x-suse-linux, the following tests fail:
>
> make[3]: Entering directory '/home/abuild/rpmbuild/BUILD/gawk-5.2.0/test'
> pma
> make[3]: *** [Makefile:2219: pma] Error 2

With PMA_VERBOSITY=3, we get this output:

pma.c:354: FYI: max gap: 0 bytes at (nil)
pma.c:356: ERROR: max gap 0 too small for required 4194304
pma.c:416: ERROR: addrgap() errno => 'Invalid argument'
gawk: fatal: persistent memory allocator failed to initialize: return value 
416, pma.c line: 357.

This is because there is a hole that is bigger than half the address
space, and U wraps around (and mmap(,0,,) then returns EINVAL).

diff --git a/support/pma.c b/support/pma.c
index c89dd6b7..6ad15e9e 100644
--- a/support/pma.c
+++ b/support/pma.c
@@ -346,6 +346,7 @@ static void * addrgap(off_t n) {  // find big gap in 
address space to map n byte
   for (U = 1; ; U *= 2)  // double upper bound until failure
     if (MAP_FAILED == (A = MMAP(U))) break;
     else                   MUNMAP(A, U);
+  if (U == 0) U = -1;
   while (1 + L < U) {  // binary search between bounds
     size_t M = L + (U - L) / 2;  // avoid overflow
     if (MAP_FAILED == (A = MMAP(M))) {      U = M; }

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]