Bug 2257447
| Summary: | MAME crashes with SIGILL on Apple M2 | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Yussef Dalton <r0930164> |
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 39 | CC: | belegdol, dmalcolm, fweimer, jakub, jlaw, jwakely, mcermak, mpolacek, msebor, nickc, nixuser, sipoyare |
| Target Milestone: | --- | Keywords: | Desktop |
| Target Release: | --- | ||
| Hardware: | aarch64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2024-11-27 22:36:07 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Yussef Dalton
2024-01-09 17:32:33 UTC
Oh, this will be interesting to track down. Are you able to rebuild the package using lld or ld.gold as linker? This is how I did it recently: https://src.fedoraproject.org/rpms/mame/c/fe3d4067666876f1cd5aa8a76ca92705c92e23f9?branch=rawhide (In reply to Julian Sikorski from comment #1) > Oh, this will be interesting to track down. Are you able to rebuild the > package using lld or ld.gold as linker? This is how I did it recently: > https://src.fedoraproject.org/rpms/mame/c/ > fe3d4067666876f1cd5aa8a76ca92705c92e23f9?branch=rawhide I tried rebuilding the package to something similar as your commit, I reverted the latest commit and changed the required version to 39 like this: # https://sourceware.org/bugzilla/show_bug.cgi?id=30930 %if 0%{?fedora} >= 39 %ifarch aarch64 BuildRequires: lld %endif %endif and TOOLS=1 \ LDOPTS="$RPM_LD_FLAGS" \ %if 0%{?fedora} >= 39 %ifarch aarch64 LDOPTS+="-fuse-ld=lld" \ %endif %endif Unfortunately at the end the build failed with the same illegal instruction: DWARF-compressing 16 files sepdebugcrcfix: Updated 16 CRC32s, 0 CRC32s did match. Creating .debug symlinks for symlinks to ELF files Copying sources found by 'debugedit -l' to /usr/src/debug/mame-0.260-1.fc39.aarch64 561634 blocks find-debuginfo: done + '[' '%{buildarch}' = noarch ']' + QA_CHECK_RPATHS=1 + case "${QA_CHECK_RPATHS:-}" in + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/brp-remove-la-files + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j8 + /usr/lib/rpm/redhat/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.2Jyo4a + umask 022 + cd /home/pino/rpmbuild/BUILD + cd mame-mame0260 + ./mame -validate /var/tmp/rpm-tmp.2Jyo4a: line 37: 143413 Illegal instruction (core dumped) ./mame -validate error: Bad exit status from /var/tmp/rpm-tmp.2Jyo4a (%check) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.2Jyo4a (%check) Thanks for checking. Another thing to try would be to try building with clang - it might help that it is gcc which puts the BTI instruction into the binary. I do not think it is a problem with mame, but it is mame exposing an issue elsewhere, similarly as the BTI veneer issue in ld.bfd which was fixed recently. Running mame in gdb reveals the following stacktrace: Starting program: /usr/bin/mame [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGILL, Illegal instruction. 0x0000aaaaadd60620 in __cxa_guard_acquire@plt () (gdb) bt full #0 0x0000aaaaadd60620 in __cxa_guard_acquire@plt () No symbol table info available. #1 0x0000aaaab6f333e8 in image_category() () No symbol table info available. #2 0x0000aaaaaeef38a0 [PAC] in _GLOBAL__sub_I__ZN26legacy_floppy_image_device17flopimg_get_imageEv () No symbol table info available. #3 0x0000fffff5780b2c [PAC] in __libc_start_main_impl () from /lib64/libc.so.6 No symbol table info available. #4 0x0000aaaaaef550f0 [PAC] in _start () My first guess would be a compiler issue. Let's see what gcc maintainers think. You didn't say which gcc, binutils, glibc versions were involved. If the SIGILL is really in the PLT slot (created by the linker), then I believe relocation processing (in linker and dynamic linker) should make sure that indirect calls call the function whose address has been taken directly rather than trhrough PLT slot, that should be for direct calls only, so I think linker doesn't add any magic instructions to PLT slots for BTI/PAC. Would be interesting to know disas $pc-64,$pc+32 in the caller (i.e. image_category), whether it is indeed an indirect call in there, and how it got to calling a PLT slot. At least looking at rawhide gcc build logs and debug info, seems everything in libstdc++.so.6 has been compiled with -mbranch-protection=standard, but my suspection would be something wrong on the MAME side, or in binutils or glibc (dynamic linker), rather than something on the gcc side. This message is a reminder that Fedora Linux 39 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '39'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 39 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. Fedora Linux 39 entered end-of-life (EOL) status on 2024-11-26. Fedora Linux 39 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed. |