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

i3 crashes when starting a horizontal/vertical split container inside a tabbed window #3896

Closed
sgrubsmyon opened this issue Jan 8, 2020 · 15 comments

Comments

@sgrubsmyon
Copy link

I'm submitting a…

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

Current Behavior

When pressing $mod+H (starting a horizontal split container) inside a tabbed container, i3 crashes.

Expected Behavior

A horizontal split container should be created, allowing to arrange several windows side-by-side inside one tab.

Reproduction Instructions

Enter an empty workspace. Open two terminals (pressing $mod+Enter twice). Switch to tabbed mode ($mod+W). With one of the two terminals focused, press $mod+H.

Note: Also starting a vertical split container (pressing $mod+V) causes a crash.

Environment

Output of i3 --moreversion 2>&-:

Binary i3 version:  4.17.1 (2019-08-30) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.17.1 (2019-08-30) (pid 6620)abort…)
Loaded i3 config: /home/mvoge/.config/i3/config (Last modified: Mi 08 Jan 2020 12:15:52 CET, 4071 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3-with-/i3

Config file:

set $mod Mod4
floating_modifier $mod
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+comma exec rofi -show window
bindsym $mod+period exec rofi -show run
bindsym $mod+slash exec rofi -show ssh
bindsym $mod+d exec --no-startup-id "rofi -show drun -font \\"DejaVu 8\\" -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+J move left
bindsym $mod+Shift+K move down
bindsym $mod+Shift+L move up
bindsym $mod+Shift+colon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+h split h
bindsym $mod+v split v
bindsym $mod+f fullscreen
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout default
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
bindsym $mod+1 workspace "1: inet"
bindsym $mod+2 workspace "2: R"
bindsym $mod+3 workspace "3: netlogo"
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym $mod+Shift+exclam move workspace "1: inet"
bindsym $mod+Shift+at move workspace "2: R"
bindsym $mod+Shift+numbersign move workspace "3: netlogo"
bindsym $mod+Shift+dollar move workspace 4
bindsym $mod+Shift+percent move workspace 5
bindsym $mod+Shift+asciicircum move workspace 6
bindsym $mod+Shift+ampersand move workspace 7
bindsym $mod+Shift+asterisk move workspace 8
bindsym $mod+Shift+parenleft move workspace 9
bindsym $mod+Shift+parenright move workspace 10
bindsym $mod+Shift+C reload
bindsym $mod+Shift+R restart
bindsym Control+space exec /home/mvoge/.config/i3/toggle_keyboard_layout.sh
bar {
  status_command i3status
  font pango:DejaVu Sans Mono 12
  colors {
    background #333333
    statusline #dddddd
  }
}
font pango:DejaVu Sans Mono 10
new_window normal 5
assign [instance="desktop_window"] "1: inet"
assign [class="Thunderbird"] "1: inet"
assign [class="com-leclercb-taskunifier-gui-main-Main"] 10
assign [class="Hamster-time-tracker"] 10
mode "resize" {
        bindsym Right       resize shrink left 10 px or 10 ppt
        bindsym Left        resize grow   left 10 px or 10 ppt
        bindsym Down        resize shrink up 10 px or 10 ppt
        bindsym Up          resize grow   up 10 px or 10 ppt
        bindsym Shift+Up    resize shrink down 10 px or 10 ppt
        bindsym Shift+Down  resize grow   down 10 px or 10 ppt
        bindsym Shift+Left  resize shrink right 10 px or 10 ppt
        bindsym Shift+Right resize grow   right 10 px or 10 ppt
        bindsym Return mode "default"
        bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bindsym $mod+Prior workspace prev
bindsym $mod+Next workspace next
bindsym Mod1+F4 kill
set $exit_mode Press: (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (d) shutdown
mode "$exit_mode" {
  bindsym l exec --no-startup-id ~/.config/i3/i3exit lock, mode "default"
  bindsym e exec --no-startup-id ~/.config/i3/i3exit logout, mode "default"
  bindsym s exec --no-startup-id ~/.config/i3/i3exit suspend, mode "default"
  bindsym h exec --no-startup-id ~/.config/i3/i3exit hibernate, mode "default"
  bindsym r exec --no-startup-id ~/.config/i3/i3exit reboot, mode "default"
  bindsym d exec --no-startup-id ~/.config/i3/i3exit shutdown, mode "default"
  bindsym Return mode "default"
  bindsym Escape mode "default"
}
bindsym $mod+Q mode "$exit_mode"
bindsym Control+Mod1+L exec i3lock -c 000000
bindsym $mod+C exec xfce4-terminal -e "R"
bindsym $mod+G exec xfce4-settings-manager
bindsym $mod+N exec thunar
bindsym $mod+P exec pavucontrol
exec xfce4-power-manager
exec thunar --daemon
exec --no-startup-id nm-applet &
exec firefox
exec --no-startup-id redshift-gtk &
exec udiskie
exec --no-startup-id picom
floating_minimum_size 75 x 50
floating_maximum_size -1 x -1
for_window [instance="desktop_window"] floating disable
for_window [window_role="pop-up"] floating enable
for_window [instance="gajim"] floating enable
for_window [instance="Pidgin"] floating enable
for_window [instance="skype"] floating enable
for_window [class="Tk"] floating enable
for_window [class=" "] floating enable
for_window [instance="file_progress"] floating enable
for_window [class="Audacious"] floating enable

Crash also happened with this reduced config file:

set $mod Mod4
floating_modifier $mod
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+comma exec rofi -show window
bindsym $mod+period exec rofi -show run
bindsym $mod+slash exec rofi -show ssh
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+J move left
bindsym $mod+Shift+K move down
bindsym $mod+Shift+L move up
bindsym $mod+Shift+colon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+h split h
bindsym $mod+v split v
bindsym $mod+f fullscreen
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout default
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym $mod+Shift+exclam move workspace 1
bindsym $mod+Shift+at move workspace 2
bindsym $mod+Shift+numbersign move workspace 3
bindsym $mod+Shift+dollar move workspace 4
bindsym $mod+Shift+percent move workspace 5
bindsym $mod+Shift+asciicircum move workspace 6
bindsym $mod+Shift+ampersand move workspace 7
bindsym $mod+Shift+asterisk move workspace 8
bindsym $mod+Shift+parenleft move workspace 9
bindsym $mod+Shift+parenright move workspace 10
bindsym $mod+Shift+C reload
bindsym $mod+Shift+R restart
bindsym Control+space exec /home/mvoge/.config/i3/toggle_keyboard_layout.sh
bar {
  status_command i3status
}
mode "resize" {
        bindsym Right       resize shrink left 10 px or 10 ppt
        bindsym Left        resize grow   left 10 px or 10 ppt
        bindsym Down        resize shrink up 10 px or 10 ppt
        bindsym Up          resize grow   up 10 px or 10 ppt
        bindsym Shift+Up    resize shrink down 10 px or 10 ppt
        bindsym Shift+Down  resize grow   down 10 px or 10 ppt
        bindsym Shift+Left  resize shrink right 10 px or 10 ppt
        bindsym Shift+Right resize grow   right 10 px or 10 ppt
        bindsym Return mode "default"
        bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bindsym $mod+Prior workspace prev
bindsym $mod+Next workspace next
bindsym Mod1+F4 kill

Logfile:

Logfile URL: https://logs.i3wm.org/logs/5680176314712064.bz2

Explanation of log:

Restarted i3 at 13:38:00.

Opened two terminals at 13:38:10.

Switched to tabbed mode (pressing $mod+W) at 13:38:20.

Started new horizontal container in one of the two tabs (pressing $mod+H) at
13:38:30.

i3 crashed.

Distribution:

- Linux Distribution & Version: Manjaro 18.1.5 Juhraya
- Are you using a compositor (e.g., xcompmgr or compton): picom (same crash happens also without starting picom)

Related issues

Might be related to issue #3554.

@Airblader
Copy link
Member

Thanks for the detailed information and the report! I cannot reproduce this locally with my i3. Would you be able to pull a backtrace of the crash? This is also explained here if you need some guidance: https://i3wm.org/docs/debugging.html

@sgrubsmyon
Copy link
Author

Unfortunately, there does not appear to be a backtrace:

[mvoge@vb-manjaro tmp]$ cat /tmp/i3-backtrace.847.0.txt 
No stack.

Even though i3 is started in debugging mode and gdb is installed.

@sgrubsmyon
Copy link
Author

If it helps: I'm not using the original i3-wm v4.17.1 code, but this patched version: https://aur.archlinux.org/packages/i3-wm-iconpatch.

This appears to be the applied patch: https://aur.archlinux.org/cgit/aur.git/tree/iconsupport.patch?h=i3-wm-iconpatch.

@Airblader
Copy link
Member

Do you have the debug symbols compiled/installed? Also, can you reproduce this with vanilla i3?

@sgrubsmyon
Copy link
Author

Re: "Debug symbols": Yes, "not stripped":

[mvoge@vb-manjaro ~]$ file `which i3`
/usr/bin/i3: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=b80ad6483826c1df575da492a87d0083ce4a04a6, for GNU/Linux 3.2.0, not stripped

Re: "vanilla i3": I replaced the i3-wm-iconpatch Arch package (AUR) with i3-wm package and cannot reproduce the bug anymore. So, it's definitely related to i3-wm-iconpatch.

Shall we close this issue and report it at https://aur.archlinux.org/packages/i3-wm-iconpatch?

@Airblader
Copy link
Member

Shall we close this issue and report it at https://aur.archlinux.org/packages/i3-wm-iconpatch?

Yes, please do that. :-)

@orestisfl
Copy link
Member

I doubt that the patch is at fault here. I see that the PKGBUILD doesn't disable sanitizers (report that to them) so it is possible that the bug you are experiencing is revealed when using them. Can you build i3 from source and retry?

@orestisfl orestisfl reopened this Jan 10, 2020
@sgrubsmyon
Copy link
Author

@orestisfl Can you please clarify: What do you mean by "disabling sanitizers"? Where do I find that in the PKGBUILD (which line)?

From inspecting the difference between https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=i3-wm-iconpatch (i3-wm-iconpatch PGKBUILD file) and https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/i3-wm (vanilla i3 PKGBUILD file), I see that the iconpatch uses the compiler flag CPPFLAGS+="-U_FORTIFY_SOURCE". This option appears to disable code fortification (see https://idea.popcount.org/2013-08-15-fortify_source/). Is this what you mean by "doesn't disable sanitizers"?

Another difference between iconpatch and vanilla is a patch 0001-Use-OVER-operator-for-drawing-text.patch (from #2925), which is applied in vanilla i3-wm, but not in i3-wm-iconpatch.

When you say "Can you build i3 from source?", do you suggest that I apply the CPPFLAGS+="-U_FORTIFY_SOURCE" option to the vanilla i3-wm and see if the bug appears, also without the icon patch applied?

@Airblader
Copy link
Member

@sgrubsmyon The --disable-sanitizers is a flag for configuration, see https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=i3-gaps-next-git#n45.

It looks like the i3-wm package is also missing this.

@sgrubsmyon
Copy link
Author

But using the vanilla i3-wm package (also not disabling sanitizers), I do not experience the bug. It seems we are on the wrong track, then. This bug has nothing to do with sanitizers.

BTW, I am now using the i3-gaps package, with this BUILDPKG: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/i3-gaps. It is also unaffected by the bug.

So, it could be related to the make CPPFLAGS+="-U_FORTIFY_SOURCE", in which case the i3-gaps-next-git package would be affected too. I can later switch to that package and report back.

@Airblader
Copy link
Member

A simple way to see if it's the patch is to use the PKGBUILD from the patched i3, but just comment out the line applying the patch.

@sgrubsmyon
Copy link
Author

Seems I would first have to digest this: https://wiki.archlinux.org/index.php/Arch_Build_System and this: https://wiki.archlinux.org/index.php/Makepkg, whereas switching to i3-gaps-next-git is a simple pacman or pamac command.

@Airblader
Copy link
Member

It's simple enough for me to describe it :-)

  1. Save the PKGBUILD in some directory.
  2. Comment out the apply line which applies the patch
  3. In the directory, run makepkg
  4. sudo pacman -U <…>.xz

@sgrubsmyon
Copy link
Author

@Airblader Thank you for your kind support!

I commented out the patch -p1 < "$srcdir/iconsupport.patch" (line 41) in the i3-wm-iconpatch PKGBUILD and ran makepkg and sudo pacman -U. Logout, login. No bug present.

I uncommented the patch (so back to default PKGBUILD), compiled again, reinstalled package with pacman, logged out, logged in. I see the icons in window title bars (which is the purpose of the patch) and the bug is back there: i3 crashes again, when starting horizontal container inside tabbing mode.

This clearly demonstrates that the bug is revealed by applying the patch, so it's specific to i3-wm-iconpatch.

@Airblader
Copy link
Member

Yeah, that is what it sounds like to me as well, so I'll close this again unless @orestisfl has another reason to disagree. :-)

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

No branches or pull requests

4 participants