You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened: fastfetch crashes when trying to construct the CPU name, when it cannot find BIOS Vendor ID in the output of lscpu (which happens when run without root privileges).
$ gdb -q --args /usr/bin/fastfetch --multithreading false --structure CPU --pipe
Reading symbols from /usr/bin/fastfetch...
(gdb) r
Starting program: /usr/bin/fastfetch --multithreading false --structure CPU --pipe
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Detaching after fork from child process 7165]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7df0f1c in strchrnul () from /lib64/libc.so.6
(gdb) bt full
#0 0x00007ffff7df0f1c in strchrnul () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007ffff7df0ed8 in strchr () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007ffff7df357c in strstr () from /lib64/libc.so.6
No symbol table info available.
#3 0x000055555567245c in ffDetectCPUImpl (options=0x55555571d9e0 <instance+1144>, cpu=0x7ffffffee9f8)
at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/detection/cpu/cpu_linux.c:271
pstart = 0x0
buffer = {allocated = 1024, length = 639,
chars = 0x555555722100 "Architecture: loongarch64\nCPU op-mode(s): 32-bit, 64-bit\nAddress sizes: 48 bits physical, 48 bits virtual\nByte Order: Little Endian\nCPU(s):", ' ' <repeats 14 times>, "4\nOn-line CPU(s) lis"...}
physicalCoresBuffer = {allocated = 0, length = 0, chars = 0x5555556da928 ""}
cpuMHz = {allocated = 0, length = 0, chars = 0x5555556da928 ""}
cpuIsa = {allocated = 0, length = 0, chars = 0x5555556da928 ""}
cpuUarch = {allocated = 0, length = 0, chars = 0x5555556da928 ""}
error = 0x0
#4 0x00005555555771b8 in ffDetectCPU (options=0x55555571d9e0 <instance+1144>, cpu=0x7ffffffee9f8) at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/detection/cpu/cpu.c:7
error = 0xffffffffbac24e6a <error: Cannot access memory at address 0xffffffffbac24e6a>
removeStrings = {0x0, 0x5555555553ad "memchr", 0x7ffff7fed640 "\230\325\376\367\377\177", 0xffffffff <error: Cannot access memory at address 0xffffffff>, 0x7ffff7d70e40 "\252n",
0x7ffff7fee940 "", 0x1 <error: Cannot access memory at address 0x1>, 0x7ffff7feef60 "\017WUUUU", 0x7ffffffeea80 "\206", 0x7ffffffee9e8 "x\374\330\367\377\177",
0x555555709668 "\354\211VUUU", 0x7ffffffeef80 "\236\362\376\377\377\177", 0x555555709668 "\354\211VUUU", 0x7ffff7ed5000 <main_arena+1744> "\360O\355\367\377\177",
0x5555556929a8 <main> "c\200\376\002a`\301)v@\301)v\200\301\002\214", 0x555555567ae0 "`\223\034", 0x55555571d360 <toupper@got[plt]> "x\374\330\367\377\177",
0x840 <error: Cannot access memory at address 0x840>}
#5 0x000055555559c660 in ffPrintCPU (options=0x55555571d9e0 <instance+1144>) at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/modules/cpu/cpu.c:19
cpu = {name = {allocated = 0, length = 0, chars = 0x5555556da928 ""}, vendor = {allocated = 0, length = 0, chars = 0x5555556da928 ""}, coresPhysical = 4, coresLogical = 4,
coresOnline = 4, frequencyMin = nan(0x8000000000000), frequencyMax = nan(0x8000000000000), temperature = nan(0x8000000000000)}
error = 0x7ffff7d70e40 "\252n"
#6 0x000055555556ccb8 in parseStructureCommand (line=0x5555557220d0 "CPU", customValues=0x7ffffffeeda8, fn=0x55555556c03c <genJsonResult>, jsonDoc=0x0)
at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/common/commandoption.c:115
baseInfo = 0x55555571d9e0 <instance+1144>
modules = 0x55555571cc78 <C.lto_priv.0+32>
#7 0x000055555556cdc8 in ffPrintCommandOption (data=0x7ffffffeed98, jsonDoc=0x0) at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/common/commandoption.c:137
colonIndex = 3
ms = 0
startIndex = 0
#8 0x00005555556922a4 in run (data=0x7ffffffeed98) at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/fastfetch.c:809
useJsonConfig = false
#9 0x0000555555692a94 in main (argc=6, argv=0x7ffffffeef48) at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/fastfetch.c:870
data = {structure = {allocated = 32, length = 3, chars = 0x5555557220d0 "CPU"}, customValues = {data = 0x0, elementSize = 40, length = 0, capacity = 0}, configLoaded = false}
(gdb) frame 3
#3 0x000055555567245c in ffDetectCPUImpl (options=0x55555571d9e0 <instance+1144>, cpu=0x7ffffffee9f8) at /usr/src/debug/app-misc/fastfetch-2.8.3/fastfetch-2.8.3/src/detection/cpu/cpu_linux.c:271
271 while ((pstart = strstr(pstart, "Model name:")))
(gdb) l
266 return NULL;
267 }
268 }
269 }
270
271 while ((pstart = strstr(pstart, "Model name:")))
272 {
273 pstart += strlen("Model name:");
274 while (isspace(*pstart)) ++pstart;
275 if (*pstart == '\0')
The issue is due to the fact that the output of lscpu does not contain the BIOS Vendor ID field when run without root privileges. This means that fastfetch does not crash when run with root privileges, but it does crash when run without root.
General description of bug:
fastfetch
crashes when trying to construct the CPU name, when it cannot findBIOS Vendor ID
in the output oflscpu
(which happens when run without root privileges).Often helpful information:
Screenshot:
The content of the configuration file you use (if any): None
Output of
fastfetch -c ci.jsonc --format json
: This command segfaults without root privileges, output with root:Output of
fastfetch --list-features
:If fastfatch crashed
Paste the stacktrace here. You may get it with:
The issue is due to the fact that the output of
lscpu
does not contain theBIOS Vendor ID
field when run without root privileges. This means thatfastfetch
does not crash when run with root privileges, but it does crash when run without root.Output of
lscpu
without root:Output of
lscpu
with root:The text was updated successfully, but these errors were encountered: