Skip to content

AddressSanitizer fires upon launching leading to SEGV #544

@RainerKuemmerle

Description

@RainerKuemmerle

General description of bug:

  • What happened:
    • SEGV in 2.0.4
  • What should happen:
    • Expected behavior
  • Did it work in an older version:
    • 1.12.2 works fine
    • Starting from tag 2.0.0, I see the segfaults. I did not check in detail if different causes.
  • Where did you get the binary:
    • built myself on Ubuntu 23.04
  • Does this issue still occurs in the latest dev build?
    • Yes, c400866 shows the same behavior for me

Often helpful information:

The content of the configuration file you use (if any)

  • Using, for example, presets/all triggers the problem

Output of env NO_CONFIG=1 fastfetch --load-config all --show-errors --stat --multithreading false --disable-linewrap false --hide-cursor false:

==6522==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd5bc62df99 bp 0x7fd5b59fb1a0 sp 0x7fd5b83fd760 T2)
==6522==The signal is caused by a WRITE memory access.
==6522==Hint: address points to the zero page. 
    #0 0x7fd5bc62df99 in XRRGetOutputProperty (/lib/x86_64-linux-gnu/libXrandr.so+0x6f99) (BuildId: b566cc3096f78d3ad5469b0ac5a77bcbfcd0306b)
    #1 0x5651f391f59f in xrandrHandleOutput /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:212
    #2 0x5651f391fc40 in xrandrHandleMonitor /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:235
    #3 0x5651f39205b2 in xrandrHandleMonitors /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:265
    #4 0x5651f3921325 in xrandrHandleScreen /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:310
    #5 0x5651f39225d3 in ffdsConnectXrandr /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:371
    #6 0x5651f3913214 in ffConnectDisplayServerImpl /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/displayserver_linux.c:105
    #7 0x5651f3849e5f in ffConnectDisplayServer /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/displayserver.c:39
    #8 0x5651f393e17e in ffDetectQt /home/goki/workspace/dotfiles/git/fastfetch/src/detection/gtk_qt/qt.c:157
    #9 0x5651f3829be7 in ffDetectQtThreadMain /home/goki/workspace/dotfiles/git/fastfetch/src/common/init.c:182
    #10 0x7fd5bc48f189 in start_thread nptl/pthread_create.c:444
    #11 0x7fd5bc51dbcf in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libXrandr.so+0x6f99) (BuildId: b566cc3096f78d3ad5469b0ac5a77bcbfcd0306b) in XRRGetOutputProperty
Thread T2 created by T0 here:
    #0 0x7fd5bd049185 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:208
    #1 0x5651f3829292 in ffThreadCreate /home/goki/workspace/dotfiles/git/fastfetch/src/common/thread.h:34
    #2 0x5651f3829c62 in startDetectionThreads /home/goki/workspace/dotfiles/git/fastfetch/src/common/init.c:190
    #3 0x5651f3829f98 in ffStart /home/goki/workspace/dotfiles/git/fastfetch/src/common/init.c:234
    #4 0x5651f381e2ff in main /home/goki/workspace/dotfiles/git/fastfetch/src/fastfetch.c:1296
    #5 0x7fd5bc423a8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Output of fastfetch --list-features:

$ ./fastfetch --list-features               
threads
vulkan
xcb
xrandr
x11
gio
imagemagick6
chafa
zlib
egl
glx

If fastfatch crashed

Paste the stacktrace here. You may get it with:

$ gdb /path/to/fastfetch
$ run
$ bt
#0  0x00007ffff6e1af99 in XRRGetOutputProperty () from /lib/x86_64-linux-gnu/libXrandr.so
#1  0x0000555555b555a0 in xrandrHandleOutput (data=0x7ffff13fd080, output=82, name=0x7ffff10fd0e0, primary=true) at /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:212
#2  0x0000555555b55c41 in xrandrHandleMonitor (data=0x7ffff13fd080, monitorInfo=0x606000003380) at /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:235
#3  0x0000555555b565b3 in xrandrHandleMonitors (data=0x7ffff13fd080, screen=0x60c000006400) at /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:265
#4  0x0000555555b57326 in xrandrHandleScreen (data=0x7ffff13fd080, screen=0x60c000006400) at /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:310
#5  0x0000555555b585d4 in ffdsConnectXrandr (result=0x555556504d80 <result>) at /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/xlib.c:371
#6  0x0000555555b49215 in ffConnectDisplayServerImpl (ds=0x555556504d80 <result>) at /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/linux/displayserver_linux.c:105
#7  0x0000555555a7fe60 in ffConnectDisplayServer () at /home/goki/workspace/dotfiles/git/fastfetch/src/detection/displayserver/displayserver.c:39
#8  0x0000555555a5fbd4 in ffConnectDisplayServerThreadMain () at /home/goki/workspace/dotfiles/git/fastfetch/src/common/init.c:181
#9  0x00007ffff6c8f18a in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:444
#10 0x00007ffff6d1dbd0 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Let me know how to provide more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions