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

Segfaults with 1.408-vsc1.32.0 #346

Closed
ymmt2005 opened this issue Mar 27, 2019 · 20 comments
Closed

Segfaults with 1.408-vsc1.32.0 #346

ymmt2005 opened this issue Mar 27, 2019 · 20 comments
Assignees
Labels
bug Something isn't working

Comments

@ymmt2005
Copy link

  • code-server version: 1.408-vsc1.32.0
  • OS Version: Ubuntu 18.04

Description

code-server segfaults immediately with following strace and dmesg logs.

$ strace code-server |& tail
munmap(0x2410692cf000, 200704)          = 0
munmap(0x3bcf58285000, 503808)          = 0
mmap(0x2478d1600000, 1048576, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2478d1600000
munmap(0x2478d1680000, 524288)          = 0
mmap(0x2478d1600000, 524288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2478d1600000
mmap(0x3b2f0f880000, 1048576, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x3b2f0f880000
munmap(0x3b2f0f900000, 524288)          = 0
mmap(0x3b2f0f880000, 524288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3b2f0f880000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xfbad2087} ---
+++ killed by SIGSEGV (core dumped) +++

$ dmesg | tail -1
[1176551.897021] code-server[88087]: segfault at fbad2087 ip 00007fc4e215f5a1 sp 00007ffcb60abcd8 error 4 in libc-2.27.so[7fc4e1fd1000+1e7000]

Steps to Reproduce

Just run code-serve.

@ymmt2005 ymmt2005 added the bug Something isn't working label Mar 27, 2019
@kylecarbs
Copy link
Member

Interesting. Have prior versions worked for you?

@ymmt2005
Copy link
Author

@kylecarbs Yes. I reverted to 1.32.0-310 and it works.

@kylecarbs
Copy link
Member

Hm. Could be due to the glibc version. Will investigate.

@mariusvniekerk
Copy link

Running in gdb on debian buster i get the following error

GNU gdb (Debian 8.2.1-2) 8.2.1
Copyright (C) 2018 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./code-server...done.
(gdb) run
Starting program: /home/mvanniekerk/code-server/code-server1.408-vsc1.32.0-linux-x64/code-server 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7aa5700 (LWP 11381)]
[New Thread 0x7ffff72a4700 (LWP 11382)]
[New Thread 0x7ffff6aa3700 (LWP 11383)]
[New Thread 0x7ffff62a2700 (LWP 11384)]

Thread 1 "code-server" received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
65	../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) Quit
(gdb) quit
A debugging session is active.

@ymmt2005
Copy link
Author

gdb backtrace on Ubuntu 18.04:

$ gdb ./code-server 
(gdb) run
Starting program: /home/ymmt/code-server1.408-vsc1.32.0-linux-x64/code-server 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6a79700 (LWP 1402)]
[New Thread 0x7ffff6278700 (LWP 1403)]
[New Thread 0x7ffff5a77700 (LWP 1404)]
[New Thread 0x7ffff5276700 (LWP 1405)]

Thread 1 "code-server" received signal SIGSEGV, Segmentation fault.
0x00007ffff6c085a1 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff6c085a1 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x0000000000a1c428 in v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::String::NewStringType, int) ()
#2  0x0000000000854074 in node::SetupProcessObject(node::Environment*, int, char const* const*, int, char const* const*) ()
#3  0x000000000083d2dc in node::Environment::Start(int, char const* const*, int, char const* const*, bool) ()
#4  0x000000000085979d in node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) ()
#5  0x0000000000858840 in node::Start(int, char**) ()
#6  0x00007ffff6a9bb97 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x000000000081e7b9 in _start ()

@polymerchm
Copy link

Running on Ubuntu 16.04.1

note:

alias startcode='code-server --cert=/home/spollack/certs/MyCertificate.crt --cert-key=/home/spollack/certs/MyKey.key -d '

spollack@ctms-nuc:~/ctms/Temperature$ startcode CTMS
ERROR { Error: EEXIST: file already exists, mkdir '/home/spollack/certs/MyCertificate.crt'
[stack]: 'Error: EEXIST: file already exists, mkdir '/home/spollack/certs/MyCertificate.crt'',
[message]: 'EEXIST: file already exists, mkdir '/home/spollack/certs/MyCertificate.crt'',
errno: -17,
code: 'EEXIST',
syscall: 'mkdir',
path: '/home/spollack/certs/MyCertificate.crt' }
*** Error in `code-server': free(): invalid pointer: 0x00000000021fb168 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f611667e7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f611668737a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f611668b53c]
code-server(_ZN4node5StartEiPPc+0x3d9)[0x858a89]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f6116627830]
code-server(_start+0x29)[0x81e7b9]
======= Memory map: ========
00400000-01fdf000 r-xp 00000000 08:02 3282459 /usr/local/bin/code-server
021df000-021e0000 r--p 01bdf000 08:02 3282459 /usr/local/bin/code-server
021e0000-021fa000 rw-p 01be0000 08:02 3282459 /usr/local/bin/code-server
021fa000-02210000 rw-p 00000000 00:00 0
02d48000-03317000 rw-p 00000000 00:00 0 [heap]
7f6100000000-7f6100021000 rw-p 00000000 00:00 0
7f6100021000-7f6104000000 ---p 00000000 00:00 0
7f6105ffc000-7f6105ffd000 ---p 00000000 00:00 0
7f6105ffd000-7f61067fd000 rw-p 00000000 00:00 0
7f61067fd000-7f61067fe000 ---p 00000000 00:00 0
7f61067fe000-7f6106ffe000 rw-p 00000000 00:00 0
7f6106ffe000-7f6106fff000 ---p 00000000 00:00 0
7f6106fff000-7f61077ff000 rw-p 00000000 00:00 0
7f61077ff000-7f6107800000 ---p 00000000 00:00 0
7f6107800000-7f6108000000 rw-p 00000000 00:00 0
7f6108000000-7f6108021000 rw-p 00000000 00:00 0
7f6108021000-7f610c000000 ---p 00000000 00:00 0
7f610c000000-7f610c021000 rw-p 00000000 00:00 0
7f610c021000-7f6110000000 ---p 00000000 00:00 0
7f6110000000-7f6110021000 rw-p 00000000 00:00 0
7f6110021000-7f6114000000 ---p 00000000 00:00 0
7f6114603000-7f6114604000 ---p 00000000 00:00 0
7f6114604000-7f6114e04000 rw-p 00000000 00:00 0
7f6114e04000-7f6114e05000 ---p 00000000 00:00 0
7f6114e05000-7f6115605000 rw-p 00000000 00:00 0
7f6115605000-7f6115606000 ---p 00000000 00:00 0
7f6115606000-7f6115e06000 rw-p 00000000 00:00 0
7f6115e06000-7f6115e07000 ---p 00000000 00:00 0
7f6115e07000-7f6116607000 rw-p 00000000 00:00 0
7f6116607000-7f61167c7000 r-xp 00000000 08:02 12719769 /lib/x86_64-linux-gnu/libc-2.23.so
7f61167c7000-7f61169c7000 ---p 001c0000 08:02 12719769 /lib/x86_64-linux-gnu/libc-2.23.so
7f61169c7000-7f61169cb000 r--p 001c0000 08:02 12719769 /lib/x86_64-linux-gnu/libc-2.23.so
7f61169cb000-7f61169cd000 rw-p 001c4000 08:02 12719769 /lib/x86_64-linux-gnu/libc-2.23.so
7f61169cd000-7f61169d1000 rw-p 00000000 00:00 0
7f61169d1000-7f61169e9000 r-xp 00000000 08:02 12719756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f61169e9000-7f6116be8000 ---p 00018000 08:02 12719756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f6116be8000-7f6116be9000 r--p 00017000 08:02 12719756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f6116be9000-7f6116bea000 rw-p 00018000 08:02 12719756 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f6116bea000-7f6116bee000 rw-p 00000000 00:00 0
7f6116bee000-7f6116c04000 r-xp 00000000 08:02 12718547 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6116c04000-7f6116e03000 ---p 00016000 08:02 12718547 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6116e03000-7f6116e04000 rw-p 00015000 08:02 12718547 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6116e04000-7f6116f0c000 r-xp 00000000 08:02 12719772 /lib/x86_64-linux-gnu/libm-2.23.so
7f6116f0c000-7f611710b000 ---p 00108000 08:02 12719772 /lib/x86_64-linux-gnu/libm-2.23.so
7f611710b000-7f611710c000 r--p 00107000 08:02 12719772 /lib/x86_64-linux-gnu/libm-2.23.so
7f611710c000-7f611710d000 rw-p 00108000 08:02 12719772 /lib/x86_64-linux-gnu/libm-2.23.so
7f611710d000-7f611727f000 r-xp 00000000 08:02 2883983 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f611727f000-7f611747f000 ---p 00172000 08:02 2883983 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f611747f000-7f6117489000 r--p 00172000 08:02 2883983 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f6117489000-7f611748b000 rw-p 0017c000 08:02 2883983 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f611748b000-7f611748f000 rw-p 00000000 00:00 0
7f611748f000-7f6117496000 r-xp 00000000 08:02 12719752 /lib/x86_64-linux-gnu/librt-2.23.so
7f6117496000-7f6117695000 ---p 00007000 08:02 12719752 /lib/x86_64-linux-gnu/librt-2.23.so
7f6117695000-7f6117696000 r--p 00006000 08:02 12719752 /lib/x86_64-linux-gnu/librt-2.23.so
7f6117696000-7f6117697000 rw-p 00007000 08:02 12719752 /lib/x86_64-linux-gnu/librt-2.23.so
7f6117697000-7f611769a000 r-xp 00000000 08:02 12719754 /lib/x86_64-linux-gnu/libdl-2.23.so
7f611769a000-7f6117899000 ---p 00003000 08:02 12719754 /lib/x86_64-linux-gnu/libdl-2.23.so
7f6117899000-7f611789a000 r--p 00002000 08:02 12719754 /lib/x86_64-linux-gnu/libdl-2.23.so
7f611789a000-7f611789b000 rw-p 00003000 08:02 12719754 /lib/x86_64-linux-gnu/libdl-2.23.so
7f611789b000-7f61178c1000 r-xp 00000000 08:02 12719755 /lib/x86_64-linux-gnu/ld-2.23.so
7f6117aa1000-7f6117aa9000 rw-p 00000000 00:00 0
7f6117abb000-7f6117abc000 rw-p 00000000 00:00 0
7f6117abc000-7f6117abd000 ---p 00000000 00:00 0
7f6117abd000-7f6117ac0000 rw-p 00000000 00:00 0
7f6117ac0000-7f6117ac1000 r--p 00025000 08:02 12719755 /lib/x86_64-linux-gnu/ld-2.23.so
7f6117ac1000-7f6117ac2000 rw-p 00026000 08:02 12719755 /lib/x86_64-linux-gnu/ld-2.23.so
7f6117ac2000-7f6117ac3000 rw-p 00000000 00:00 0
7ffe4efbc000-7ffe4efdd000 rw-p 00000000 00:00 0 [stack]
7ffe4efea000-7ffe4efed000 r--p 00000000 00:00 0 [vvar]
7ffe4efed000-7ffe4efef000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)

@kylecarbs
Copy link
Member

Found the issue. Will have a fix out soon!

@yuq-1s
Copy link

yuq-1s commented Mar 31, 2019

Seems the same issue on my host.
Running on Ubuntu 18.04 with AMD CPU get segmentation fault when calling sse instruction.
The backtrace is

(gdb) r
Starting program: /home/yqwang/bin/code-server 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff54f2700 (LWP 15260)]
[New Thread 0x7ffff4cf1700 (LWP 15261)]
[New Thread 0x7ffff44f0700 (LWP 15262)]
[New Thread 0x7ffff3cef700 (LWP 15263)]

Thread 1 "code-server" received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
120	../sysdeps/x86_64/multiarch/../strlen.S: No such file or directory.
(gdb) back
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
#1  0x0000000000a1c428 in v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::String::NewStringType, int) ()
#2  0x0000000000854074 in node::SetupProcessObject(node::Environment*, int, char const* const*, int, char const* const*) ()
#3  0x000000000083d2dc in node::Environment::Start(int, char const* const*, int, char const* const*, bool) ()
#4  0x000000000085979d in node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) ()
#5  0x0000000000858840 in node::Start(int, char**) ()
#6  0x00007ffff657ab97 in __libc_start_main (main=0x81e6e0 <main>, argc=1, argv=0x7fffffffe008, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffdff8) at ../csu/libc-start.c:310
#7  0x000000000081e7b9 in _start ()

@thinkwee
Copy link

thinkwee commented Apr 1, 2019

having the same problem on Ubuntu 18.04
it works for me on the Ubuntu 16.04

@kylecarbs
Copy link
Member

It's an issue with nbin. Will have a fix out today.

@mdxprograms
Copy link

mdxprograms commented Apr 2, 2019

Will the fix be released today?

@SimonBourdon
Copy link

Same issue, is it fixed?

@StupidMedia
Copy link

StupidMedia commented Apr 3, 2019

It is working now.

Wasn't working on Ubuntu 18.04.2 LTS for me. Worked on 16.04.6 and 18.10.

Now it works on 18.04.2 LTS as well. It seems the issue was fixed.

@chriselrod
Copy link

I have the same issue on Clear Linux, and like those on Ubuntu, the previous release works for me.

@StupidMedia
Copy link

StupidMedia commented Apr 3, 2019

I have the same issue on Clear Linux, and like those on Ubuntu, the previous release works for me.

I just created two new droplets for testing and it is working now. Try to "apt update && apt upgrade" on your distro or whatever package manager it uses and try again. See if it works.

Redownload the latest release as well.

@chriselrod
Copy link

No change.

(gdb) r
Starting program: /home/chriselrod/Documents/software/code-server1.408-vsc1.32.0-linux-x64/code-server 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
[New Thread 0x7ffff7a65700 (LWP 12558)]
[New Thread 0x7ffff7264700 (LWP 12559)]
[New Thread 0x7ffff6a63700 (LWP 12560)]
[New Thread 0x7ffff6262700 (LWP 12561)]

Thread 1 "code-server" received signal SIGSEGV, Segmentation fault.
0x00007ffff7bf4435 in __strlen_avx2 () from /usr/lib64/haswell/libc.so.6
(gdb) back
#0  0x00007ffff7bf4435 in __strlen_avx2 () from /usr/lib64/haswell/libc.so.6
#1  0x0000000000a1c428 in v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::String::NewStringType, int) ()
#2  0x0000000000854074 in node::SetupProcessObject(node::Environment*, int, char const* const*, int, char const* const*) ()
#3  0x000000000083d2dc in node::Environment::Start(int, char const* const*, int, char const* const*, bool) ()
#4  0x000000000085979d in node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) ()
#5  0x0000000000858840 in node::Start(int, char**) ()
#6  0x00007ffff7a8ff13 in __libc_start_main (main=0x81e6e0 <main>, argc=1, argv=0x7fffffffc0f8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffc0e8) at ../csu/libc-start.c:308
#7  0x000000000081e7b9 in _start ()

@novusli
Copy link

novusli commented Apr 4, 2019

I have the same issue in Ubuntu 18.04 LTS.
`(gdb) r
Starting program: /bin/code-server
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6a79700 (LWP 3933)]
[New Thread 0x7ffff6278700 (LWP 3934)]
[New Thread 0x7ffff5a77700 (LWP 3935)]
[New Thread 0x7ffff5276700 (LWP 3936)]

Thread 1 "code-server" received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
62 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) `

@kylecarbs
Copy link
Member

kylecarbs commented Apr 4, 2019

Fixed with the latest release!

@ymmt2005
Copy link
Author

ymmt2005 commented Apr 4, 2019

Confirmed the new release fixed the issue. Thank you!!

@chriselrod
Copy link

I can confirm it works for me as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests