Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xiccd[3214]: segfault at e4 ip 00005638ed3fd9a2 #40

Open
Am0rphous opened this issue Feb 10, 2024 · 5 comments
Open

xiccd[3214]: segfault at e4 ip 00005638ed3fd9a2 #40

Am0rphous opened this issue Feb 10, 2024 · 5 comments

Comments

@Am0rphous
Copy link

Am0rphous commented Feb 10, 2024

Hi!
On Kali Linux i receive following error message. I don't know if every line is helpful. Running sudo dmesg gives

[   14.117639] systemd-journald[698]: /var/log/journal/d8dc8904695644168112634a06d6df4c/user-1000.journal: Journal file uses a different sequence number ID, rotating.
[   15.945916] panel-16-pulsea[2914]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set
[   16.397949] show_signal_msg: 8 callbacks suppressed
[   16.397952] xiccd[3214]: segfault at e4 ip 00005638ed3fd9a2 sp 00007ffe738ad830 error 4 in xiccd[5638ed3fa000+4000] likely on CPU 7 (core 1, socket 0)
[   16.397962] Code: bd 01 00 00 00 eb 91 90 48 89 df e8 d8 f8 ff ff eb c5 e8 11 cd ff ff 90 55 48 89 fd 53 48 83 ec 08 e8 c2 f8 ff ff 48 8b 7d 08 <8b> 97 e4 00 00 00 85 d2 7e 30 31 db 66 90 48 89 d8 ba 07 00 00 00

System (fully up to date)

  • xiccd - 0.3.0+git
  • Kali Linux Rolling (2023.4)
  • Kernel: 6.6.9-amd64
@agalakhov
Copy link
Owner

Can you please compile xiccd with debug and get a stack trace?

@Am0rphous
Copy link
Author

I tried earlier to download and compile the source code but met many obstacles and left it for a while.

I've now successfully compiled the code with debug symbols, but it's not very helpful, or I'm doing things wrong. I thought dmesg would show more helpful info, but it doesn't.

To compile xiccd i did following:

apt-get source xiccd
./configure --enable-debug
make
sudo make install
cp xiccd $(which xiccd)      #same as cp xiccd /usr/local/bin/xicc

The file /etc/xdg/autostart/xiccd.desktop seems to be a file for auto startin the app, but wasnt very helpful.

I received the error a while, eventhough the service seemed to run though.

[   24.049222] xiccd[3365]: segfault at e4 ip 000056025b905891 sp 00007ffe44c3d720 error 4 in xiccd[56025b901000+5000] likely on CPU 10 (core 4, socket 0)
[   24.049230] Code: 45 e8 48 8b 45 d8 48 8b 40 08 48 8b 4d e8 ba 07 00 00 00 48 89 ce 48 89 c7 e8 3b bb ff ff 83 45 fc 01 48 8b 45 d8 48 8b 40 08 <8b> 80 e4 00 00 00 39 45 fc 7c a9 48 8b 45 d8 48 89 c7 e8 01 ff ff

Lately I havent got the error, but I changed from Gnome to XFCE.

sudo dmesg doesn't seem to contain the error anymore.

@Am0rphous
Copy link
Author

It seems the bug still persistent when running journalctl|grep xiccd

Jun 02 15:03:20 carbon dbus-daemon[1252]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service' requested by ':1.27' (uid=1000 pid=3646 comm="xiccd")
Jun 02 15:03:20 carbon kernel: xiccd[3646]: segfault at e4 ip 00005634a4510891 sp 00007ffed51a1d30 error 4 in xiccd[5634a450c000+5000] likely on CPU 7 (core 1, socket 0)
Jun 02 15:03:21 carbon systemd-coredump[3742]: Process 3646 (xiccd) of user 1000 dumped core.
                                               #0  0x00005634a4510891 setup_events (xiccd + 0x8891)
                                               #1  0x00005634a45108f0 randr_conn_private_start (xiccd + 0x88f0)
                                               #2  0x00005634a450fb24 randr_conn_start (xiccd + 0x7b24)
                                               #3  0x00005634a450e554 cd_connect_cb (xiccd + 0x6554)
                                               #21 0x00005634a450e6e5 main (xiccd + 0x66e5)
                                               #24 0x00005634a450ca91 _start (xiccd + 0x4a91)
Jun 02 15:04:49 carbon dbus-daemon[1084]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service' requested by ':1.23' (uid=1000 pid=3282 comm="xiccd")
Jun 02 15:04:49 carbon systemd-coredump[3474]: Process 3282 (xiccd) of user 1000 dumped core.
                                               #0  0x000055a3215d1891 setup_events (xiccd + 0x8891)
                                               #1  0x000055a3215d18f0 randr_conn_private_start (xiccd + 0x88f0)
                                               #2  0x000055a3215d0b24 randr_conn_start (xiccd + 0x7b24)
                                               #3  0x000055a3215cf554 cd_connect_cb (xiccd + 0x6554)
                                               #21 0x000055a3215cf6e5 main (xiccd + 0x66e5)
                                               #24 0x000055a3215cda91 _start (xiccd + 0x4a91)
Jun 02 15:08:22 carbon dbus-daemon[11070]: [session uid=0 pid=11068] Activating service name='org.freedesktop.portal.Desktop' requested by ':1.0' (uid=0 pid=11063 comm="gedit /etc/xdg/autostart/xiccd.desktop")
Jun 02 15:09:05 carbon dbus-daemon[11070]: [session uid=0 pid=11068] Activating service name='ca.desrt.dconf' requested by ':1.0' (uid=0 pid=11063 comm="gedit /etc/xdg/autostart/xiccd.desktop")

@Spinlocker
Copy link

Below is a copy of what I just wrote in this page of Launchpad bugtracker, and this seems related to what Am0rphous reports above.

[BOF]
Same for me with Xtightvnc server under Xubuntu jammy.

I recompiled xiccd in debug version and could track the crash I experienced down to (inline) function setup_events(), where member dpy of argument conn was null :

(gdb) bt
#0  0x00005650eb1cc6cf in setup_events (conn=0x565116b89400) at src/randr-conn-private.c:358
#1  0x00005650eb1cc732 in randr_conn_private_start (conn=0x565116b89400) at src/randr-conn-private.c:374
#2  0x00005650eb1cb82b in randr_conn_start (conn=0x565116b89430) at src/randr-conn.c:111
#3  0x00005650eb1ca162 in cd_connect_cb (src=0x565116b8a420, res=0x565116b8e820, user_data=0x7ffe19846ba0) at src/xiccd.c:577
#4  0x00007f38de68be39 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x00007f38de68c05b in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#6  0x00007f38de7c7729 in  () at /lib/x86_64-linux-gnu/libcolord.so.2
#7  0x00007f38de68be39 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#8  0x00007f38de68c05b in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#9  0x00007f38de6f563d in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#10 0x00007f38de68be39 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#11 0x00007f38de68c05b in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#12 0x00007f38de6f7518 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#13 0x00007f38de68be39 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#14 0x00007f38de68c05b in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#15 0x00007f38de6ed73f in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#16 0x00007f38de68be39 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#17 0x00007f38de68be7d in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#18 0x00007f38de9a8c44 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007f38de9fe2b8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f38de9a82b3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00005650eb1ca31a in main (argc=1, argv=0x7ffe19846ce8) at src/xiccd.c:617
(gdb) print conn
$1 = (struct randr_conn *) 0x565116b89400
(gdb) print conn->dpy
$2 = (Display *) 0x0
(gdb) 

Function setup_events() has the following code:

static inline void
setup_events (struct randr_conn *conn)
{
	int s;
	for (s = 0; s < ScreenCount (conn->dpy); ++s) {
		Window w = RootWindow (conn->dpy, s);
		XRRSelectInput (conn->dpy, w,
				RRScreenChangeNotifyMask |
				RRCrtcChangeNotifyMask |
				RROutputChangeNotifyMask);
	}
	GSource *src = randr_source_new (conn);
	g_source_attach (src, NULL);
	g_source_unref (src);
}

Macro ScreenCount() is defined as follows in /usr/include/X11/Xlib.h:

#define ScreenCount(dpy) (((_XPrivDisplay)(dpy))->nscreens)

Therefore, using ScreenCount (conn->dpy) results in a null-pointer dereferencing.

Now for the cause: AFAICS, it seems that despite xiccd is already running on the target system, a new instance of xiccd is launched everytime VNC server is killed/restarted, and this new instance is the one which crashes. This may result from the custom version of $HOME/.vnc/Xstartup which is necessary to run Xtightvnc server on Xubuntu. Mine is as follows:

#!/bin/sh

#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

# Fix to make GNOME and GTK stuff work
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

# exec /etc/X11/xinit/xinitrc
xrdb $HOME/.Xresources
xsetroot -solid grey

xfce4-session &

# before Ubuntu 18.04:
# gnome-settings-daemon &

# Ubuntu 18.04 and later:
/usr/lib/gnome-settings-daemon/gsd-xsettings &

Hope everything above makes sense, last time I performed some debugging is a long time ago...
[EOF]

@agalakhov
Copy link
Owner

Thank you! Will look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants