! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-terminal crashes if DISPLAY is unset and there is dbus and wayland
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Urja 2017-12-17 03:18:55 CET
Setting DISPLAY to anything at all gets around it (eg. even "foobar" ... or "wayland-0").

I guess it has something to do with the dbus call attempt or registration since --disable-server also gets around it.
Comment 1 Igor editbugs 2017-12-17 04:11:20 CET
Thanks for the report!
Is there any way you could provide me with a stack trace? I have no Wayland machine around, unfortunately.
Comment 2 Urja 2017-12-17 09:27:13 CET
Yes, I was being lazy and didnt bother to figure out building it (and the default stack trace was pretty useless)... anyhows:

(gdb) bt
#0  0xb616b5fc in malloc_printerr () at /usr/lib/libc.so.6
#1  0xb616d210 in _int_free () at /usr/lib/libc.so.6
#2  0x0040e564 in terminal_gdbus_invoke_launch (argc=<optimized out>, argv=<optimized out>, error=0xbefffabc) at terminal-gdbus.c:240
#3  0x0040b774 in main (argc=<optimized out>, argv=<optimized out>) at main.c:260

And i think i actually figured it out, terminal-gdbus.c:240 is g_free (display_name);
and display_name is terminal_gdbus_display_name() which does:
  display_name = g_getenv ("DISPLAY");
  if (G_UNLIKELY (display_name == NULL))
    return "";
so you try to free() a not-allocated pointer.
I tested changing the return line to display_name = ""; and that fixes it (since you strdup() display_name in the function).
Comment 3 Git Bot editbugs 2017-12-18 02:41:58 CET
Igor referenced this bugreport in commit fa0c839722244e88ae0db3bcd40a3af7b4768bee

Fix handling empty $DISPLAY env var

https://git.xfce.org/apps/xfce4-terminal/commit?id=fa0c839722244e88ae0db3bcd40a3af7b4768bee
Comment 4 Igor editbugs 2017-12-18 02:42:38 CET
Fixed, thank you!

Bug #14092

Reported by:
Urja
Reported on: 2017-12-17
Last modified on: 2017-12-18

People

CC List:
0 users

Version

Attachments

Additional information