Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924354 - dev-build/ninja-1.11.1-r5 fails to compile on arm64 with: subprocess.CalledProcessError: Command '['./ninja', '-v']' died with <Signals.SIGSEGV: 11>.
Summary: dev-build/ninja-1.11.1-r5 fails to compile on arm64 with: subprocess.CalledPr...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-12 09:27 UTC by tt_1
Modified: 2024-02-21 12:24 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (ninja-aarch64-build.log,16.85 KB, text/x-log)
2024-02-12 09:27 UTC, tt_1
Details
output from emerge --info (emerge-info.log,5.47 KB, text/x-log)
2024-02-12 09:27 UTC, tt_1
Details
compressed build log of -r4 (ninja-1.11.1-r4.log,26.74 KB, text/x-log)
2024-02-13 17:25 UTC, tt_1
Details
debugme.patch (file_924354.txt,364 bytes, patch)
2024-02-13 18:47 UTC, Sam James
Details | Diff
output from gdb (debug,2.44 KB, text/plain)
2024-02-20 21:53 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2024-02-12 09:27:27 UTC
Created attachment 884790 [details]
build log

so this happened the other day: 

bootstrap complete.  rebuilding...
Traceback (most recent call last):
  File "/var/tmp/portage/dev-build/ninja-1.11.1-r5/work/ninja-1.11.1/configure.py", line 720, in <module>
    subprocess.check_call(rebuild_args)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['./ninja', '-v']' died with <Signals.SIGSEGV: 11>.

dev-build/ninja-1.11.1-r3 and -r4 are just fine, the only difference between r4 and r5 is the cpp flags patch. 

the full build log is attached

in armv7a chroot on the same machine, the build was just fine
Comment 1 tt_1 2024-02-12 09:27:42 UTC
Created attachment 884791 [details]
output from emerge --info
Comment 2 tt_1 2024-02-12 09:29:02 UTC
emerge -pv dev-build/ninja for completness:

These are the packages that would be merged, in order:

[ebuild     U  ] dev-build/ninja-1.11.1-r5::gentoo [1.11.1-r4::gentoo] USE="-doc -test" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-12 09:36:14 UTC
Not yet clear why it's going wrong, as the flags added by append-lfs-flags should do nothing on arm64.

Could you try to get a backtrace from the crashing ninja process (run it with gdb --args ...), and also get the build.log for -r4?
Comment 4 tt_1 2024-02-13 17:25:27 UTC
Created attachment 884873 [details]
compressed build log of -r4
Comment 5 tt_1 2024-02-13 17:33:21 UTC
I'm emerging gdb on the machine, can you be so kind and help me with the full command I need to execute when debugging it? Don't have any experience of throwing a python build system into it, thanks.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-13 17:34:05 UTC
yes ofc, let me make it crash artificially here so I can give full steps, please hold...
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-13 18:47:03 UTC
Created attachment 884879 [details, diff]
debugme.patch

OK, apply this to dev-build/ninja. Build it with -ggdb3 (see https://wiki.gentoo.org/wiki/Debugging#Per-package).

Then when it crashes, go into the workdir, run the command after 'debug me with:', then when gdb opens:

r (hit enter)
bt (hit enter)

show the output?
Comment 8 tt_1 2024-02-18 19:10:07 UTC
I come back to this within the next week (propably), and I can't find the bug anymore via the opened bugs by me function of bugzilla.
Comment 9 Mike Gilbert gentoo-dev 2024-02-18 19:50:19 UTC
Use a bookmark or something.
Comment 10 tt_1 2024-02-20 21:02:23 UTC
so, the command which fails and gives a segfault is a simple ./ninja -v , where the ninja binary is the one which was bootstrapped by the ebuild
Comment 11 Mike Gilbert gentoo-dev 2024-02-20 21:15:12 UTC
We need a backtrace per comment 7.
Comment 12 tt_1 2024-02-20 21:53:56 UTC
Created attachment 885551 [details]
output from gdb
Comment 13 Mike Gilbert gentoo-dev 2024-02-20 22:04:13 UTC
Hmm, so it is failing some where in the standard vector class when something is getting pushed via std::vector::push_back.

Your GCC seems to be a bit out of date, so I wonder if this is a toolchain bug.
Comment 14 Mike Gilbert gentoo-dev 2024-02-20 22:04:47 UTC
Adding toolchain.
Comment 15 Arsen Arsenović gentoo-dev 2024-02-20 23:00:23 UTC
try building it with -D_GLIBCXX_ASSERTIONS - it is quite not impossible that the program violates some precondition of the standard.

I don't have GCC 11 sources on hand to investigate further, but that flag alone should belp a lot
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-21 00:31:52 UTC
(In reply to Arsen Arsenović from comment #15)
> try building it with -D_GLIBCXX_ASSERTIONS - it is quite not impossible that
> the program violates some precondition of the standard.
> 
> I don't have GCC 11 sources on hand to investigate further, but that flag
> alone should belp a lot

There's https://github.com/ninja-build/ninja/issues/2309 ...
Comment 17 tt_1 2024-02-21 07:22:00 UTC
(In reply to Arsen Arsenović from comment #15)
> try building it with -D_GLIBCXX_ASSERTIONS - it is quite not impossible that
> the program violates some precondition of the standard.

hi, you were right and this got me a working =dev-build/ninja-1.11.1-r5: 


cat /etc/portage/env/dev-build/ninja

CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_ASSERTIONS"
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-21 07:35:38 UTC
It wasn't supposed to! It was supposed to give a better error message so it crashed earlier.
Comment 19 Arsen Arsenović gentoo-dev 2024-02-21 12:12:42 UTC
(In reply to Sam James from comment #16)
> There's https://github.com/ninja-build/ninja/issues/2309 ...

interesting, tt_1, what path are you operating under?  I have GCC11 now so I'll try reproducing
Comment 20 tt_1 2024-02-21 12:24:27 UTC
(In reply to Arsen Arsenović from comment #19)
> (In reply to Sam James from comment #16)
> > There's https://github.com/ninja-build/ninja/issues/2309 ...
> 
> interesting, tt_1, what path are you operating under?  I have GCC11 now so
> I'll try reproducing

there is nothing really special about the path, the bootstrapped binary can be found within portage tempdir in /var/tmp/portage/dev-build/ninja-1.11.1-r5/work/ninja-1.11.-r5/

or do you want to see what my env is?