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

Segmentation fault in __get_nprocs () at ../sysdeps/unix/sysv/linux/getsysstats.c:186 #2759

Closed
ShiningZhang opened this issue Aug 31, 2017 · 8 comments

Comments

@ShiningZhang
Copy link

1、# vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Aug 30 2017 20:16:12)
Included patches: 1-1015
Compiled by root@nm_178_217
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte -terminal
++builtin_terms +fork() +multi_lang +terminfo
+byte_offset +gettext -mzscheme +termresponse
+channel -hangul_input +netbeans_intg +textobjects
+cindent +iconv +num64 +timers
+clientserver +insert_expand +packages +title
+clipboard +job +path_extra -toolbar
+cmdline_compl +jumplist +perl +user_commands
+cmdline_hist +keymap +persistent_undo +vertsplit
+cmdline_info +lambda +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con +lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind +X11
-dnd +modify_fname +signs +xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape +startuptime -xpm
+eval +mouse_dec +statusline +xsmp_interact
+ex_extra -mouse_gpm -sun_workshop +xterm_clipboard
+extra_search -mouse_jsbterm +syntax -xterm_save
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
f-b for $VIMRUNTIME: "/usr/local/share/vim/vim80"
Compilation: gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -std=gnu99 -L. -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -L/usr/local/lib -Wl,--as-needed -o vim -lSM -lICE -lXt -lX11 -lSM -lICE -lm -ltinfo -lnsl -lselinux -L/usr/lib -llua -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib/python2.7/config -lpython2.6 -lruby -lpthread -lrt -ldl -lcrypt -lm

2、gdb info:
(gdb) r -u vimrc
Starting program: /usr/local/bin/vim -u vimrc
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[Thread debugging using libthread_db enabled]
Detaching after fork from child process 36503.
[New Thread 0x7ffff3d4d700 (LWP 36504)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff3d4d700 (LWP 36504)]
0x00007ffff7b029b4 in __get_nprocs () at ../sysdeps/unix/sysv/linux/getsysstats.c:186
186 ../sysdeps/unix/sysv/linux/getsysstats.c: No such file or directory.
in ../sysdeps/unix/sysv/linux/getsysstats.c
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6_6.9.x86_64 keyutils-libs-1.4-5.el6.x86_64 krb5-libs-1.10.3-37.el6_6.x86_64 libICE-1.0.6-1.el6.x86_64 libSM-1.2.1-2.el6.x86_64 libX11-1.6.0-2.2.el6.x86_64 libXau-1.0.6-4.el6.x86_64 libXt-1.1.4-6.1.el6.x86_64 libcom_err-1.41.12-21.el6.x86_64 libgcc-4.4.7-11.el6.x86_64 libselinux-2.0.94-5.8.el6.x86_64 libuuid-2.17.2-12.18.el6.x86_64 libxcb-1.9.1-2.el6.x86_64 lua-5.1.4-4.1.el6.x86_64 ncurses-libs-5.7-4.20090207.el6.x86_64 nss-softokn-freebl-3.14.3-22.el6_6.x86_64 openssl-1.0.1e-30.el6_6.11.x86_64 perl-libs-5.10.1-136.el6_6.1.x86_64 python-libs-2.6.6-52.el6.x86_64 ruby-libs-1.8.7.374-4.el6_6.x86_64 zlib-1.2.3-29.el6.x86_64

3、install:
python install.py --clang-completer
4、environment:
gcc 7.2.0
red hat6
python2.6.6

@micbou
Copy link
Collaborator

micbou commented Aug 31, 2017

Does Vim crash when started with the command

vim -u NONE -c "py print(sys.version)"

?

@ShiningZhang
Copy link
Author

After printing “2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
”,it worked

@ShiningZhang
Copy link
Author

I re-installed YCM through Vundle and vim also crashed as the same log

@micbou
Copy link
Collaborator

micbou commented Aug 31, 2017

Could you share the backtrace by following these instructions? The __get_nprocs() error is not the cause of the segfault.

@ShiningZhang
Copy link
Author

It's too hard for me to re-compile the vim with debug option. So I give up this issue. Thank you for your help.

@micbou
Copy link
Collaborator

