microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.7k stars 29.07k forks source link

Linux: Integration tests crash with native exception #88415

Closed bpasero closed 4 years ago

bpasero commented 4 years ago

For example:

Error:

Received signal 11 SEGV_MAPERR 0000000018bf
#0 0x5632fea9d3d9 (/home/vsts/work/1/s/.build/electron/code-oss+0x35d13d8)
  r8: 0000000000000000  r9: 0000000000000000 r10: 00007ffe31e73840 r11: 0000000000000000
 r12: 00000b6f9da58910 r13: 00000b6f9cbf1c40 r14: 00007ffe31e73bd0 r15: 00000b6f9d1b5200
  di: 00000b6f9dc56200  si: 00000b6f9dc56200  bp: 00007ffe31e73b90  bx: 00000b6f9dbcf100
  dx: 00007ffe31e73bd0  ax: 0000000000000e9f  cx: 00005633022dcc68  sp: 00007ffe31e73b90
  ip: 00005632fe36a8f7 efl: 0000000000010206 cgf: 002b000000000033 erf: 0000000000000004
 trp: 000000000000000e msk: 0000000000000000 cr2: 00000000000018bf
[end of stack trace]
Calling _exit(1). Core file will not be generated.
##[error]Bash exited with code '1'.

Setting Electron-7 label because that seems related. Possibly the webview tests?

bpasero commented 4 years ago

Seeing this one on Windows just now: https://github.com/microsoft/vscode/runs/385552317

    v8_inspector::V8ContextInfo::executionContextId [0x00007FF64EF6310C+2715148]
    v8::Unwinder::PCIsInV8 [0x00007FF64E7BB8A3+1379]
    v8::Unwinder::PCIsInV8 [0x00007FF64E7BB466+294]
    v8::Function::Call [0x00007FF64E5EBEF4+500]
    node::InternalCallbackScope::Close [0x00007FF650B6ABF9+1001]
    node::MakeCallback [0x00007FF650B6AFA5+213]
    node::MakeCallback [0x00007FF650B6AE9E+158]
    node::MakeCallback [0x00007FF650B6ADCA+138]
    v8::ArrayBuffer::Contents::Deleter [0x00007FF64D6B778F+159535]
    uv_backend_fd [0x00007FF64D6362BF+174959]
    uv_backend_fd [0x00007FF64D636124+174548]
    uv_backend_fd [0x00007FF64D626B22+111570]
    uv_backend_fd [0x00007FF64D626A1C+111308]
    uv_mutex_init_recursive [0x00007FF64F23E3A5+1075765]
    GetHandleVerifier [0x00007FF64F4E91C3+631091]
    GetHandleVerifier [0x00007FF64F4ED0EF+647263]
    GetHandleVerifier [0x00007FF64F4ECD27+646295]
    GetHandleVerifier [0x00007FF64F4E7872+624610]
    GetHandleVerifier [0x00007FF64F4E804E+626622]
    GetHandleVerifier [0x00007FF64F4F73A0+688912]
    uv_cond_signal [0x00007FF64F3EC7C2+11506]
    uv_cond_signal [0x00007FF64F3FCB85+78005]
    uv_cond_signal [0x00007FF64F3FC80C+77116]
    uv_loadavg [0x00007FF64F3ABBE4+761796]
    uv_loadavg [0x00007FF64F3AB64E+760366]
    uv_cond_signal [0x00007FF64F3FD4B6+80358]
    uv_os_getpid [0x00007FF64F3D1B6E+68222]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64E00A260+1871536]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64E00A131+1871233]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64E00B851+1877153]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64E007702+1860434]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64DF10D76+850374]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64DF11777+852935]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64DF1148B+852187]
    IsSandboxedProcess [0x00007FF64FC33A1A+234362]
    v8::CpuProfile::GetTopDownRoot [0x00007FF64DF10CE6+850230]
    Ordinal0 [0x00007FF64D5B13DC+5084]
    node::AsyncResource::CallbackScope::CallbackScope [0x00007FF652390532+6778626]
    BaseThreadInitThunk [0x00007FF9E17C84D4+20]
    RtlUserThreadStart [0x00007FF9E193E8B1+33]
bpasero commented 4 years ago

Linux (from 1d ago): https://dev.azure.com/vscode/VSCode/_build/results?buildId=34777&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb

bpasero commented 4 years ago

I extracted the windows one into https://github.com/microsoft/vscode/issues/88596 as it is possibly something else.

deepak1556 commented 4 years ago

Another linux after the webview test were disabled: https://dev.azure.com/monacotools/Monaco/_build/results?buildId=65245 , seems to be same as https://github.com/microsoft/vscode/issues/88415#issuecomment-573757543

bpasero commented 4 years ago

Here is a log output with --verbose: https://monacotools.visualstudio.com/DefaultCollection/Monaco/_build/results?buildId=65321&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=d2c76452-9b5b-53aa-b9e7-4eac61843d9f

...
  161 passing (16s)
  4 pending
[text file model] load() - enter fake-fs:/kxckjs
[text file model] load() - exit - without loading because model is dirty or being saved fake-fs:/kxckjs
[main 2020-01-21T18:57:22.167Z] menubarService#updateMenubar 1
[File Watcher (node.js)] [CHANGED] /tmp/tmp.Ersw8fQ82Z/logs/20200121T185703/main.log
[2219:0121/185722.182865:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2219:0121/185722.183657:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[File Watcher (node.js)] >> normalized [CHANGED] /tmp/tmp.Ersw8fQ82Z/logs/20200121T185703/main.log
[2219:0121/185722.383344:INFO:CONSOLE(5)] "[uncaught exception]: Error: read ECONNRESET", source: /__w/1/VSCode-linux-x64/resources/app/out/bootstrap-window.js (5)
[2219:0121/185722.384081:INFO:CONSOLE(6)] "Error: read ECONNRESET
    at Pipe.onStreamRead (internal/stream_base_commons.js:183:27)", source: /__w/1/VSCode-linux-x64/resources/app/out/bootstrap-window.js (6)
[2219:0121/185722.384704:INFO:CONSOLE(180)] "Uncaught Error: read ECONNRESET", source: events.js (180)
[main 2020-01-21T18:57:22.386Z] IPC#vscode:exit 0
[main 2020-01-21T18:57:22.387Z] Lifecycle#kill()
Received signal 11 SEGV_MAPERR 000000000d3e
#0 0x558fdf8e6cd9 (/__w/1/VSCode-linux-x64/code-insiders+0x34e8cd8)
  r8: 0000000000000000  r9: 0000000000000000 r10: 00007ffd6d45ea30 r11: 0000000000000000
 r12: 0000025d0f84f090 r13: 0000025d0ef5b440 r14: 00007ffd6d45edb0 r15: 0000025d0f4c7600
  di: 0000025d0f6e6900  si: 0000025d0f6e6900  bp: 00007ffd6d45ed70  bx: 0000025d0f822780
  dx: 00007ffd6d45edb0  ax: 000000000000031e  cx: 0000558fe2fc4b98  sp: 00007ffd6d45ed70
  ip: 0000558fde4c2897 efl: 0000000000010206 cgf: 002b000000000033 erf: 0000000000000004
 trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000d3e

That IPC#vscode:exit 0 suggests that the shutdown happens normally through our IPC and that the crash occurs after app.exit().

bpasero commented 4 years ago

Here we go with your debug builds (from https://monacotools.visualstudio.com/DefaultCollection/Monaco/_build/results?buildId=65454&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=d2c76452-9b5b-53aa-b9e7-4eac61843d9f):

#0 0x5601fe0d4329 base::debug::CollectStackTrace()
#1 0x5601fe0362e3 base::debug::StackTrace::StackTrace()
#2 0x5601fe0d3ea1 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7f531a929330 <unknown>
#4 0x5601fd988c47 content::BrowserPluginEmbedder::DidSendScreenRectsCallback()
#5 0x5601fc1c376d electron::WebViewManager::ForEachGuest()
#6 0x5601fd988cf6 content::BrowserPluginEmbedder::DidSendScreenRects()
#7 0x5601fddba160 content::WebContentsImpl::SendScreenRects()
#8 0x5601ff11f4cb aura::Window::NotifyWindowHierarchyChangeAtReceiver()
#9 0x5601ff11f215 aura::Window::NotifyWindowHierarchyChangeDown()
#10 0x5601ff11f23b aura::Window::NotifyWindowHierarchyChangeDown()
#11 0x5601ff11f23b aura::Window::NotifyWindowHierarchyChangeDown()
#12 0x5601ff11c157 aura::Window::RemoveChild()
#13 0x5601ff11bba8 aura::Window::~Window()
#14 0x5601ff11c1fe aura::Window::~Window()
#15 0x5601ff11bbd2 aura::Window::~Window()
#16 0x5601ff11c1fe aura::Window::~Window()
#17 0x5601ff12ac78 aura::WindowTreeHost::DestroyDispatcher()
#18 0x56020109c086 views::DesktopWindowTreeHostPlatform::~DesktopWindowTreeHostPlatform()
#19 0x56020109615e views::DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11()
#20 0x56020108f420 views::DesktopNativeWidgetAura::OnHostClosed()
#21 0x560201098fdd views::DesktopWindowTreeHostX11::OnClosed()
#22 0x56020109cfc8 views::DesktopWindowTreeHostPlatform::CloseNow()
#23 0x56020107665c views::Widget::CloseNow()
#24 0x5601fc1c480a electron::WindowList::DestroyAllWindows()
#25 0x5601fc181ac2 electron::Browser::Exit()
#26 0x5601fc10810f mate::internal::Dispatcher<>::DispatchToCallback()
#27 0x5601fcd53f66 v8::internal::FunctionCallbackArguments::Call()
#28 0x5601fcd18199 v8::internal::(anonymous namespace)::HandleApiCallHelper<>()
#29 0x5601fcd1780d v8::internal::Builtin_Impl_HandleApiCall()
#30 0x5601fd60b3b9 <unknown>
  r8: 0000000000000000  r9: 0000000000000001 r10: 00007ffe16d6c970 r11: 0000000000000000
 r12: 00002adbe4115990 r13: 00002adbe38eb680 r14: 00007ffe16d6d040 r15: 00002adbe3857600
  di: 00002adbe4070000  si: 00002adbe4070000  bp: 00007ffe16d6d000  bx: 00002adbe4115540
  dx: 00007ffe16d6d040  ax: 0000000000000468  cx: 0000560201ae0c68  sp: 00007ffe16d6d000
bpasero commented 4 years ago

Changed another integration test that would bring up a webview: https://github.com/microsoft/vscode/commit/cd2e132fbc9ad2829c5a4a07a6fb00d5e3203943

bpasero commented 4 years ago

fixed via https://github.com/microsoft/vscode/commit/3388bf640edab64a5d6775db8101b29190990795 by destroying windows before calling app.exit.