Comments (31)
If you build fastfetch from source, can you get the stack trace? You should build fastfetch with -DCMAKE_BUILD_TYPE=Debug
from fastfetch.
If you build fastfetch from source, can you get the stack trace? You should build fastfetch with
-DCMAKE_BUILD_TYPE=Debug
i managed to get the stack trace.
0x0000555555586ae9 in parseModuleJsonObject (type=0x55555583134c "initsystem", jsonVal=0x0, jsonDoc=0x0) at /home/user/fastfetch/src/common/jsonconfig.c:104
104 for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(type[0]) - 'A']; *modules; ++modules)
#0 0x0000555555586ae9 in parseModuleJsonObject (type=0x55555583134c "initsystem", jsonVal=0x0, jsonDoc=0x0) at /home/user/fastfetch/src/common/jsonconfig.c:104
modules = 0x0 :ssssssso.
#1 0x0000555555587849 in printJsonConfig (prepare=false, jsonDoc=0x0) at /home/user/fastfetch/src/common/jsonconfig.c:201
ms = 0/ +ssssooo/-
module = 0x0 -:/+osssso+-
type = 0x55555583134c "initsystem"
root = 0x555555835c70 `-/+/
__PRETTY_FUNCTION__ = "printJsonConfig"
modules = 0x555555835d10
item = 0x555555835db0
idx = 9
max = 64
#2 0x0000555555587eb8 in ffPrintJsonConfig (prepare=false, jsonDoc=0x0) at /home/user/fastfetch/src/common/jsonconfig.c:233
error = 0x55555582abc0 <instance> ""
#3 0x000055555557c251 in run (data=0x7fffffffe300) at /home/user/fastfetch/src/fastfetch.c:710
useJsonConfig = true
#4 0x000055555557cb5b in main (argc=3, argv=0x7fffffffe448) at /home/user/fastfetch/src/fastfetch.c:773
data = {structure = {allocated = 0, length = 0, chars = 0x5555557ea468 ""}, configLoaded = true}
from fastfetch.
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(type[0]) - 'A']; *modules; ++modules)
Strangely, the stack trace points to a common function that should not crash. The core dump file you uploaded contains 11 stack frames but the stack trace pasted below contains 5.
Core was generated by `/home/user/fastfetch/build/fastfetch'.
Program terminated with signal SIGINT, Interrupt.
#0 0x00007ffff7d98337 in ?? ()
(gdb) bt
#0 0x00007ffff7d98337 in ?? ()
#1 0x00007ffff7d9dd52 in ?? ()
#2 0x00007fffffffbf20 in ?? ()
#3 0x9f401203fdeb0000 in ?? ()
#4 0x0000003000000020 in ?? ()
#5 0x00007fffffffbf30 in ?? ()
#6 0x00005555556e4a10 in ?? ()
#7 0x00007fffffffe00c in ?? ()
#8 0x00007fffffffbf3c in ?? ()
#9 0x00000000fffffffc in ?? ()
#10 0x0000000000000000 in ?? ()
Are you sure that fastfetch did crash before you generated the stack trace? Can you paste the full gdb output here?
What does cat /proc/1/comm
print?
from fastfetch.
I Reinstalled Arch Linux, Still getting the same error.
from fastfetch.
Please follow this:
- build fastfetch in debug mode with
-DCMAKE_BUILD_TYPE=Debug
- run it
- upload the core dump file when it crashes
from fastfetch.
Please follow this:
1. build fastfetch in debug mode with `-DCMAKE_BUILD_TYPE=Debug` 2. run it 3. upload the core dump file when it crashes
Here:
core.8138.tar.gz
from fastfetch.
Core was generated by `/home/user/fastfetch/build/fastfetch --load-config all'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000555555586adb in ?? ()
[Current thread is 1 (LWP 8138)]
(gdb) bt
#0 0x0000555555586adb in ?? ()
#1 0x00007ffff7ffd000 in ?? ()
#2 0x0000000000000000 in ?? ()
A completely different stack trace, but still no symbols.
I guess the stack has been corrupted. Please try fastfetch -s initsystem --no-buffer
. If it crashes, upload both the fastfetch binary you built and core dump file.
Thanks for your help
EDIT: please apply this patch before testing
diff --git a/src/detection/initsystem/initsystem_linux.c b/src/detection/initsystem/initsystem_linux.c
index 078d36f1..3e47c1c3 100644
--- a/src/detection/initsystem/initsystem_linux.c
+++ b/src/detection/initsystem/initsystem_linux.c
@@ -3,9 +3,12 @@
const char* ffDetectInitSystem(FFInitSystemResult* result)
{
+ puts("0");
const char* error = ffProcessGetBasicInfoLinux((int) result->pid, &result->name, NULL, NULL);
if (error) return error;
+ puts("1");
+
const char* _;
// In linux /proc/1/exe is not readable
ffProcessGetInfoLinux((int) result->pid, &result->name, &result->exe, &_, NULL);
@@ -16,18 +19,22 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
if (realpath(result->exe.chars, buf))
ffStrbufSetS(&result->exe, buf);
}
+ puts("2");
if (ffStrbufEqualS(&result->name, "systemd"))
{
+ puts("3");
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
ffStrbufEndsWithS(&result->exe, "/systemd") ? result->exe.chars : "systemctl", // use exe path in case users have another systemd installed
"--version",
NULL,
}) == NULL && result->version.length)
{
+ puts("4");
uint32_t iStart = ffStrbufFirstIndexC(&result->version, '(');
if (iStart < result->version.length)
{
+ puts("5");
uint32_t iEnd = ffStrbufNextIndexC(&result->version, iStart + 1, ')');
ffStrbufSubstrBefore(&result->version, iEnd);
ffStrbufSubstrAfter(&result->version, iStart);
@@ -52,6 +59,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
}
}
}
+ puts("6");
return NULL;
}
from fastfetch.
fastfetch -s initsystem --no-buffer
Reading symbols from ./fastfetch...
Starting program: /home/user/fastfetch/build/fastfetch -s initsystem --no-buffer
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00005555555815e5 in parseStructureCommand (line=0x55555582fd70 "initsystem", fn=0x555555580844 <genJsonResult>, jsonDoc=0x0) at /home/user/fastfetch/src/common/commandoption.c:88
88 for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
#0 0x00005555555815e5 in parseStructureCommand (line=0x55555582fd70 "initsystem", fn=0x555555580844 <genJsonResult>, jsonDoc=0x0) at /home/user/fastfetch/src/common/commandoption.c:88
modules = 0xffffffffffffffff
#1 0x00005555555816de in ffPrintCommandOption (data=0x7fffffffe3a0, jsonDoc=0x0) at /home/user/fastfetch/src/common/commandoption.c:118
colonIndex = 10++:
ms = 0++++++++++++:
startIndex = 0ooooo/
#2 0x000055555557c259 in run (data=0x7fffffffe3a0) at /home/user/fastfetch/src/fastfetch.c:712
useJsonConfig = false+
#3 0x000055555557cb4b in main (argc=4, argv=0x7fffffffe4e8) at /home/user/fastfetch/src/fastfetch.c:773
data = {structure = {allocated = 32, length = 10, chars = 0x55555582fd70 "initsystem"}, configLoaded = false}
from fastfetch.
What does fastfetch -s initsystem --no-buffer
print without running in gdb?
from fastfetch.
note: i have reinstalled arch and my hostname has changed.
from fastfetch.
Try fastfetch -s initsystem --no-buffer -l none
instead
from fastfetch.
fastfetch -s initsystem --no-buffer -l none
from fastfetch.
diff --git a/src/common/commandoption.c b/src/common/commandoption.c
index 3d9c9374..8396b3fc 100644
--- a/src/common/commandoption.c
+++ b/src/common/commandoption.c
@@ -85,15 +85,19 @@ static void parseStructureCommand(
{
if(ffCharIsEnglishAlphabet(line[0]))
{
+ fputs(line, stderr);
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
{
+ fputs("p1", stderr);
FFModuleBaseInfo* baseInfo = *modules;
if (ffStrEqualsIgnCase(line, baseInfo->name))
{
+ fputs("p2", stderr);
if (__builtin_expect(jsonDoc != NULL, false))
fn(baseInfo, jsonDoc);
else
baseInfo->printModule(baseInfo);
+ fputs("p3", stderr);
return;
}
}
Please apply this patch and try the command again, thanks.
from fastfetch.
diff --git a/src/common/commandoption.c b/src/common/commandoption.c index 3d9c9374..8396b3fc 100644 --- a/src/common/commandoption.c +++ b/src/common/commandoption.c @@ -85,15 +85,19 @@ static void parseStructureCommand( { if(ffCharIsEnglishAlphabet(line[0])) { + fputs(line, stderr); for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules) { + fputs("p1", stderr); FFModuleBaseInfo* baseInfo = *modules; if (ffStrEqualsIgnCase(line, baseInfo->name)) { + fputs("p2", stderr); if (__builtin_expect(jsonDoc != NULL, false)) fn(baseInfo, jsonDoc); else baseInfo->printModule(baseInfo); + fputs("p3", stderr); return; } }Please apply this patch and try the command again, thanks.
from fastfetch.
So it did crashed at for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
diff --git a/src/common/commandoption.c b/src/common/commandoption.c
index 3d9c9374..48ce80e4 100644
--- a/src/common/commandoption.c
+++ b/src/common/commandoption.c
@@ -85,15 +85,22 @@ static void parseStructureCommand(
{
if(ffCharIsEnglishAlphabet(line[0]))
{
- for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
+ fprintf(stderr, "%s: %c - %c = %d\n", line, toupper(line[0]), 'A', toupper(line[0]) - 'A');
+ FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A'];
+ fprintf(stderr, "modules: %p\n", modules);
+ fprintf(stderr, "*modules: %p\n", *modules);
+ for (; *modules; ++modules)
{
+ fputs("p1\n", stderr);
FFModuleBaseInfo* baseInfo = *modules;
if (ffStrEqualsIgnCase(line, baseInfo->name))
{
+ fputs("p2\n", stderr);
if (__builtin_expect(jsonDoc != NULL, false))
fn(baseInfo, jsonDoc);
else
baseInfo->printModule(baseInfo);
+ fputs("p3", stderr);
return;
}
}
Try this please
from fastfetch.
It was really strange. The binary you just uploaded works for me. Arch linux too.
from fastfetch.
So it did crashed at
for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
diff --git a/src/common/commandoption.c b/src/common/commandoption.c index 3d9c9374..48ce80e4 100644 --- a/src/common/commandoption.c +++ b/src/common/commandoption.c @@ -85,15 +85,22 @@ static void parseStructureCommand( { if(ffCharIsEnglishAlphabet(line[0])) { - for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules) + fprintf(stderr, "%s: %c - %c = %d\n", line, toupper(line[0]), 'A', toupper(line[0]) - 'A'); + FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; + fprintf(stderr, "modules: %p\n", modules); + fprintf(stderr, "*modules: %p\n", *modules); + for (; *modules; ++modules) { + fputs("p1\n", stderr); FFModuleBaseInfo* baseInfo = *modules; if (ffStrEqualsIgnCase(line, baseInfo->name)) { + fputs("p2\n", stderr); if (__builtin_expect(jsonDoc != NULL, false)) fn(baseInfo, jsonDoc); else baseInfo->printModule(baseInfo); + fputs("p3", stderr); return; } }Try this please
i also have reversed the other patch because this one did not apply
from fastfetch.
i - A = 40
What locale are you using? Does your language have the upper case I
?
from fastfetch.
i - A = 40
What locale are you using? Does your language have the upper case
I
?
Yes But Its For ı not i. i becomes İ
from fastfetch.
OMG
i - A = 40
What locale are you using? Does your language have the upper caseI
?Yes But Its For ı not i. i becomes İ
from fastfetch.
diff --git a/src/common/commandoption.c b/src/common/commandoption.c
index 3d9c9374..ecf6b839 100644
--- a/src/common/commandoption.c
+++ b/src/common/commandoption.c
@@ -77,6 +77,11 @@ static void genJsonResult(FFModuleBaseInfo* baseInfo, yyjson_mut_doc* doc)
yyjson_mut_obj_add_str(doc, module, "error", "Unsupported for JSON format");
}
+char toUpperNoLocale(char c)
+{
+ return c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c;
+}
+
static void parseStructureCommand(
const char* line,
void (*fn)(FFModuleBaseInfo *baseInfo, yyjson_mut_doc* jsonDoc),
@@ -85,7 +90,7 @@ static void parseStructureCommand(
{
if(ffCharIsEnglishAlphabet(line[0]))
{
- for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules)
+ for (FFModuleBaseInfo** modules = ffModuleInfos[toUpperNoLocale(line[0]) - 'A']; *modules; ++modules)
{
FFModuleBaseInfo* baseInfo = *modules;
if (ffStrEqualsIgnCase(line, baseInfo->name))
This should fix the issue
from fastfetch.
diff --git a/src/common/commandoption.c b/src/common/commandoption.c index 3d9c9374..ecf6b839 100644 --- a/src/common/commandoption.c +++ b/src/common/commandoption.c @@ -77,6 +77,11 @@ static void genJsonResult(FFModuleBaseInfo* baseInfo, yyjson_mut_doc* doc) yyjson_mut_obj_add_str(doc, module, "error", "Unsupported for JSON format"); } +char toUpperNoLocale(char c) +{ + return c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c; +} + static void parseStructureCommand( const char* line, void (*fn)(FFModuleBaseInfo *baseInfo, yyjson_mut_doc* jsonDoc), @@ -85,7 +90,7 @@ static void parseStructureCommand( { if(ffCharIsEnglishAlphabet(line[0])) { - for (FFModuleBaseInfo** modules = ffModuleInfos[toupper(line[0]) - 'A']; *modules; ++modules) + for (FFModuleBaseInfo** modules = ffModuleInfos[toUpperNoLocale(line[0]) - 'A']; *modules; ++modules) { FFModuleBaseInfo* baseInfo = *modules; if (ffStrEqualsIgnCase(line, baseInfo->name))This should fix the issue
from fastfetch.
Still better than crashing.
Try append flag --format json
from fastfetch.
Still better than crashing.
Try append flag
--format json
from fastfetch.
Try LANG=C fastfetch ...
from fastfetch.
LANG=C
from fastfetch.
will there be a patch?
from fastfetch.
I still dont know how the your locale works. Which locale on earth are you using?
from fastfetch.
I still dont know how the your locale works. Which locale on earth are you using?
tr_TR.UTF-8
from fastfetch.
I need more time for investigation. Thanks for your information
from fastfetch.
You can revert all the patches. LANG=C should work fine
from fastfetch.
Related Issues (20)
- [FEAT] MegaChallenge: 8-bit Fastfetch for FUZIX 8-bit UNIX-Like OS HOT 1
- [FEAT] Add detection of NPUs / AI accelerators and their capabilities. HOT 1
- [FEAT] Module to display upstream distro(s) HOT 3
- [FEAT] Detect panel type for monitors. HOT 1
- [BUG] fastfetch breaks tty when reading the "Display" variable HOT 6
- Able to use two colors in the key HOT 4
- [BUG] why do fastfetch and neofetch show different memory ammount being used HOT 9
- [BUG] Incorrect Local IP since 2.12.0 HOT 5
- [BUG] Wrong GPU frequency shown. HOT 15
- [BUG] LM detection not working HOT 2
- [BUG] Dedicated GPU detected as integrated. HOT 25
- [FEAT] Allow placement of the logo to be on the right of information section
- [BUG] Incorrect number of flatpaks reported HOT 2
- [BUG] Can't replicate neofetch exactly with same colors and text
- [FEAT] Use kitten icat for logo
- [FEAT] Truncate field in format HOT 5
- [FEAT] Supports for npm global packages HOT 2
- [Request for help] Test fastfetch on real Windows On Arm (X Elite?) HOT 3
- [BUG] Font display broken on 2.17 (QT) HOT 13
- [BUG] fastfetch segfaults with --stat and an invalid module
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 fastfetch.