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

Crash when toggling panel on newly opened folders #109970

Closed
rzhao271 opened this issue Nov 4, 2020 · 8 comments
Closed

Crash when toggling panel on newly opened folders #109970

rzhao271 opened this issue Nov 4, 2020 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@rzhao271
Copy link
Contributor

rzhao271 commented Nov 4, 2020

Version: 1.51.0-insider (user setup)
Commit: a5dfd9d
Date: 2020-11-03T19:58:29.881Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042
Steps to Reproduce:

  1. Open project with a minimized panel
  2. Toggle the panel with Ctrl+J
  3. VS Code crashes

This doesn't seem to happen on all projects, only newer ones/ones I recently cloned. I attached a dump file.
nov3-dump.zip

Does this issue occur when all extensions are disabled?: Yes

@rzhao271 rzhao271 added bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues labels Nov 4, 2020
@deepak1556
Copy link
Collaborator

Symbolicated trace

Operating system: Windows NT
                  10.0.19041 546
CPU: amd64
     family 6 model 126 stepping 5
     8 CPUs

GPU: UNKNOWN

Crash reason:  EXCEPTION_STACK_OVERFLOW
Crash address: 0x7ffc607e6e27
Process uptime: 5 seconds

Thread 0 (crashed)
 0  ntdll.dll!RtlpAllocateHeapInternal + 0x127
    rax = 0x000001e3f90c67d0   rdx = 0x0000000000000001
    rcx = 0x000001e3f8fc0000   rbx = 0x000001e3f90c0000
    rsi = 0x0000000000000000   rdi = 0x0000000000000002
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab604000
     r8 = 0x0000000000000018    r9 = 0x0000000000000000
    r10 = 0x0000000000000000   r11 = 0x0000000000000000
    r12 = 0x0000000000000018   r13 = 0x0000000000000020
    r14 = 0x0000000000000000   r15 = 0x0000000000000000
    rip = 0x00007ffc607e6e27
    Found by: given as instruction pointer in context
 1  KERNELBASE.dll!MultiByteToWideChar + 0x186
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab604090
    rip = 0x00007ffc5e34e8e6
    Found by: stack scanning
 2  Code - Insiders.exe!uv__convert_utf8_to_utf16 [util.c : 1306 + 0x11]
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab604160
    rip = 0x00007ff72b3108b0
    Found by: call frame info
 3  Code - Insiders.exe!uv_os_getenv [util.c : 1473 + 0xf]
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab6041c0
    rip = 0x00007ff72b3104a2
    Found by: call frame info
 4  Code - Insiders.exe!node::RealEnvStore::Get(v8::Isolate *,v8::Local<v8::String>) [node_env_var.cc : 67 + 0x8]
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab614240
    rip = 0x00007ff72bd6fdb6
    Found by: call frame info
 5  Code - Insiders.exe!node::EnvGetter [node_env_var.cc : 263 + 0xe]
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab6147e0
    rip = 0x00007ff72bd717bc
    Found by: call frame info
 6  Code - Insiders.exe!v8::internal::PropertyCallbackArguments::BasicCallNamedGetterCallback(void (*)(v8::Local<v8::Name>,v8::PropertyCallbackInfo<v8::Value> const &),v8::internal::Handle<v8::internal::Name>,v8::internal::Handle<v8::internal::Object>,v8::internal::Handle<v8::internal::Object>) [api-arguments-inl.h : 214 + 0x9]
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab614840
    rip = 0x00007ff72a035ba9
    Found by: call frame info
 7  Code - Insiders.exe!v8::internal::Runtime_LoadPropertyWithInterceptor(int,unsigned __int64 *,v8::internal::Isolate *) [ic.cc : 2746 + 0x222]
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab614940
    rip = 0x00007ff72a032755
    Found by: call frame info
 8  Code - Insiders.exe!Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 0x3c
    rbp = 0x000000c6ab6040b9   rsp = 0x000000c6ab614aa0
    rip = 0x00007ff72a7adb9c
    Found by: call frame info

@deepak1556
Copy link
Collaborator

Stack overrun when attempting to convert one of the process.env properties from utf-8 to utf-16. Can you print your process.env, we should be able to create a minimal repro.

@deepak1556 deepak1556 added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Nov 5, 2020
@rzhao271
Copy link
Contributor Author

rzhao271 commented Nov 5, 2020

I have better repro steps now.

  1. Rename a cloned project's directory to a folder name that was never opened before within VS Code (e.g. ~/vscode to ~/vscode2)
  2. Open folder on that project locally
  3. Toggle the panel (I use Ctrl+J)
  4. Program crashes.

However, if I merely show the panel with Ctrl+~, the panel and terminal show properly, and no crash occurs. Moreover, whenever I reload the project afterwards, toggling the panel works without crashing the program. If I rename the folder to another new name, toggling the panel once again crashes the program.

Attached a dump file where I cloned https://github.com/rzhao271/pyra-ttf then renamed the directory to pyra-ttf25 then launched code-insiders with the command
code-insiders --disable-extensions --crash-reporter-directory C:\Users\raymondzhao\pyra-ttf25
pyra-ttf25-dump.zip

@rzhao271 rzhao271 changed the title Crash when toggling panel Crash when toggling panel on newly opened folders Nov 5, 2020
@ejabu
Copy link

ejabu commented Jan 16, 2021

Me too, toggle panel crashed when

  1. Terminal is not opened
  2. Problem window is not opened
  3. Debug Console is not opened
  4. Just open VScode Window

@ejabu
Copy link

ejabu commented Jan 16, 2021

I got the quick fix.

we need to add this in keybindings.json

    {
        "key": "ctrl+j",
        "command": "workbench.action.togglePanel",
        "when": "terminalIsOpen"
    },
    {
        "key": "ctrl+j",
        "command": "workbench.action.terminal.new",
        "when": "!terminalIsOpen"
    },

According to this link, we can utilize the Context condition

/** A context key that is set when there is at least one opened integrated terminal. */
export const KEYBINDING_CONTEXT_TERMINAL_IS_OPEN = new RawContextKey('terminalIsOpen', false);

@rzhao271
Copy link
Contributor Author

Related fixed issue: #111463

@ejabu are you on the latest Insiders build (v1.53.0-insider)?

@rzhao271 rzhao271 added the info-needed Issue requires more information from poster label Jan 19, 2021
@ejabu
Copy link

ejabu commented Jan 31, 2021

Related fixed issue: #111463

@ejabu are you on the latest Insiders build (v1.53.0-insider)?

nope, I'm still using v1.52.1

@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants
@deepak1556 @ejabu @rzhao271 and others