micbou commented Sep 1, 2017

Your Vim is already compiled with the -g flag:

Compilation: gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1

So, you just need to follow these steps:

  • run ulimit - c unlimited in the shell;
  • start Vim and reproduce the crash; you should see the message Segmentation fault (core dumped) and a file core should be created in the current directory;
  • open it with gdb: gdb vim core;
  • type bt in gdb to obtain the backtrace.

@micbou
Copy link
Collaborator

micbou commented Sep 15, 2017

No answer. Closing.

@micbou micbou closed this as completed Sep 15, 2017
@zhaozheng09
Copy link

No answer. Closing.
I have same question about this~.
gdb vim core.9341
then bt
#0 0x00000030154119c3 in _nc_tparm_analyze () from /lib64/libtinfo.so.5
#1 0x0000003015411d55 in tparm () from /lib64/libtinfo.so.5
#2 0x00000000005885e2 in ?? ()
#3 0x000000000053adb9 in ?? ()
#4 0x00000000004c8c43 in ?? ()
#5 0x00000000004c8c69 in ?? ()
#6
#7 0x00007f3e71aa92b4 in __get_nprocs () at ../sysdeps/unix/sysv/linux/getsysstats.c:186
#8 0x00007f3e71a403d5 in arena_get2 (size=544, a_tsd=) at arena.c:833
#9 0x00007f3e71a41255 in __GI___libc_malloc (bytes=544) at malloc.c:2921
#10 0x00007f3e71e583b5 in _PyObject_Malloc (ctx=, nbytes=544) at Objects/obmalloc.c:1579
#11 0x00007f3e71f4e3c4 in _PyObject_GC_Alloc (basicsize=, use_calloc=0) at Modules/gcmodule.c:1696
#12 _PyObject_GC_Malloc (basicsize=) at Modules/gcmodule.c:1718
#13 0x00007f3e71f4e69a in _PyObject_GC_NewVar (tp=tp@entry=0x7f3e72256480 <PyFrame_Type>, nitems=19) at Modules/gcmodule.c:1747
#14 0x00007f3e71e1b2b1 in _PyFrame_New_NoTrack (tstate=tstate@entry=0x143a310, code=0x7f3e70ebcae0, globals=0x7f3e70ea93f0, locals=locals@entry=0x0)
at Objects/frameobject.c:713
#15 0x00007f3e71e01b20 in function_code_fastcall (co=, args=0x7f3e6e304540, nargs=1, globals=) at Objects/call.c:272
#16 0x00007f3e71dff646 in _PyFunction_FastCallKeywords (func=, stack=, nargs=, kwnames=) at Objects/call.c:415
#17 0x00007f3e71ef2cf6 in call_function (kwnames=0x0, oparg=, pp_stack=) at Python/ceval.c:4616
#18 _PyEval_EvalFrameDefault (f=, throwflag=) at Python/ceval.c:3110
#19 0x00007f3e71e01b5f in function_code_fastcall (co=co@entry=0x7f3e70ebc930, args=, args@entry=0x7f3e6e2cdd10, nargs=1,
globals=globals@entry=0x7f3e70ea93f0) at Objects/call.c:283
#20 0x00007f3e71dff4cf in _PyFunction_FastCallDict (func=0x7f3e70dfd620, args=0x7f3e6e2cdd10, nargs=, kwargs=0x0) at Objects/call.c:322
#21 0x00007f3e71e004ed in _PyObject_Call_Prepend (callable=0x7f3e70dfd620, obj=, args=0x7f3e71774048, kwargs=0x0) at Objects/call.c:904
#22 0x00007f3e71e01968 in PyObject_Call (callable=0x7f3e71683708, args=, kwargs=) at Objects/call.c:245
#23 0x00007f3e71f84673 in t_bootstrap (boot_raw=boot_raw@entry=0x7f3e6e2d9c88) at ./Modules/_threadmodule.c:994
#24 0x00007f3e71f34fc7 in pythread_wrapper (arg=) at Python/thread_pthread.h:174
#25 0x00000030138079d1 in start_thread () from /lib64/libpthread.so.0
#26 0x00007f3e71aa9b7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants