Package: lxpanel
Version: 0.9.3-1
X-Debbugs-CC: [email protected], [email protected]
Tags: patch

Starting lxpanel with a VNC session startup script (without any VNC clients 
attached) causes immediate segfault. The core dump yields this backtrace:
===
$ gdb lxpanel lxpanel.core
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
[...]
Reading symbols from /usr/bin/lxpanel...Reading symbols from 
/usr/lib/debug/.build-id/a1/db9ee5a8e58c75b39487f5c17d0a1b7fa233dd.debug...done.
done.
[...]
Core was generated by `lxpanel'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  task_button_window_focus_changed (button=0x7f8a7bf04160, win=0x0) at 
task-button.c:1668
1668    task-button.c: No such file or directory.
[Current thread is 1 (Thread 0x7f8a7b7ff480 (LWP 29089))]
(gdb) bt
#0  task_button_window_focus_changed (button=0x7f8a7bf04160, win=0x0) at 
task-button.c:1668
#1  0x00007f8a7b26ed15 in panel_icon_grid_forall (container=<optimized out>, 
include_internals=<optimized out>, 
    callback=0x7f8a7b6bfc60 <task_button_window_focus_changed>, 
callback_data=0x0) at icon-grid.c:1081
#2  0x00007f8a7b6bbe0d in taskbar_net_active_window (tb=0x7f8a7bf1b7e0, 
widget=<optimized out>) at launchtaskbar.c:2284
#3  0x00007f8a7b6bc403 in taskbar_net_active_window (tb=0x7f8a7bf1b7e0, 
widget=0x0) at launchtaskbar.c:2279
#4  launchtaskbar_constructor_task (ltbp=ltbp@entry=0x7f8a7bf1b7e0) at 
launchtaskbar.c:1059
#5  0x00007f8a7b6bc605 in _launchtaskbar_constructor (panel=0x7f8a7bd84380, 
settings=0x7f8a7bed3640, mode=<optimized out>)
    at launchtaskbar.c:1159
#6  0x00007f8a7b276275 in lxpanel_add_plugin (p=p@entry=0x7f8a7bd84380, 
name=0x7f8a7bed3280 "taskbar", 
    cfg=cfg@entry=0x7f8a7bed3540, at=at@entry=-1) at plugin.c:542
#7  0x00007f8a7b273bc2 in panel_parse_plugin (cfg=0x7f8a7bed3540, 
p=0x7f8a7bd84380) at panel.c:1593
#8  panel_start_gui (panel=panel@entry=0x7f8a7bd84380, 
list=list@entry=0x7f8a7bdbe8c0) at panel.c:1691
#9  0x00007f8a7b2745fb in panel_start (p=0x7f8a7bd84380) at panel.c:1992
#10 panel_new (config_file=<optimized out>, config_name=<optimized out>) at 
panel.c:2014
#11 0x00007f8a7b6b6c1b in _start_panels_from_dir (
    panel_dir=0x7f8a7bd721c0 "~/.config/lxpanel/default/panels") at main.c:415
#12 0x00007f8a7b6b4ae1 in start_all_panels () at main.c:431
#13 main (argc=<optimized out>, argv=<optimized out>, env=0x7ffe45913158) at 
main.c:568
===

Steps to reproduce:
* set up lxpanel to be started by your VNC server startup, e.g. by:
mkdir -p ~/.vnc ~/.config/openbox
cat << EOF > ~/.vnc/xstartup
#!/bin/sh
openbox-session &
EOF
cat << EOF > ~/.config/openbox/autostart
lxpanel &
EOF
chmod u+x ~/.vnc/xstartup ~/.config/openbox/autostart
* start a vncserver:
vncserver

Expected result:
* lxpanel runs on the VNC screen

Encountered result:
* lxpanel segfaults

This segfault will _NOT_ be triggered by starting lxpanel from within an 
attached VNC session.

The attached two-line patch fixes the segfault by checking the "win" argument 
of the "task_button_window_focus_changed" function.
I am neither sure about the correct return value nor about the correct 
approach, however, this patch works for me.

Yours,
Sebastian

Attachment: catch-win-nullptr.diff
Description: Binary data

Reply via email to