Bug 1647490

Summary: glibc: stdlib/test-bz22786 test suite failure on s390x [rhel-7.7]
Product: Red Hat Enterprise Linux 7 Reporter: Florian Weimer <fweimer>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: Sergey Kolosov <skolosov>
Severity: low Docs Contact:
Priority: low    
Version: 7.7CC: ashankar, codonell, dj, fweimer, glibc-bugzilla, mcermak, mnewsome, pfrankli, qe-baseos-tools-bugs, skolosov
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.17-265.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: 1638523 Environment:
Last Closed: 2019-08-06 12:49:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1638523    
Bug Blocks: 1643040    

Description Florian Weimer 2018-11-07 15:24:35 UTC
+++ This bug was initially created as a clone of Bug #1638523 +++

Description of problem:
stdlib/test-bz22786 test fails with timeout error on s390x 

Actual results:
[root@ibm-z-114 build-s390x-redhat-linux]# ./testrun.sh stdlib/test-bz22786
Timed out: killed the child process
[root@ibm-z-114 build-s390x-redhat-linux]# cd stdlib/
[root@ibm-z-114 stdlib]# time ./test-bz22786
Timed out: killed the child process

real	0m20.345s
user	0m0.388s
sys	0m2.513s
[root@ibm-z-114 stdlib]# 

Expected results:


Additional info:
The test fails only on s390x architecture

--- Additional comment from Sergey Kolosov on 2018-10-11 22:02:15 CEST ---

The result with TIMEOUTFACTOR=999

[root@ibm-z-114 stdlib]# time TIMEOUTFACTOR=999 ./test-bz22786

real	1m26.320s
user	0m1.716s
sys	0m5.237s
[root@ibm-z-114 stdlib]#

machine: https://beaker.engineering.redhat.com/view/ibm-z-114.rhts.eng.bos.redhat.com#details

--- Additional comment from Carlos O'Donell on 2018-10-11 22:05:11 CEST ---

(In reply to Sergey Kolosov from comment #1)
> The result with TIMEOUTFACTOR=999
> 
> [root@ibm-z-114 stdlib]# time TIMEOUTFACTOR=999 ./test-bz22786
> 
> real	1m26.320s
> user	0m1.716s
> sys	0m5.237s
> [root@ibm-z-114 stdlib]#
> 
> machine:
> https://beaker.engineering.redhat.com/view/ibm-z-114.rhts.eng.bos.redhat.
> com#details

That is a really slow box. This test is known for being slow because it allocates a lot of memory for a very long path. And that might be really slow.

So it looks like we need to raise the timeout here to ~150s.

--- Additional comment from Florian Weimer on 2018-10-26 20:13:28 CEST ---

I posted a patch which reduces the memory requirement:

https://sourceware.org/ml/libc-alpha/2018-10/msg00586.html

The quoted performance numbers are from an s390x Beaker box.

We should review this patch upstream and backport it.

--- Additional comment from Florian Weimer on 2018-11-07 16:23:07 CET ---

In addition to the support/ backports, the following commits are recommended for backport (in reverse chronological order):

commit 60708030536df82616c16aa2f14f533c4362b969
Author: Florian Weimer <fweimer>
Date:   Tue Oct 30 13:56:40 2018 +0100

    stdlib/test-bz22786: Avoid memory leaks in the test itself

commit 07da99aad93c9364acb7efdab47c27ba698f6313
Author: Florian Weimer <fweimer>
Date:   Tue Oct 30 13:55:01 2018 +0100

    stdlib/tst-strtod-overflow: Switch to support_blob_repeat
    
    This is another test with an avoidable large memory allocation.

commit f5e7e95921847bd83186bfe621fc2b48c4de5477
Author: Florian Weimer <fweimer>
Date:   Tue Oct 30 13:11:47 2018 +0100

    stdlib/test-bz22786: Avoid spurious test failures using alias mappings
    
    On systems without enough random-access memory, stdlib/test-bz22786
    will go deeply into swap and time out, even with a substantial
    TIMEOUTFACTOR.  This commit adds a facility to construct repeating
    strings with alias mappings, so that the requirement for physical
    memory, and uses it in stdlib/test-bz22786.

Comment 1 Florian Weimer 2018-11-09 12:57:59 UTC
Further required backports:

commit 3bad2358d67d371497079bba4f8eca9c0096f4e2
Author: Stefan Liebler <stli.com>
Date:   Thu Aug 30 08:44:32 2018 +0200

    Test stdlib/test-bz22786 exits now with unsupported if malloc fails.
    
    The test tries to allocate more than 2^31 bytes which will always fail on s390
    as it has maximum 2^31bit of memory.
    Before commit 6c3a8a9d868a8deddf0d6dcc785b6d120de90523, this test returned
    unsupported if malloc fails.  This patch re enables this behaviour.
    
    Furthermore support_delete_temp_files() failed to remove the temp directory
    in this case as it is not empty due to the created symlink.
    Thus the creation of the symlink is moved behind malloc.
    
    Reviewed-by: Carlos O'Donell <carlos>
    
    ChangeLog:
    
            * stdlib/test-bz22786.c (do_test): Return EXIT_UNSUPPORTED
            if malloc fails.

commit 6c3a8a9d868a8deddf0d6dcc785b6d120de90523
Author: Paul Pluzhnikov <ppluzhnikov.corp.google.com>
Date:   Fri Aug 24 18:08:51 2018 -0700

    Fix BZ#23400 (creating temporary files in source tree), and undefined behavior in test.

Comment 2 Florian Weimer 2018-11-22 15:31:28 UTC
*** Bug 1607947 has been marked as a duplicate of this bug. ***

Comment 5 Sergey Kolosov 2019-03-21 13:11:46 UTC
Verified,

the test passes in glibc-2.17-265.el7.s390x, the test fails by timeout in glibc-2.17-262.el7.s390x. On 31bit architecture s390, it has the same behavior in both versions glibc-2.17-262.el7.s390 and glibc-2.17-265.el7.s390, the test fails with EXIT_UNSUPPORTED in both versions. Tested on a host with 2048 MB system memory.

Comment 7 errata-xmlrpc 2019-08-06 12:49:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2118