Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault reported during build of the zstd library #2135

Open
szaydel opened this issue Mar 22, 2024 · 15 comments
Open

Segfault reported during build of the zstd library #2135

szaydel opened this issue Mar 22, 2024 · 15 comments
Assignees

Comments

@szaydel
Copy link

szaydel commented Mar 22, 2024

My build system is a Macbook Pro M1, running Mac OS Sonoma 14.2.1. I continue to see the following failure, no matter the number of jobs I set. I confirmed that even setting -j1 does not improve the situation. With some hacking around I was able to run the command that gets executed manually and I see that a zstd.a is generated and command returns without any segfaults.

[INFO ]  =================================================================
[INFO ]  Installing zstd for host
[EXTRA]    Building zstd
/opt/homebrew/Cellar/crosstool-ng/1.26.0/share/crosstool-ng/scripts/functions: line 392: 87382 Segmentation fault: 11  "${@}" 2>&1
     87383 Done                    | CT_DoLog "${level}"
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing zstd for host'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@377]
[ERROR]  >>        called from: do_zstd_backend[scripts/build/companion_libs/070-zstd.sh@84]
[ERROR]  >>        called from: do_zstd_for_host[scripts/build/companion_libs/070-zstd.sh@59]
[ERROR]  >>        called from: do_companion_libs_for_host[scripts/build/companion_libs.sh@36]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@697]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      https://crosstool-ng.github.io/docs/known-issues/
[ERROR]  >>
[ERROR]  >> NOTE: You configuration uses non-default patch sets. Please
[ERROR]  >> select 'bundled' as the set of patches applied and attempt
[ERROR]  >> to reproduce this issue. Issues reported with other patch
[ERROR]  >> set selections (none, local, bundled+local,
[ERROR]  >> bundled+bundled_exp bundled+bundled_exp+local) are going to
[ERROR]  >> be closed without explanation.
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]
[ERROR]  (elapsed: 3:40.01)
gmake: *** [/opt/homebrew/bin/ct-ng:261: build] Error 139

Version: 1.26.0
OS: MacOS Sonoma 14.2.1 (23C71)
config.txt
build.log

@bhundven
Copy link
Contributor

bhundven commented Mar 22, 2024

I'm on 14.4, but I'm testing now with the latest in git.

@bhundven bhundven self-assigned this Mar 22, 2024
@QBos07
Copy link
Contributor

QBos07 commented Mar 22, 2024

line 392 is just a ) wtf?

@bhundven
Copy link
Contributor

bhundven commented Mar 22, 2024

That comes from line 329. It's being ran in a "sub-shell"

@bhundven
Copy link
Contributor

Huh, I actually run into another build issue with gcc :|

@bhundven
Copy link
Contributor

[INFO ]  =================================================================
[INFO ]  Installing core C gcc compiler
[EXTRA]    Configuring core C gcc compiler
[EXTRA]    Building gcc
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:550:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:551:37: error: expected ';' at end of declaration list
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:557:48: error: too many arguments provided to function-like macro invocation
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:569:48: error: too many arguments provided to function-like macro invocation
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:660:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:661:37: error: expected ';' at end of declaration list
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:667:48: error: too many arguments provided to function-like macro invocation
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:679:48: error: too many arguments provided to function-like macro invocation
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:795:21: error: too many arguments provided to function-like macro invocation
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:795:1: error: declaration conflicts with target of using declaration already in scope
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:797:5: error: expected expression
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:798:2: error: expected ';' at end of declaration
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:803:21: error: too many arguments provided to function-like macro invocation
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:803:1: error: declaration conflicts with target of using declaration already in scope
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:805:5: error: expected expression
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:806:2: error: expected ';' at end of declaration
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:811:21: error: too many arguments provided to function-like macro invocation
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:811:1: error: declaration conflicts with target of using declaration already in scope
[ERROR]    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:813:5: error: expected expression
[ERROR]    fatal error: too many errors emitted, stopping now [-ferror-limit=]
[ERROR]    make[2]: *** [Makefile:1158: gcov.o] Error 1
[ERROR]    make[2]: *** Waiting for unfinished jobs....
[ERROR]    make[1]: *** [Makefile:4606: all-gcc] Error 2

@szaydel
Copy link
Author

szaydel commented Mar 23, 2024

@bhundven, I have not seen this issue yet. Is this part of the build done with clang or is there some strap compiler that crosstool-ng provides?

@szaydel
Copy link
Author

szaydel commented Mar 23, 2024

That comes from line 329. It's being ran in a "sub-shell"

I ran effectively the same command that ends-up being run in the sub-shell and could not trigger the segfault. I would repeatedly clean the directory, build again and no issues.

@QBos07
Copy link
Contributor

QBos07 commented Mar 23, 2024

maybe a bash segfault? I read that that can happen

@QBos07
Copy link
Contributor

QBos07 commented Mar 23, 2024

I am trying to build your config on a aarch64-linux-gnu machine. Will report later

@QBos07
Copy link
Contributor

QBos07 commented Mar 23, 2024

worked for me

@szaydel
Copy link
Author

szaydel commented Mar 23, 2024 via email

@szaydel
Copy link
Author

szaydel commented Mar 24, 2024

I am starting to doubt that it is bash, because I just updated bash via homebrew and the problem remains, but the version of bash I am running with is:
GNU bash, version 5.2.26(1)-release (aarch64-apple-darwin23.2.0)

If I have more information about this I will be sure to update the case.

@caldog20
Copy link

@szaydel Did you ever get this working? I am running into a similar issue.

@szaydel
Copy link
Author

szaydel commented Apr 24, 2024 via email

@szaydel
Copy link
Author

szaydel commented May 12, 2024

I have finally been able to make some time for this and instead of doing the same exact thing and expecting different results I chose to build a different toolchain. This is the configuration which I built:

build  = aarch64-apple-darwin23.2.0
host   = aarch64-apple-darwin23.2.0
target = arm-cortex_a8-linux-gnueabihf

And, surprisingly I was able to successfully complete the build. This leaves me wondering what it is about the particular choices that I made previously that caused the build to fail whereas today with a different configuration I was able to build.

I am going to try building a few different toolchains to see if this issue returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants