Comments (6)
Alright! Sounds good! I'll get to compiling it straight away.
from libcpuid.
I know you assigned yourself and you were going to look into it but maybe I can provide some insight. I took the backtrace and found the offending code:
cpuid_main.c:
/* Update logical and physical CPU counters in system->cpu_types on the last iteration or when purpose is different than previous core */
if (raw_array->with_affinity && (is_last_item || (is_new_cpu_type && (system->num_cpu_types > 1)))) {
cpu_type_index = is_new_cpu_type ? system->num_cpu_types - 2 : system->num_cpu_types - 1;
copy_affinity_mask(&system->cpu_types[cpu_type_index].affinity_mask, &affinity_mask); // <--
if (!is_last_item) {
init_affinity_mask(&affinity_mask);
set_affinity_mask_bit(logical_cpu, &affinity_mask);
}
if (is_apic_supported) {
system->cpu_types[cpu_type_index].num_cores = cores_type.instances;
system->cpu_types[cpu_type_index].l1_instruction_instances = caches_type.instances[L1I];
system->cpu_types[cpu_type_index].l1_data_instances = caches_type.instances[L1D];
system->cpu_types[cpu_type_index].l2_instances = caches_type.instances[L2];
system->cpu_types[cpu_type_index].l3_instances = caches_type.instances[L3];
system->cpu_types[cpu_type_index].l4_instances = caches_type.instances[L4];
if (!is_last_item) {
core_instances_t_constructor(&cores_type);
cache_instances_t_constructor(&caches_type);
update_core_instances(&cores_type, &apic_info);
update_cache_instances(&caches_type, &apic_info, &id_info, true);
update_cache_instances(&caches_all, &apic_info, &id_info, false);
}
}
// Code segment containing SMT recognition removed for smaller snippet.
prev_package_id = cur_package_id;
Then in libcpuid_util.c:
void copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask)
{
memcpy(dest_affinity_mask->__bits, src_affinity_mask->__bits, __MASK_SETSIZE);
}
I can't help but wonder why the name of the function in the backtrace says __memcpy_avx_unaligned_erms. Is your CPU AVX-capable or is there something that I'm missing? Because I'm pretty sure Core 2 doesn't support AVX (or SSE4.2 for that matter). That wouldn't cause a segfault though...
Should I run the program on my PC and attempt to extract a backtrace via valgrind or gdb? That may give more insight.
If CPU-related information helps, here's my CPU:
Intel Celeron 900
2.2 GHz
0 MB L3 Cache
1 MB L2 Cache
32 kB L1i Cache
32 kB L1d Cache
1 core, 1 thread (not SMT-capable)
SSE, SSE2, SSE3, SSSE3, MMX
Virtualization not supported.
Locked multiplier, no support for SpeedStep.
No support for Turbo Boost.
from libcpuid.
@RSC-Games do not worry, it is likely bad arguments passed from copy_affinity_mask()
to memcpy()
.
from libcpuid.
Yeah just like I thought: cpu_type_index = is_new_cpu_type ? system->num_cpu_types - 2 : system->num_cpu_types - 1;
cpu_type_index=255 in that case so it is definitely out of bounds.
from libcpuid.
So should I compile from source or is a new version available on debian repositories?
from libcpuid.
Conclusion about this segfault: we did not have any single-core CPU using the new raw format in the tests
directory, that is why I did not spot this issue during v0.6.0 development. It is a case (rare nowadays) when both is_new_cpu_type
and is_last_item
are true at the same time (i.e. single-core CPU).
Also, I added your Celeron 900 in database and in tests
directory in 6c9798c, so it is the first one now.
So should I compile from source or is a new version available on debian repositories?
Well, this fix will be in next release (v0.6.2?), so I have no idea when it will be fixed in Debian repositories, sorry.
You can still build libcpuid from source, then ensure that you overwrite the previous library (e.g. /usr/lib/x86_64-linux-gnu/libcpuid.so.16.0.0
on Debian amd64).
from libcpuid.
Related Issues (20)
- CMake build script not in 0.5.0 tarball release HOT 1
- conda-forge package HOT 5
- CPU Family/Model is used as Ext.Family/Model HOT 5
- Intel Alder Lake processors are not properly recognized HOT 21
- C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\x86_64-w64-mingw32\bin\ld.exe C:\Users\user\AppData\Local\Temp\cc79calV.o:sysinfo.cpp:(.text+0x15a): undefined reference to `cpuid_present' HOT 2
- xmp profile on H670 chipset does not seem to be detected HOT 2
- cpuid_tool.exe v0.6.0 doesn't work on my PC HOT 3
- Library naming inconsistent between Autotools and CMake HOT 2
- v0.6.0 alder lake(hyper thread disabled) core numbers are not correct. HOT 1
- x86_64 architecture level HOT 4
- cpuid_tool 0.6.2 does not work on osx HOT 3
- Misprint, not enough zeros in the constant HOT 1
- cpuid_get_all_raw_data() leaves CPU affinity set to a single core HOT 3
- Overclock intel CPU HOT 3
- minimum and maximum frequency of AMD cpu HOT 7
- Wrong rdmsr temperature/voltage/clock for Core 2 CPUs HOT 3
- Support Extended CPU Topology for AMD CPU/APU HOT 3
- Missing `centaur_code_t.h` HOT 4
- Does this library have some options that depend on the kernel? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcpuid.