When I enter copy mode (C-b PageUp), tmux 1.7 segfaults and in dmesg I can read: tmux[12843]: segfault at 69727f ip 000000000042a98c sp 00007fffa11ca8b0 error 4 in tmux[400000+4f000] tmux-1.6 works fine. I re-emerged libevent and ncurses in the hope to fix the problem with tmux-1.7 but without any benefit. 'revdep-rebuild -ip' shows no problem Reproducible: Always Steps to Reproduce: 1. run tmux 2. press 'C-b PageUp' Actual Results: segfault Expected Results: Enter copy mode and scroll one page back.
ok, we need a full backtrace. please do: 1)FEATURES="nostrip" CFLAGS="-g3" CXXFLAGS="${CFLAGS}" emerge tmux 2)gdb /usr/bin/tmux 3)run (to start it) 4)bt after segfaults.
$ gdb /usr/bin/tmux GNU gdb (Gentoo 7.5 p1) 7.5 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /usr/bin/tmux...done. (gdb) run Starting program: /usr/bin/tmux warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". protocol version mismatch (client 7, server 6) [Inferior 1 (process 23674) exited with code 01] (gdb)
No, wait, there was a tmux-1.6 session running. Running tmux-1.7 in gdb inhibits the segfault. $ gdb /usr/bin/tmux GNU gdb (Gentoo 7.5 p1) 7.5 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /usr/bin/tmux...done. (gdb) run Starting program: /usr/bin/tmux warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [exited] [Inferior 1 (process 12240) exited normally] (gdb)
No, it's not gdb. tmux-1.7 works perfectly if built with: FEATURES="nostrip" CFLAGS="-g3" CXXFLAGS="${CFLAGS}" emerge tmux That's what I have in make.conf: CFLAGS="-Os -mtune=core2 -march=core2 -pipe -D__STDC_CONSTANT_MACROS" CXXFLAGS="${CFLAGS}" Any other software, tmux-1.6 included, works fine with this CFLAGS.
The -Os flag is the problem it seems. Until this gets fixed upstream or in the official ebuild, two solutions are: 1. Modify the ebuild, adding inherit flag-o-matic to the top of the file and inserting replace-flags -Os -O2 into src_prepare() 2. Create a file /etc/portage/env/app-misc/tmux-1.7 containing CFLAGS=`echo "${CFLAGS}" | sed 's/-Os/-O2/'`
fixed in 1.7-r2, cheers :)