Airblader / i3

A fork of the i3 window manager with gaps and some other features. :warning: i3-gaps has been merged into i3.
BSD 3-Clause "New" or "Revised" License
5.88k stars 321 forks source link

Segmentation fault at startup in `con_force_split_parents_redraw` #412

Closed CyberShadow closed 3 years ago

CyberShadow commented 3 years ago

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

Crash on startup.

Expected Behavior

No crash.

Reproduction Instructions

At the moment, unknown. Hopefully the stack trace will help.

Environment

Output of i3 --moreversion 2>&-:

Binary i3 version:  4.19.1-168-g7f06a319 © 2009 Michael Stapelberg and contributors

(Built from 7f06a31937bdc60185e6ffbd1af3cffa67c10706, current gaps-next)

(Config file doesn't seem relevant here)

Output:

2021-09-13 14:19:35 - CORE DUMPS: You are running a development version of i3, so coredumps were automatically enabled (ulimit -c unlimited).
2021-09-13 14:19:35 - CORE DUMPS: Your current working directory is "/home/vladimir/work/extern/i3/build".
2021-09-13 14:19:35 - CORE DUMPS: Your core_pattern is: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
2021-09-13 14:19:35 - i3 4.19.1-168-g7f06a319 starting
2021-09-13 14:19:35 - Parsing configfile /home/vladimir/.i3/config
2021-09-13 14:19:35 - Changing working directory to config file directory /home/vladimir/.i3
2021-09-13 14:19:35 - deciding for version 4 due to this line: # i3 config file (v4)
2021-09-13 14:19:35 - [libi3] ../libi3/font.c Using X font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
2021-09-13 14:19:35 - ERROR: CONFIG: Expected one of these tokens: , '#', 'set ', 'set ', 'set_from_resource', 'include', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'default_border', 'new_window', 'default_floating_border', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'no_focus', 'focus_follows_mouse', 'mouse_warping', 'focus_wrapping', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'disable_randr15', 'disable-randr15', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'focus_on_window_activation', 'title_align', 'show_marks', 'workspace', 'ipc_socket', 'ipc-socket', 'ipc_kill_timeout', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
2021-09-13 14:19:35 - ERROR: CONFIG: (in file /home/vladimir/.i3/config)
2021-09-13 14:19:35 - ERROR: CONFIG: Line  53: 
2021-09-13 14:19:35 - ERROR: CONFIG: Line  54: # Gaps
2021-09-13 14:19:35 - ERROR: CONFIG: Line  55: gaps inner 10
2021-09-13 14:19:35 - ERROR: CONFIG:           ^^^^^^^^^^^^^
2021-09-13 14:19:35 - ERROR: CONFIG: Line  56: for_window [class="^.*"] border pixel 2
2021-09-13 14:19:35 - ERROR: CONFIG: Line  57: 
2021-09-13 14:19:35 - ERROR: FYI: You are using i3 version 4.19.1-168-g7f06a319
button with label *edit config* and action *i3-sensible-editor "/home/vladimir/.i3/config" && i3-msg reload
*
now 1 buttons
button with label *show errors* and action *i3-sensible-pager "/run/user/1000/i3/errorlog.147444"
*
now 2 buttons
[libi3] ../i3/libi3/font.c Using X font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
[libi3] ../i3/i3-nagbar/main.c Failed to received window geometry.
[libi3] ../i3/i3-nagbar/main.c Could not position on focused output, trying to position on primary output.
[libi3] ../i3/i3-nagbar/main.c Found primary output on position x = 1200 / y = 0 / w = 1920 / h = 2160.
2021-09-13 14:19:35 - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
2021-09-13 14:19:35 - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
2021-09-13 14:19:35 - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
2021-09-13 14:19:35 - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
2021-09-13 14:19:35 - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
2021-09-13 14:19:35 - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
2021-09-13 14:19:35 - [libi3] ERROR: Could not create graphical context. Error code: 9. Please report this bug.
[1]    147444 segmentation fault (core dumped)  ./i3 -V

Stack trace:

Program received signal SIGSEGV, Segmentation fault.
0x0000555555580f85 in con_force_split_parents_redraw (con=0x55555564edb0) at ../src/con.c:24
24      while (parent != NULL && parent->type != CT_WORKSPACE && parent->type != CT_DOCKAREA) {
(gdb) where
#0  0x0000555555580f85 in con_force_split_parents_redraw (con=0x55555564edb0) at ../src/con.c:24
#1  0x0000555555581a88 in _con_attach (con=0x55555564edb0, parent=0x55555564d1b0, previous=0x0, ignore_focus=false) at ../src/con.c:209
#2  0x0000555555581abb in con_attach (con=0x55555564edb0, parent=0x55555564d1b0, ignore_focus=false) at ../src/con.c:223
#3  0x00005555555b0d74 in output_init_con (output=0x55555564cf20) at ../src/randr.c:400
#4  0x00005555555b2bfd in randr_query_outputs () at ../src/randr.c:969
#5  0x00005555555b313f in randr_init (event_base=0x5555555f291c <randr_base>, disable_randr15=false) at ../src/randr.c:1093
#6  0x00005555555a96b3 in main (argc=1, argv=0x7fffffffe098) at ../src/main.c:939
- Linux Distribution & Version: Arch Linux 2021-09-11
- Are you using a compositor (e.g., xcompmgr or compton): Reproduces without compositor

Does not happen with current vanilla/next (a0938bd6).

I'll try bisecting.

Airblader commented 3 years ago

Thanks for the great issue report, and thank you for bisecting it already!

Airblader commented 3 years ago

The log excerpt you attached shows a bunch of errors prior to the segfault, in particular also that it doesn't know about gaps. Do you know what all of that might be about?

CyberShadow commented 3 years ago

Well spotted. Especially this line looked very wrong:

2021-09-13 14:35:05 - ERROR: FYI: You are using i3 version 4.16-813-ga0938bd6

That's the wrong revision. I retested this several times, ensuring the directory was completely clean.

Finally I found the culprit - meson was finding and automatically using ccache, which somehow was providing outdated object files. Uninstalling ccache and rebuilding made the segfault go away.

Airblader commented 3 years ago

Thanks anyway, I appreciate you taking the time to look into this!