
Code: Select all
/usr/portage/scripts/bootstrap.sh

Code: Select all
$ eselect binutils list
[1] aarch64-unknown-linux-gnu-2.27 *
[2] armv6j-hardfloat-linux-gnueabi-2.26.1
[3] armv6j-hardfloat-linux-gnueabi-2.27 *
[4] armv7a-hardfloat-linux-gnueabi-2.27 *
[5] i686-pc-linux-gnu-2.27 *
[6] x86_64-pc-linux-gnu-2.27 *I can add some supporting evidence to this hypothesis.bgamari wrote:For what it's worth, I highly doubt that this has anything to do with compiler optimizations. I have also seen crashes of the Glasgow Haskell Compiler, the native code generator of which implements essentially no microarchitecture-specific optimizations. Moreover, I have seen segmentation faults of otherwise stable long-running processes after starting a compilation workload (e.g. mprime runs for hours on end alone, but crashes within an hour after a build is started).
A hypothesis I have been meaning to test is that the fluctuating nature of compilation workloads might be in part responsible for the instability.
Code: Select all
COLLECT_GCC_OPTIONS='-e' '-v' '-march=native'
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.4/cc1 -quiet /usr/include/stdlib.h "-march=bdver3" -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 -mxop -mbmi -mno-bmi2 -mtbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mf16c -mfsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param "l1-cache-size=16" --param "l1-cache-line-size=64" --param "l2-cache-size=2048" "-mtune=bdver3" -quiet -dumpbase stdlib.h -auxbase stdlib -o /tmp/ccGEroKo.s "--output-pch=/usr/include/stdlib.h.gch"
COLLECT_GCC_OPTIONS='-e' '-v' '-march=kaveri'
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.4/cc1 -quiet /usr/include/stdlib.h -quiet -dumpbase stdlib.h "-march=kaveri" -auxbase stdlib -o /tmp/cckDdkXv.s "--output-pch=/usr/include/stdlib.h.gch"
COLLECT_GCC_OPTIONS='-e' '-v' '-march=znver1'
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.4/cc1 -quiet -v /usr/include/stdlib.h -quiet -dumpbase stdlib.h "-march=COLLECT_GCC_OPTIONS=-e" "-march=znver1" -auxbase stdlib -version -o /tmp/ccyO3gUd.s "--output-pch=/usr/include/stdlib.h.gch"
COLLECT_GCC_OPTIONS='-e' '-v' '-march= '-march=haswell'
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.4/cc1 -quiet -v /usr/include/stdlib.h -quiet -dumpbase stdlib.h "-march=COLLECT_GCC_OPTIONS=-e" "-march=haswell" -auxbase stdlib -version -o /tmp/ccN2RAAN.s "--output-pch=/usr/include/stdlib.h.gch"
Code: Select all
COLLECT_GCC_OPTIONS='-e' '-v' '-march=COLLECT_GCC_OPTIONS=-e' '-v' '-march=znver1'
/usr/libexec/gcc/x86_64-pc-linux-gnu/6.3.0/cc1 -quiet -v /usr/include/stdlib.h -quiet -dumpbase stdlib.h "-march=COLLECT_GCC_OPTIONS=-e" "-march=znver1" -auxbase stdlib -version -o /tmp/cc17GWpy.s "--output-pch=/usr/include/stdlib.h.gch"
COLLECT_GCC_OPTIONS='-e' '-v' '-march=COLLECT_GCC_OPTIONS=-e' '-v' '-march=haswell'
/usr/libexec/gcc/x86_64-pc-linux-gnu/6.3.0/cc1 -quiet -v /usr/include/stdlib.h -quiet -dumpbase stdlib.h "-march=COLLECT_GCC_OPTIONS=-e" "-march=haswell" -auxbase stdlib -version -o /tmp/cc1ZOHNR.s "--output-pch=/usr/include/stdlib.h.gch"
I agree, so it is either a bug in the uarch or a bug in gcc.Tony0945 wrote:
IMHO "haswell" avoids the segfaults because it avoids the instructions that have a bug in Ryzen. I have a hard time beleiving that AMD copied their architecture.

If the kernel encounters an illegal instruction, you will get "trap invalid opcode" errors in dmesg and gcc. gcc will not randomly segfault in this case.Naib wrote:I agree, so it is either a bug in the uarch or a bug in gcc.Tony0945 wrote:
IMHO "haswell" avoids the segfaults because it avoids the instructions that have a bug in Ryzen. I have a hard time beleiving that AMD copied their architecture.
Code: Select all
emerge -e systemCode: Select all
emerge -e systemHere the flags for Ryzen 7 1700:NeddySeagoon wrote:Tony0945,
What does app-portage/cpuid2cpuflags say about a Ryzen too?
Code: Select all
CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3Code: Select all
CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3"Do you mean, the system still does not work correctly ?bgamari wrote:If your experience reflects mine, it will make no difference. I have tried three different sets of memory to no avail.drizzt wrote:Setting RAM to 2133 doesn't help either. I will order new RAM and see if this helps.

Correct, I was able to reproduce the crashes with all three sets of memory.drizzt wrote:Do you mean, the system still does not work correctly ?bgamari wrote:If your experience reflects mine, it will make no difference. I have tried three different sets of memory to no avail.drizzt wrote:Setting RAM to 2133 doesn't help either. I will order new RAM and see if this helps.
NeddySeagoon, you are a genius !NeddySeagoon wrote:drizzt,
Q1 ... Read the script
binutils is slotted. You can choose which one is used.I have several as I cross compile things.Code: Select all
$ eselect binutils list [1] aarch64-unknown-linux-gnu-2.27 * [2] armv6j-hardfloat-linux-gnueabi-2.26.1 [3] armv6j-hardfloat-linux-gnueabi-2.27 * [4] armv7a-hardfloat-linux-gnueabi-2.27 * [5] i686-pc-linux-gnu-2.27 * [6] x86_64-pc-linux-gnu-2.27 *
well i have only one version of binutils 2.26.1. Do you still get segfaults?drizzt wrote: NeddySeagoon, you are a genius !
I had 3 versions of binutils for the same architecture on my system. Guess what happened:
The newest one got always rebuild, but the oldest one was used.
I cleaned this mess up and I am compiling like crazy the whole day for testing. No segfaults so far on both systems.
Thank you all for your help and suggestions. Let's see if things are sorted out.
No, still compiling like a maniac on both systems and no segfaults.liewyec wrote:well i have only one version of binutils 2.26.1. Do you still get segfaults?drizzt wrote: NeddySeagoon, you are a genius !
I had 3 versions of binutils for the same architecture on my system. Guess what happened:
The newest one got always rebuild, but the oldest one was used.
I cleaned this mess up and I am compiling like crazy the whole day for testing. No segfaults so far on both systems.
Thank you all for your help and suggestions. Let's see if things are sorted out.
I recompiled existing system, but i tried new instalation, because of the segfaults. Today I upgraded to bin utils 2.27 and kernel 4.11-rc7 and i wil test this. My system is r7 1800x, 32gb ram, gcc-6.3.0drizzt wrote:No, still compiling like a maniac on both systems and no segfaults.liewyec wrote:well i have only one version of binutils 2.26.1. Do you still get segfaults?drizzt wrote: NeddySeagoon, you are a genius !
I had 3 versions of binutils for the same architecture on my system. Guess what happened:
The newest one got always rebuild, but the oldest one was used.
I cleaned this mess up and I am compiling like crazy the whole day for testing. No segfaults so far on both systems.
Thank you all for your help and suggestions. Let's see if things are sorted out.
My Systems:
- R7 1700, 16GB RAM, gcc-5.4.0 (march=haswell), binutils 2.27, Kernel 4.10.8
- R5 1600, 16GB RAM, gcc-5.4.0 (march=haswell), binutils 2.27, Kernel 4.10.8
If you "upgraded" an existing system like me => I recompiled the toolchain at least 10 times. Looking back I think I should have started fresh.