Skip to content

Instantly share code, notes, and snippets.

@akiradeveloper
Created August 13, 2012 15:37
Show Gist options
  • Save akiradeveloper/3341971 to your computer and use it in GitHub Desktop.
Save akiradeveloper/3341971 to your computer and use it in GitHub Desktop.
色々入れたらvimfilerがバグった・・
function <SNR>1_toggle_vimfiler..<SNR>32_call_vimfiler..vimfiler#switch_filer..<SNR>75_create_filer..vimfiler#handler#_event_handler..<SNR>76_on_BufReadCmd..<SNR>76_initialize_vim
filer_directory..vimfiler#force_redraw_screen..vimfiler#get_directory_files..unite#get_vimfiler_candidates..<SNR>33_get_candidates..<SNR>33_recache_candidates..<SNR>33_recache_can
didates_loop..<SNR>33_get_source_candidates..39..37..unite#util#glob..vimproc#readdir..<SNR>63_libcall, line 16
Press ENTER or type command to continue
vimproc: vp_readdir: ['opendir() error: No such file or directory']
Press ENTER or type command to continue
[unite.vim] Error occured in vimfiler_gather_candidates!
Press ENTER or type command to continue
[unite.vim] Source name is file
@akiradeveloper
Copy link
Author

vimprocがバグの原因かな?

@akiradeveloper
Copy link
Author

Shougo/vimproc.vim#11
このエラーは似てる

@akiradeveloper
Copy link
Author

akira@Paptimus> find .vim | xargs grep vp_readdir ~/dotfiles
.vim/bundle/vimproc/autoload/proc.c:vp_readdir(char args)
Binary file .vim/bundle/vimproc/autoload/vimproc_unix.so matches
.vim/bundle/vimproc/autoload/vimproc.vim: let files = s:libcall('vp_readdir', [dirname])
.vim/bundle/vimproc/autoload/proc_w32.c:EXPORT const char *vp_readdir(char *args); /
files */
.vim/bundle/vimproc/autoload/proc_w32.c:vp_readdir(char *args)

vp_readdirを呼んでるところ一覧.

@akiradeveloper
Copy link
Author

