RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2065349 - acpica-tools' spec file %check run of ASL tests on s390x segfaults
Summary: acpica-tools' spec file %check run of ASL tests on s390x segfaults
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: acpica-tools
Version: 9.0
Hardware: s390x
OS: Linux
unspecified
unspecified
Target Milestone: rc
: 9.2
Assignee: Dean Nelson
QA Contact: Jiri Dluhos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-17 18:14 UTC by Dean Nelson
Modified: 2023-05-09 10:18 UTC (History)
1 user (show)

Fixed In Version: acpica-tools-20210604-4.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 08:15:57 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-115991 0 None None None 2022-03-17 18:32:24 UTC
Red Hat Product Errata RHBA-2023:2477 0 None None None 2023-05-09 08:16:00 UTC

Description Dean Nelson 2022-03-17 18:14:46 UTC
Description of problem:

During the building of acpica-tools, the spec file's %check runs the ASL tests. When run on s390x, a segfault occurs.

The following is from the build.log for the build of acpica-tools-20210604-3.el9 on s390x...

    + cd tests
    + ./aslts.sh
        :
    make[1]: Entering directory '/builddir/build/BUILD/acpica-unix2-20210604/generate/unix/iasl'
        :
    - Link obj/iasl
    - Copy obj/iasl to ../bin/iasl
    make[1]: Leaving directory '/builddir/build/BUILD/acpica-unix2-20210604/generate/unix/iasl'
    make[1]: Entering directory '/builddir/build/BUILD/acpica-unix2-20210604/generate/unix/acpibin'
        :
    - Link obj/acpibin
    - Copy obj/acpibin to ../bin/acpibin
    make[1]: Leaving directory '/builddir/build/BUILD/acpica-unix2-20210604/generate/unix/acpibin'
    make[1]: Entering directory '/builddir/build/BUILD/acpica-unix2-20210604/generate/unix/acpiexec'
        :
    - Link obj/acpiexec
    - Copy obj/acpiexec to ../bin/acpiexec
    make[1]: Leaving directory '/builddir/build/BUILD/acpica-unix2-20210604/generate/unix/acpiexec'
    Installing ACPICA tools
    ~/build/BUILD/acpica-unix2-20210604/tests/templates ~/build/BUILD/acpica-unix2-20210604/tests
    ./aslts.sh: line 129: 1183821 Segmentation fault      (core dumped) $ASL -T all 2> /dev/null

So tests/aslts.sh first calls build_acpi_tools(), which essentially does the following (without encountering an issue)...

    make clean
    make iasl ASLTS=TRUE -j$jobs
    make acpibin ASLTS=TRUE -j$jobs
    make acpiexec ASLTS=TRUE -j$jobs

And then aslts.sh calls run_aslts(), which calls run_compiler_template_test(), where the segfault occurs.

    # Run a simple compiler test.
    # This test does the following:
    # 1 generate all sample tables in the compiler
    # 2 compile all tables (.asl -> .aml)
    # 3 disassembles all tables (.aml -> .dsl)
    # 4 recompiles all all tables (.dsl -> recomp.aml)
    # 5 runs binary comparison between .aml and recomp.aml
    run_compiler_template_test()
    {
            pushd templates
  
            rm -f *.asl *.aml *.dsl
  
            $ASL -T all 2> /dev/null
            for filename in *.asl
            do
                    make -s NAME=$(basename "$filename" .asl)
            done
  
            rm -f *.asl *.aml *.dsl
            popd
    }

(The '{' is line 129.)

Following the segfault line, the build.log has the following additional lines, which reflect the output from the make for-loop...

   Data table apic PASS
   Data table asf! PASS
   Data table bdat PASS
   Data table bert PASS
   Data table bgrt PASS
   Data table boot PASS
   make: *** [Makefile:25: cedt.aml] Error 255
   Data table cpep PASS
   Data table csrt PASS
   Data table dbg2 PASS
   Data table dbgp PASS
   Data table dmar PASS
   Data table drtm PASS
   Data table ecdt PASS
   Data table einj PASS
   Data table erst PASS
   Data table facp PASS
   Data table fpdt PASS
   Data table gtdt PASS
   Data table hest PASS
   Data table hmat PASS
   Data table hpet PASS
   make: *** [Makefile:16: iort_recomp.aml] Error 255
   Data table ivrs PASS
   Data table lpit PASS
   Data table mcfg PASS
   Data table mchi PASS
   Data table mpst PASS
   Data table msct PASS
   make: *** [Makefile:16: msdm_recomp.aml] Error 255
   make: *** [Makefile:16: nfit_recomp.aml] Error 255
   Data table pcct PASS
   Data table pdtt PASS
   make: *** [Makefile:25: phat.aml] Error 255
   make: *** [Makefile:25: pmtt.aml] Error 255
   Data table pptt PASS
   make: *** [Makefile:25: prmt.aml] Error 255

Still trying to determine exactly what in 'iasl -T all' is causing the segfault.


Version-Release number of selected component (if applicable):
acpica-tools-20210604-3.el9


How reproducible:
100% on a s390x build.


Steps to Reproduce:
  1. Do a Brew build of acpica-tools on a s390x system. And look in the build.log.
Or:
  1. dnf install acpica-tools on a s390x system.
  2. run 'iasl -T all'.


Actual results:
Running test aslts.sh (or 'iasl -T all') segfaults.


Expected results:
No segfault.

Comment 1 Al Stone 2022-03-21 23:41:37 UTC
NB: this currently occurs in the upstream 20211217 release, and Fedora, as well: run 'iasl -T all' and the segfault occurs.

Investigating,

Comment 2 Dean Nelson 2022-03-22 17:55:31 UTC
(In reply to Al Stone from comment #1)
> NB: this currently occurs in the upstream 20211217 release, and Fedora, as
> well: run 'iasl -T all' and the segfault occurs.

Thanks for the info. Very helpful.

I was curious and as a learning exercise I tried running iasl directly, and noticed that 3 of the tables result in a segfault. All of which end up with rather large .asl files (unlike the other tables)...

  [root@s390x-kvm testing-dir]# ls -l prmt.asl rgrt.asl svkl.asl
  -rw-r--r--. 1 root root 3829760 Mar 22 13:23 prmt.asl
  -rw-r--r--. 1 root root 1564672 Mar 22 13:24 rgrt.asl
  -rw-r--r--. 1 root root 6201344 Mar 22 13:27 svkl.asl
  [root@s390x-kvm testing-dir]#

The contents of each, look like something is getting into a loop and not letting go until the segfault terminates things.

So rather than 'all' to reproduce this problem, one can run any of the following...

  iasl -T prmt
  iasl -T rgrt
  iasl -T svkl

and get a segfault.

Comment 3 Dean Nelson 2022-08-24 00:24:02 UTC
(In reply to Dean Nelson from comment #2)
> So rather than 'all' to reproduce this problem, one can run any of the
> following...
> 
>   iasl -T prmt
>   iasl -T rgrt
>   iasl -T svkl
> 
> and get a segfault.

So back at the end of March 2022, I created three patches, one for each of these segfaults, and sent them to Al Stone...

        0047-Support-PRMT-in-a-big-endian-world.patch
        0048-Support-RGRT-in-a-big-endian-world.patch
        0049-Support-SVKL-in-a-big-endian-world.patch

He added them to Fedora Rawhide via fc3eef63e813 ("Update to 20220331 upstream sources").

I plan on backporting a portion of fc3eef63e813 (just these three patches, not the update to 20220331) for RHEL-9.2. And I'll be setting the DTM value shortly.(I first want to talk with Jiri Dluhos about this and two other acpica-tools BZs, that I'd like to do for 9.2.)

Comment 7 Dean Nelson 2022-10-04 15:27:04 UTC
(In reply to Dean Nelson from comment #2)
> 
> So rather than 'all' to reproduce this problem, one can run any of the
> following...
> 
>   iasl -T prmt
>   iasl -T rgrt
>   iasl -T svkl
> 
> and get a segfault.

And after eliminating the segfaults, there was the following showing up when
running tests/aslts.sh...

  make: *** [Makefile:25: prmt.aml] Error 255

(With their segfaults eliminated, the other two tables PASS'd the test.)

To reproduce the 'Error 255' simply run...

   iasl -T prmt
   iasl prmt.asl

And the fix for this is also in the posted MR...

  https://gitlab.com/redhat/centos-stream/rpms/acpica-tools/-/merge_requests/4

Comment 9 Jiri Dluhos 2022-10-12 19:25:17 UTC
Verified:Tested (see below), big thanks for excellent bug description and perfect how-to for reproducing! It's a joy working with such bugreports! :)

---------------------

With the original acpica-tools, the crash is easy to reproduce:

# rpm -q acpica-tools
acpica-tools-20210604-3.el9.s390x

# iasl -T prmt
Segmentation fault (core dumped)

---------------------

With the patch, everything works as expected:

# rpm -q acpica-tools
acpica-tools-20210604-4.el9.s390x

# iasl -T prmt
Created ACPI table template for [PRMT], written to "prmt.asl"

# iasl -T rgrt
Created ACPI table template for [RGRT], written to "rgrt.asl"

# iasl -T svkl
Created ACPI table template for [SVKL], written to "svkl.asl"

# iasl prmt.asl

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20210604
Copyright (c) 2000 - 2021 Intel Corporation

Table Input:   prmt.asl -    6711 bytes    110 fields      135 source lines
Binary Output: prmt.aml -     696 bytes

Compilation successful. 0 Errors, 0 Warnings, 0 Remarks

# echo $?
0

Comment 13 Jiri Dluhos 2022-11-15 23:09:28 UTC
Confirming that with acpica-tools-20210604-5, all commands mentioned in comment#2 and #7 work as expected:

# iasl -T prmt
Created ACPI table template for [PRMT], written to "prmt.asl"

# iasl -T rgrt
Created ACPI table template for [RGRT], written to "rgrt.asl"

# iasl -T svkl
Created ACPI table template for [SVKL], written to "svkl.asl"

# iasl prmt.asl

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20210604
Copyright (c) 2000 - 2021 Intel Corporation

Table Input:   prmt.asl -    6711 bytes    110 fields      135 source lines
Binary Output: prmt.aml -     696 bytes

Compilation successful. 0 Errors, 0 Warnings, 0 Remarks

(With the older acpica-tools, a segfault occurred immediately after the first command.)

Comment 18 errata-xmlrpc 2023-05-09 08:15:57 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 (acpica-tools bug fix and enhancement update), 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/RHBA-2023:2477


Note You need to log in before you can comment on or make changes to this bug.