Closed AdisonCavani closed 3 years ago
Its hard to tell where the problem is just from the image, as fastfetch is multi threaded and any of those threads may segfault. Use fastfetch --multithreading false
and tell me where it does stop now.
error: XDG_RUNTIME_DIR not set in the environment. [1] 4258 segmentation fault fastfetch --multithreading false
This is more complicated as it looks, as i never use XDG_RUNTIME_DIR
. The question where it stops remains.
This seems to be something specific with your setup, XDG_RUNTIME_DIR= fastfetch
executes totally normal on my system, as it should. I don't have Windows installed so i can't test in WSL2. Without more information from you i can't do anything.
This is how it looks on my WSL2
After adding:
export XDG_RUNTIME_DIR=/some/directory/you/specify
export RUNLEVEL=3
to .zshrc,
XDG_RUNTIME_DIR not set in the environment
is no longer visible, but I'm getting another error:
Resolution seems to be the problem. Fastfetch first tries to use on of the libraries in specified order:
libwayland-client.so
libXrandr.so
libX11.so
Most probably you have one of the X11 libraries installed as a dependency, but no X Server running. This isn't a problem on linux, as i have implemented and tested this scenario, but maybe WSL2 behaves different. Can you look which of those libraries are present?
If resolution detection fails for all three, fastfetch falls back to scanning /sys/class/drm/*/modes
itself. But this surely doesn't need XDG_RUNTIME_DIR
, so the error is most probably in some X Configuration.
I've got this three libraries installed, but I don't have got /sys/class/drm/*modes
:
I assume you are compiling for yourself, so this shouldn't be much of a problem:
Go to the bottom of src/modules/resolution.c
. You'll find the following function there:
void ffPrintResolution(FFinstance* instance)
{
if(
printResolutionWaylandBackend(instance) ||
printResolutionXrandrBackend(instance) ||
printResolutionX11Backend(instance)
) return;
printResolutionDRMBackend(instance);
}
Each printResolution*
line calls a resolution implementation. Use comments (start the line with //
) to disable them one by one. This way you can find out which implementation fails. Sorry for the extra work.
After commenting out first printResolution*
should I uncomment first, and comment second or should I comment first, comment second and comment third at the end?
Keep the previous line commented, so it surely starts with the implementation to test.
First commented:
Second commented:
Removed if
statement:
Previously I was using a AUR package, not compiling myself
Hot guess, but replace the DRM line with a puts("Would use DRM");
, leaving the if as is.
Does the error still occur with fastfetch --set resolution=setval
? If no, most probably the DE code is to blame.
This means the error is in the WM / DE detection code, which sadly is used by half of the output, so we can't simple disable it part by part to find the issue. Best thing would be to use a debugger like gdb.
Yea i forgot that wm and de is detected anyway, as things like theme, icons, font, etc depend on it.
Inactive. Still be looking after it.
I'm encountering this issue
This means the error is in the WM / DE detection code, which sadly is used by half of the output, so we can't simple disable it part by part to find the issue. Best thing would be to use a debugger like gdb.
* thread #1, name = 'flashfetch', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
* frame #0: 0x00007ffff7f25f29 libc.so.6`__strcasecmp_l_avx + 69
frame #1: 0x0000555555560ea2 flashfetch`applyPrettyNameIfWM(result=0x0000555555575760, processName=0x000000000000008
frame #2: 0x0000555555561848 flashfetch`getWMDE(instance=0x00007fffffffe0c0, result=0x0000555555575760) at detectWM5
frame #3: 0x0000555555561c15 flashfetch`ffDetectWMDE(instance=0x00007fffffffe0c0) at detectWMDE.c:405:9
frame #4: 0x0000555555566de8 flashfetch`ffPrintCursor(instance=0x00007fffffffe0c0) at cursor.c:178:32
frame #5: 0x00005555555584d4 flashfetch`main(argc=<unavailable>, argv=<unavailable>) at flashfetch.c:30:5
frame #6: 0x00007ffff7df0b25 libc.so.6`__libc_start_main + 213
frame #7: 0x000055555555857e flashfetch`_start + 46
processName is NULL
I managed to make it working by removing lots of features.
diff --git a/src/flashfetch.c b/src/flashfetch.c
index 5a293bc..3306388 100644
--- a/src/flashfetch.c
+++ b/src/flashfetch.c
@@ -14,7 +14,7 @@ int main(int argc, char** argv)
ffStrbufSetS(&instance.config.color, instance.config.logo.colors[0]); //Use the primary color of the logo as key color
//Multithreading --> better performance
- ffStartDetectionThreads(&instance);
+ //ffStartDetectionThreads(&instance);
//Does things like disabling line wrap
ffStart(&instance);
@@ -28,14 +28,6 @@ int main(int argc, char** argv)
ffPrintUptime(&instance);
ffPrintPackages(&instance);
ffPrintShell(&instance);
- ffPrintResolution(&instance);
- ffPrintDesktopEnvironment(&instance);
- ffPrintWM(&instance);
- ffPrintWMTheme(&instance);
- ffPrintTheme(&instance);
- ffPrintIcons(&instance);
- ffPrintFont(&instance);
- ffPrintCursor(&instance);
ffPrintTerminal(&instance);
ffPrintTerminalFont(&instance);
ffPrintCPU(&instance);
While some sections didn't seem to be right.
I have installed
fastfetch
from AUR on WSL2 (ArchLinux) and I'm getting "segmentation fault". Image