たぶん, vimproc.vim のlibcall('vp_readdir .. で死んでるんだろう. そんなもんないと??

@akiradeveloper
Copy link
Author

たぶん, vimproc.vim のlibcall('vp_readdir .. で死んでるんだろう. そんなもんないと??

@akiradeveloper
Copy link
Author

vpってvimprocのことかい!

@akiradeveloper
Copy link
Author

vp_readdirのCコードの中に,

if((dir=opendir( .. ) というのがある. ここで死んでるのかな?そもそもそんなものがないと?

@akiradeveloper
Copy link
Author

opendirというのはdirent.hに入ってる標準関数のようである.
proc.cはそのヘッダをインクルってるから, 問題はopendirが本当に見つからないこと?

@akiradeveloper
Copy link
Author

opendir自体のコードはprocのみ
akira@Paptimus> find . | xargs grep opendir ~/.vim/bundle
./vimproc/autoload/proc.c: if ((dir=opendir(dirname)) == NULL) {
./vimproc/autoload/proc.c: return vp_stack_return_error(&_result, "opendir() error: %s",
Binary file ./vimproc/autoload/vimproc_unix.so matches

@akiradeveloper
Copy link
Author

これ通るけど・・・

include <sys/types.h>

include <dirent.h>

int main(void){
DIR *dir = opendir("/home/akira");
return 0;
}

@akiradeveloper
Copy link
Author

違うな. opendirで開こうとしたものが no file or なんちゃらだったのだ. パスの計算がちゃんと出来ていない

@akiradeveloper
Copy link
Author

TODO とりあえず, pinpointしたいので, vimprocを消してみて実験する

@akiradeveloper
Copy link
Author

make cleanしたら, ディレクトリ移動が出来るようになった. vimprocがあるとダメというのは確かなようである. というわけでとれる方針は

  1. vimfiler関連だけvimprocを使わないようにして(どうやるかは知らん), vimprocを保存する.
  2. vimprocそのもの消す
    というところ.
    余談だけど, haskellmode-vimのhaddock_browserのデフォルトは"open"なのかな. 全く設定してないのにopenが設定されているようなことが言われる. 設定されてないときはopenを設定するということ?

@akiradeveloper
Copy link
Author

直すという方がいいな. again

function 69_execute..69_cd_file_directory..vimfiler#mappings#cd..vimfiler#force_redraw_screen..vimfiler#get_directory_files..unite#get_vimfiler_candidates..33_get_c
andidates..33_recache_candidates..33_recache_candidates_loop..33_get_source_candidates..35..33..unite#util#glob..vimproc#readdir..100_libcall, line 16
vimproc: vp_readdir: ['opendir() error: No such file or directory']
[unite.vim] Error occured in vimfiler_gather_candidates!
[unite.vim] Source name is file
function vimfiler#mappings#cd..vimfiler#force_redraw_screen..vimfiler#get_directory_files..unite#get_vimfiler_candidates..33_get_candidates..33_recache_candidates..
33_recache_candidates_loop..33_get_source_candidates..35..33..unite#util#glob..vimproc#readdir..100_libcall, line 16
vimproc: vp_readdir: ['opendir() error: No such file or directory']
[unite.vim] Error occured in vimfiler_gather_candidates!
[unite.vim] Source name is file

@akiradeveloper
Copy link
Author

akira@Paptimus> find bundle | xargs grep vimfiler_gather_candidates ~/.vim
bundle/unite.vim/doc/unite.txt:- Fixed vimfiler_gather_candidates().
bundle/unite.vim/autoload/unite.vim: let funcname = 'vimfiler_gather_candidates'
bundle/unite.vim/autoload/unite.vim: return has_key(a:source, 'vimfiler_gather_candidates') ?
bundle/unite.vim/autoload/unite.vim: \ copy(a:source.vimfiler_gather_candidates(
bundle/unite.vim/autoload/unite/sources/file.vim:function! s:source_file.vimfiler_gather_candidates(args, context)"{{{
bundle/unite.vim/autoload/unite/sources/file_rec.vim:function! s:source_rec.vimfiler_gather_candidates(args, context)"{{{

@akiradeveloper
Copy link
Author

vimfilerはuniteを利用して作っている. uniteのソース記述の部分でエラってるか

@akiradeveloper
Copy link
Author

どれ, よう分からんがソースを読むか

@akiradeveloper
Copy link
Author

[123] akira@Paptimus> find bundle | xargs grep -n vimfiler_gather_candidates ~/.vim
bundle/unite.vim/doc/unite.txt:3272:- Fixed vimfiler_gather_candidates().
bundle/unite.vim/autoload/unite.vim:2026: let funcname = 'vimfiler_gather_candidates'
bundle/unite.vim/autoload/unite.vim:2027: return has_key(a:source, 'vimfiler_gather_candidates') ?
bundle/unite.vim/autoload/unite.vim:2028: \ copy(a:source.vimfiler_gather_candidates(
bundle/unite.vim/autoload/unite/sources/file.vim:130:function! s:source_file.vimfiler_gather_candidates(args, context)"{{{
bundle/unite.vim/autoload/unite/sources/file_rec.vim:154:function! s:source_rec.vimfiler_gather_candidates(args, context)"{{{

@akiradeveloper
Copy link
Author

/unite/sources/file.vimかな

@akiradeveloper
Copy link
Author

ん・・・・?????こんなコードがバグるの???vimprocを入れたらバグるということはどういうことだろうか. どこかの処理にvimprocがまぎれこんでしまった結果, 死.

@akiradeveloper
Copy link
Author

はぁ・・・ if isdirectory(path)に入ってるのかな? echom埋め込んでみますか.

@akiradeveloper
Copy link
Author

ここで死
akira@Paptimus> find . | xargs grep -n get_source_candidates ~/.vim/bundle
./unite.vim/autoload/unite.vim:1963: let source_candidates = s:get_source_candidates(source)
./unite.vim/autoload/unite.vim:2014:function! s:get_source_candidates(source)"{{{
./unite.vim/autoload/unite.vim:2017: let funcname = 's:get_source_candidates()'

@akiradeveloper
Copy link
Author

へ???

@akiradeveloper
Copy link
Author

/home/akira/
/home/akira/.
/home/akira/Documents/

がvimproc#globに入っていく(vimprocありバージョンのパス).

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