Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
find: cksum terminated by sig 4 w/coreutils-9.1-r1 [SOLVED]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1496

PostPosted: Tue Dec 06, 2022 4:17 pm    Post subject: Reply with quote

mike155 wrote:
Okay, I think I know what's going on. Please try:
Code:
CFLAGS="-O2 -pipe -ggdb3 -march=native -mno-avx"


Thanks. That compiled, and it's working. Is this a possible bug I need to report?

hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Dec 06, 2022 4:21 pm    Post subject: Reply with quote

@grknight: not on my machine. I have:
Code:
CFLAGS="-march=native -O2 -pipe -mno-avx"

and that results in:
Code:
x86_64-pc-linux-gnu-gcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src  -mavx -mpclmul   -march=native -O2 -pipe -mno-avx -c -o src/libcksum_pclmul_a-cksum_pclmul.o `test -f 'src/cksum_pclmul.c' || echo './'`src/cksum_pclmul.c

"-mno-avx" is still there.

@hanj: Please make another test with:
Code:
CFLAGS="-O2 -pipe -ggdb3 -march=native"

Does that work as well?
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1496

PostPosted: Tue Dec 06, 2022 4:30 pm    Post subject: Reply with quote

mike155 wrote:

@hanj: Please make another test with:
Code:
CFLAGS="-O2 -pipe -ggdb3 -march=native"

Does that work as well?


That did NOT work.

hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Dec 06, 2022 4:56 pm    Post subject: Reply with quote

Several virtualizers seem to have problems with AVX. See: https://stackoverflow.com/questions/65780506/how-to-enable-avx-avx2-in-virtualbox-6-1-16-with-ubuntu-20-04-64bit, for example.

Please check the configuration of your virtualizer. It could well be that you have to enable AVX. If you cannot change the configuration of your virtualization software, use
Code:
CFLAGS="-march=native -mno-avx -O2 -pipe"
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1496

PostPosted: Tue Dec 06, 2022 5:05 pm    Post subject: Reply with quote

mike155 wrote:
Several virtualizers seem to have problems with AVX. See: https://stackoverflow.com/questions/65780506/how-to-enable-avx-avx2-in-virtualbox-6-1-16-with-ubuntu-20-04-64bit, for example.

Please check the configuration of your virtualizer. It could well be that you have to enable AVX. If you cannot change the configuration of your virtualization software, use
Code:
CFLAGS="-march=native -mno-avx -O2 -pipe"


Sounds good. I added it package.env to do this for coreutils. Thanks so much for the help!

hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Dec 06, 2022 5:41 pm    Post subject: Reply with quote

Why don't you want to use "-march=native -mno-avx -O2 -pipe" for all packages?
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1496

PostPosted: Tue Dec 06, 2022 5:52 pm    Post subject: Reply with quote

mike155 wrote:
Why don't you want to use "-march=native -mno-avx -O2 -pipe" for all packages?


Not sure. Up to now, this is the first problem I've ever had with this.

hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Dec 06, 2022 5:59 pm    Post subject: Reply with quote

Well,
Code:
CFLAGS="-O2 -pipe"

gives you only the basic x86_64 instruction set. No extensions at all. Portable, but slow...
Code:
CFLAGS="-march=native -O2 -pipe"

gives you the basic x86_64 instruction set and additionally all extensions your processor supports. That's the recommended value. See: https://wiki.gentoo.org/wiki/Safe_CFLAGS

Unfortunately, you processor doesn't seem to support AVX when running in a virtualized environment. Therefore...
Code:
CFLAGS="-march=native -mno-avx -O2 -pipe"

is necessary to give all supported extensions, with the exception of AVX.
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1496

PostPosted: Tue Dec 06, 2022 6:07 pm    Post subject: Reply with quote

mike155 wrote:
Unfortunately, you processor doesn't seem to support AVX when running in a virtualized environment. Therefore...
Code:
CFLAGS="-march=native -mno-avx -O2 -pipe"

is necessary to give all supported extensions, with the exception of AVX.


Cool. I'll update my make.conf. Thanks again for all the help!

hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Dec 06, 2022 6:17 pm    Post subject: Reply with quote

One more thing.

Your output of "emerge --info" shows many different versions of binutils, gcc, lvm.

Do you want all those versions to be installed? If you want them, that's fine.

If you don't want or need all those versions, it's time to clean up your system. Run "emerge --depclean".

If that doesn't help, look at your world file: /var/lib/portage/world. Remove everything you don't want to be installed and run "emerge --depclean".
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1496

PostPosted: Tue Dec 06, 2022 7:39 pm    Post subject: Reply with quote

mike155 wrote:
One more thing.

Your output of "emerge --info" shows many different versions of binutils, gcc, lvm.

Do you want all those versions to be installed? If you want them, that's fine.

If you don't want or need all those versions, it's time to clean up your system. Run "emerge --depclean".

If that doesn't help, look at your world file: /var/lib/portage/world. Remove everything you don't want to be installed and run "emerge --depclean".


Thanks! I've cleaned up binutils, and will be tackling gcc and lvm next. I had to use ccache to get my llvm up-to-date (finished this morning).

Thanks!
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1721

PostPosted: Sat Jan 21, 2023 3:41 am    Post subject: Reply with quote

grknight wrote:
Coreutils overrides -mno-avx inside its Makefile if avx is detected by cpu capability and includes a file that needs AVX..
Override: https://github.com/coreutils/coreutils/blob/master/src/local.mk#L422
Detection: https://github.com/coreutils/coreutils/blob/master/configure.ac#L570


That's fine, it does runtime detection for whether to dispatch to the intrinsics. You can tell from the cpuid references and e.g. https://github.com/coreutils/coreutils/commit/4064c57380621399b54217a64c2c2bed1d0dccd1#diff-4a4077805a07595516daf20855f5c923343593b1847722210f86947527a52ca0R775.

But if you do spot something you believe is a problem, please file a bug, as it's easy for concerns to get lost on the forums.
Back to top
View user's profile Send private message
guid0
Guru
Guru


Joined: 06 Jul 2003
Posts: 371
Location: The Netherlands / Nederland

PostPosted: Thu Dec 28, 2023 1:55 pm    Post subject: Reply with quote

Just adding some more feedback as I ran into a similar issue on a bare metal non-VM machine with below cpu:

Code:
processor   : 0
vendor_id   : GenuineIntel
cpu family   : 6
model      : 94
model name   : Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
stepping   : 3
microcode   : 0xf0
cpu MHz      : 3671.904
cache size   : 8192 KB
physical id   : 0
siblings   : 8
core id      : 0
cpu cores   : 4
apicid      : 0
initial apicid   : 0
fpu      : yes
fpu_exception   : yes
cpuid level   : 22
wp      : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl smx est tm2 ssse3 sdbg cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
bugs      : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit srbds mmio_stale_data retbleed gds
bogomips   : 5799.77
clflush size   : 64
cache_alignment   : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

which looking at above available cpuflags has no support for avx2, however Intel claims otherwise at https://ark.intel.com/content/www/us/en/ark/products/88175/intel-xeon-processor-e3-1260l-v5-8m-cache-2-90-ghz.html so im assuming it can do avx instructions.

Nevertheless the only way for me to move past the cksum error was to:

Code:
CFLAGS="-O2 -pipe -march=native -mno-avx"

and recompile coreutils.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21918

PostPosted: Thu Dec 28, 2023 3:26 pm    Post subject: Reply with quote

guid0 wrote:
Code:

model name   : Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl smx est tm2 ssse3 sdbg cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
bugs      : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit srbds mmio_stale_data retbleed gds

which looking at above available cpuflags has no support for avx2, however Intel claims otherwise at https://ark.intel.com/content/www/us/en/ark/products/88175/intel-xeon-processor-e3-1260l-v5-8m-cache-2-90-ghz.html so im assuming it can do avx instructions.
Your output states you are vulnerable to Gather Data Sampling. You may, depending on kernel version and options, be under the effect of the heavy handed GDS mitigation that disables AVX. However, it's my understanding that programs which probe for AVX "properly" should work fine anyway. See Documentation/admin-guide/hw-vuln/gather_data_sampling.rst for background on Gather Data Sampling.
Back to top
View user's profile Send private message
guid0
Guru
Guru


Joined: 06 Jul 2003
Posts: 371
Location: The Netherlands / Nederland

PostPosted: Thu Dec 28, 2023 7:52 pm    Post subject: Reply with quote

sorry, to steel the topic here. :oops:

Hu wrote:
Your output states you are vulnerable to Gather Data Sampling. You may, depending on kernel version and options, be under the effect of the heavy handed GDS mitigation that disables AVX. However, it's my understanding that programs which probe for AVX "properly" should work fine anyway. See Documentation/admin-guide/hw-vuln/gather_data_sampling.rst for background on Gather Data Sampling.

Thanks for this. Interesting read. I simply follow the microcode updates Gentoo brings in.
Code:
[    0.000000] microcode: microcode updated early to revision 0xf2, date = 2023-01-02
[    0.000000] Linux version 6.1.67-gentoo (root@ag1) (gcc (Gentoo Hardened 13.2.1_p20230826 p7) 13.2.1 20230826, GNU ld (Gentoo 2.40 p7) 2.40.0) #1 SMP Mon Dec 18 12:14:09 CET 2023

Which is currently provided through sys-firmware/intel-microcode-20231114_p20231114. Could this microcode not be protecting against gds?

When looking at /sys/devices/system/cpu/vulnerabilities/gather_data_sampling i get:
Code:
Mitigation: AVX disabled, no microcode

Processor is vulnerable and microcode is missing mitigation. AVX disabled as mitigation. (Documentation/admin-guide/hw-vuln/gather_data_sampling.rst)

Am i using the wrong microcode or is this up to Intel to provide fixes?

cheers,
guid0
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21918

PostPosted: Thu Dec 28, 2023 8:19 pm    Post subject: Reply with quote

Microcode is extremely closed source and proprietary. If you are using current microcode, which it looks to me like you are, then yes, you are waiting for Intel to deign to provide updated microcode for your processor. Ark seems to be broken right now (it just returns "Access Denied"), so I cannot check details of your chip. I seem to recall that CPUs more than a few years old were in the unpleasant spot that they were new enough to have the defect, but old enough that Intel did not want to issue microcode for them.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum