LoginSignup
2
2

More than 5 years have passed since last update.

【メモ】tigのインストールでSEGVる件

Last updated at Posted at 2014-04-01

homebrewでinstallすると
segmentation faultが発生するので

こちらを参考にソースビルドを試みるも現象変わらず。

-> % ./configure && make
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for gettimeofday... yes
checking whether environ is declared... no
checking whether errno is declared... yes
checking for mkstemps... yes
checking for setenv... yes
checking for NcursesW wide-character library... yes
checking for working ncursesw/curses.h... yes
checking for working ncursesw.h... no
checking for working ncurses.h... yes
checking for iconv... yes
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for asciidoc... no
checking for xmlto... no
checking for docbook2pdf... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating config.h
config.status: config.h is unchanged
gcc -g -O2 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o tig.o tig.c
gcc -g -O2 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o io.o io.c
gcc -g -O2 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o graph.o graph.c
gcc -g -O2 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o refs.o refs.c
gcc   tig.o io.o graph.o refs.o  -liconv -lncursesw -o tig
gcc -g -O2 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o test-graph.o test-graph.c
gcc   test-graph.o io.o graph.o  -liconv -lncursesw -o test-graph
-> % ./tig
[1]    79933 segmentation fault  ./tig

でもなぜか

-> % make clean all-debug
rm -f -r tig-1.2.1-0 *.spec tig-*.tar.gz tig-*.tar.gz.md5
rm -f tig test-graph core *.o compat/*.o *.xml
gcc -g -O2 -g -DDEBUG -Werror -O0 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o tig.o tig.c
gcc -g -O2 -g -DDEBUG -Werror -O0 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o io.o io.c
gcc -g -O2 -g -DDEBUG -Werror -O0 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o graph.o graph.c
gcc -g -O2 -g -DDEBUG -Werror -O0 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o refs.o refs.c
gcc   tig.o io.o graph.o refs.o  -liconv -lncursesw -o tig
gcc -g -O2 -g -DDEBUG -Werror -O0 -DHAVE_CONFIG_H '-DTIG_VERSION="1.2.1"' '-DSYSCONFDIR="/usr/local/etc"'   -c -o test-graph.o test-graph.c
gcc   test-graph.o io.o graph.o  -liconv -lncursesw -o test-graph

all-debug指定をしてビルドすると何故かSEGVが直りました。

-> % ./tig

私の環境のせいでしょうか???

追記

自己解決したので追記、やはり環境問題でした。

lldbでエラー箇所を探ったところvwprintwというncurseswの関数で落ちているようで、
/usr/local/Cellar/ncursesw/5.7
という過去にHomeBrewで管理されていた古いライブラリが残っていたためにエラっていたようでした。

brew uninstall ncursesw
して
brew install tig
で正しくインストール出来ました。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2