Skip to content

Instantly share code, notes, and snippets.

@ynkdir
Created March 22, 2011 22:18
Show Gist options
  • Save ynkdir/882208 to your computer and use it in GitHub Desktop.
Save ynkdir/882208 to your computer and use it in GitHub Desktop.
vim-crash.sh ubuntu 10.10 glibc iconv bug
# ubuntu 10.10 glibc iconv
echo 83d9 | xxd -r -p > test.txt
vim -c "edit ++enc=cp932 test.txt"
# Vim: Caught deadly signal SEGV
# Vim: Finished.
# Segmentation fault
#
# vim/src/fileio.c
# 1551 while ((iconv(iconv_fd, (void *)&fromp, &from_size,
# 1552 &top, &to_size)
# 1553 == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL)
# 1554 || from_size > CONV_RESTLEN)
#
# Result of iconv() is -1, but from_size == 0 (fromp is consumed).
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment