Closed reagentoo closed 2 years ago
What are the command line arguments passed to ddcui? Is there a ddcutilrc configuration file - if so, please post its contents.
What version of glib are you using?
What are the command line arguments passed to ddcui?
Just ddcui.
Is there a ddcutilrc configuration file - if so, please post its contents.
No any custom config files.
What version of glib are you using?
dev-libs/glib-2.70.2
// May be the problem is in missing i2c group for user.
It looks like the segfault occurs after glib function g_option_parse_strv() fails without setting an error message. The reason I asked about your glib version is that the argument requirements for this function were relaxed as of glib 2.62.
Your command line arguments are trivial, and I can't reproduce the failure here. It's as if some software components are out of sync. What version of libddcutil are you running?
Are you able to build ddcui from the source here on GitHub? The latest 0.2.1-dev branch contains enhanced build and trace options, and also a workaround for the segfault, though I suspect that will only move the locus of the failure.
To build ddcui, use the command:
cmake --S <your source directory> -B <your build directory> -DCMAKE_BUILD_TYPE=Debug
When running ddcui, setting environment variable DDCUTIL_DEBUG_PARSE=1 enables debug code in the parser,
e.g. DDCUTIL_DEBUG_PARSE=1 <directory path>/ddcui
or even better: DDCUTIL_DEBUG_PARSE=1 valgrind <directory path>/ddcui
And of course, submit relevant output as attachments of some sort. Thank you.
What version of libddcutil are you running?
app-misc/ddcutil-1.2.1
When running ddcui, setting environment variable DDCUTIL_DEBUG_PARSE=1 enables debug code in the parser, e.g. DDCUTIL_DEBUG_PARSE=1
/ddcui or even better: DDCUTIL_DEBUG_PARSE=1 valgrind/ddcui
Currently run w/o sigsegv. Please see attached log:
@rockowitz Is there any other info needed?
I've just fixed a segfault in the tracing code of API function ddca_display_refs(), but you apparently haven't enabled libddcutil tracing that wouldn't apply to you.
What I need is output that pinpoints the locus of error. The dgb output does not do the trick. Please build libddcutil from the 1.2.2-dev branch. Do not optimize out debug information. Also build ddcui with debug information, using the cmake command above. Then run
DDCUTIL_DEBUG_PARSE=1 valgrind <directory path>/ddcui --trace all
The output will be insanely voluminous, but valgrind along with ddcutil tracing should be able to identify the location of the failure.
I have installed gentoo derivative Calculate Linux, and built ddcutil and ddcui. It appears that the segfault you are seeing is a mismatch between libddcutil and ddcui.
If I install ddcutil using emerge, the source version obtained from app-misc/dccutil is 0.9.9. This is ancient, and a segfault is to be expected if its libddcutil is used by any recent version of ddcui. If I explicitly request version 1.2.1, emerge fails with an error message indicating a problem with the repository configuration. I'll leave it to you to resolve this problem.
The mismatch was not caught at ddcui build time because of a bug in CMakeLists.txt. The build configuration file had not been updated to require at least ddcutil 1.2.0. This has been fixed in the current ddcui development branch, 0.2.1-dev, which requires the current ddcutil devlopment branch 1.2.2 -dev.
If I install ddcutil using emerge, the source version obtained from app-misc/dccutil is 0.9.9. This is ancient, and a segfault is to be expected if its libddcutil is used by any recent version of ddcui. If I explicitly request version 1.2.1, emerge fails with an error message indicating a problem with the repository configuration. I'll leave it to you to resolve this problem.
app-misc/ddcui-0.1.2-r1
explicitly depends on >=app-misc/ddcutil-0.9.9:0/3
(that is slot 0, subslot 3), app-misc/ddcui-0.2.0
on the other hand depends on >=app-misc/ddcutil-1.2.0:0/4
(slot 0, subslot 4). This means that ddcui-0.1.2 will pull in ddcutil-0.9.9 (the version which has subslot 3), this combination works. Ddcui-0.2.0, will pull in ddcutil-1.2.1 (the version which has subslot 4), this combination results in the segfault. Installing ddcui-0.2.0 with ddcutil-0.9.9 is explicitly prohibited by the package manager, this is on purpose because it will result in compile failure.
The 'error message' you're seeing is intentional. It indicates that app-misc/ddcui-0.2.0
is not keyworded for your architecture. I specifically omitted the keywords on ddcui-0.2.0 because of this segfault problem, I don't want users upgrading to this version until we have fixed the problem. Unfortunately, the side effect is that ddcutil-0.9.9 is pulled in, which is indeed ancient.
In short, the repository is the way it is because of this issue, it is not the cause of it. I'll see about getting you a proper backtrace later today.
I'll see about getting you a proper backtrace later today.
Here's the output of DDCUTIL_DEBUG_PARSE=1 valgrind --leak-check=full --show-leak-kinds=all --log-file=/tmp/log ddcui --trace=all
: log.txt
And here's the output of gdb:
Reading symbols from ddcui...
Reading symbols from /usr/lib/debug//usr/bin/ddcui.debug...
[New LWP 28108]
[New LWP 28114]
[New LWP 28115]
[New LWP 28109]
[New LWP 28116]
[New LWP 28118]
[New LWP 28110]
[New LWP 28117]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
--Type <RET> for more, q to quit, c to continue without paging--c
Core was generated by `ddcui --trace=all'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055578492c53f in fprintf (__fmt=0x555784958c60 "ddcui option parsing failed: %s\n", __stream=<optimized out>) at /usr/include/bits/stdio2.h:105
warning: Source file is more recent than executable.
105 return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
[Current thread is 1 (Thread 0x7f850801e780 (LWP 28108))]
The following packages have been compiled with debug flags and symbols:
app-misc/ddcutil debug
app-misc/ddcui debug
sys-libs/glibc debug
dev-qt/qtcore debug
dev-qt/qtgui debug
dev-qt/qtdbus debug
dev-qt/qtdeclarative debug
dev-libs/glib debug
kde-plasma/breeze debug
media-libs/libglvnd debug
kde-frameworks/kconfig debug
sys-apps/dbus debug
kde-frameworks/kio debug
sys-fs/udev debug
x11-libs/libX11 debug
kde-plasma/plasma-integration debug
kde-frameworks/kbookmarks debug
kde-frameworks/kitemviews debug
kde-frameworks/kdbusaddons debug
kde-frameworks/kcoreaddons debug
kde-frameworks/kwidgetsaddons debug
kde-frameworks/kcompletion debug
kde-frameworks/kjobwidgets debug
kde-frameworks/kglobalaccel debug
kde-frameworks/kguiaddons debug
kde-frameworks/kxmlgui debug
kde-frameworks/kwindowsystem debug
kde-frameworks/knotifications debug
kde-frameworks/kiconthemes debug
kde-frameworks/kcodecs debug
kde-frameworks/kitemviews debug
kde-frameworks/ki18n debug
media-libs/phonon debug
kde-frameworks/kauth debug
kde-frameworks/kconfigwidgets debug
x11-libs/libxcb debug
kde-frameworks/kdbusaddons debug
kde-frameworks/solid debug
kde-frameworks/kcrash debug
kde-frameworks/frameworkintegration debug
dev-qt/qtquickcontrols2 debug
dev-qt/qtquickcontrols debug
dev-qt/qtwayland debug
dev-qt/qtwidgets debug
x11-libs/libxkbcommon debug
kde-frameworks/kservice debug
dev-qt/qtprintsupport debug
kde-frameworks/kwayland debug
The segfault reported has been fixed in ddcui branch 0.2.1-dev. A similar fix has been applied in ddcutil branch 1.2.2-dev. The fixes allow for the possibility that glib function g_option_context_parse_strv() fails without setting an error message. That g_option_context_parse_strv() fails in this way is pathological, suggesting that the fixes will only move the locus of failure. Since both ddcutil and ddcui build and execute successfully on my copy of Calculate Linux, I continue to suspect a configuration problem of some sort.
Ddcui version 0.2.1 with ddcutil version 1.2.2 works flawlessly, no more segfaults :+1:
I think we can close this issue
My config: Linux Gentoo ~amd64 Gnome 41 + wayland
Please see backtrace:
GDB backtrace
``` $ gdb ddcui GNU gdb (Gentoo 11.1 vanilla) 11.1 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later