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

Increasing the limit of maximum open files causes a crash #21061

Closed
sogartar opened this issue Apr 15, 2023 · 13 comments
Closed

Increasing the limit of maximum open files causes a crash #21061

sogartar opened this issue Apr 15, 2023 · 13 comments
Assignees
Labels
area-editor-* User-facing catch-all area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team verified Verification succeeded
Milestone

Comments

@sogartar
Copy link

Type: Bug

  1. Raise the OS max open files limit per process from 1024 to 4096.
ulimit -n 4096
  1. Start vscode
code
  1. Open any Python file in the editor. Even an empty file will do.
    After several seconds vscode crashes with
The window terminated unexpectedly (reason: 'crashed', code: '133').

Sometimes instead of a crash it freezes.

Note that with a limit of 8192 open files I did not observe the crash.

Extension version: 2023.6.0
VS Code version: Code 1.77.3 (704ed70d4fd1c6bd6342c436f1ede30d1cff4710, 2023-04-12T09:16:52.732Z)
OS version: Linux x64 5.15.0-69-generic
Modes:
Sandboxed: No

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz (16 x 2500)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 1, 2, 1
Memory (System) 31.11GB (21.80GB free)
Process Argv --crash-reporter-id aee7e0be-4af2-4aea-a5ac-a548492d0a10
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vscaac:30438847
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30610678
nodejswelcome1cf:30587006
2e4cg342:30602488
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
vsccsb:30705552
azdwalk:30687957
pythonms35:30701012
pythonclientmvcf:30713944

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Apr 15, 2023
@JonKsander1984
Copy link

Так делать не стоит процессор может перегреться

@karthiknadig
Copy link
Member

@sogartar Is this python specific or general VS Code?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Apr 17, 2023
@sogartar
Copy link
Author

@karthiknadig It happens only when the Python extension is enabled.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Apr 17, 2023
@karrtikr
Copy link

Please provide the logs as mentioned in the issue template. Set python.logging.level to debug in User settings, reload window, then perform the steps to reproduce before providing the logs.

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Apr 17, 2023
@sogartar
Copy link
Author

@karrtikr how do I tell vscode to log to a file without buffering? I need this since the vscode app crashes before I can copy the log from within.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Apr 17, 2023
@karrtikr
Copy link

karrtikr commented May 9, 2023

@karthiknadig Do we currently have a way to capture logs in a file in that manner, perhaps an environment variable?

@sogartar Does the workspace folder you're working on contain a huge number of files? Perhaps you can use the following setting to exclude such directories:
image

@github-actions github-actions bot added the info-needed Issue requires more information from poster label May 9, 2023
@karrtikr karrtikr added area-editor-* User-facing catch-all info-needed Issue requires more information from poster and removed info-needed Issue requires more information from poster labels May 9, 2023
@karthiknadig
Copy link
Member

@sogartar Try adding this environment variable:

VSC_PYTHON_LOG_FILE=~/python.log

@sogartar
Copy link
Author

@sogartar Try adding this environment variable:

VSC_PYTHON_LOG_FILE=~/python.log

Using this I was able to generate a log before the crash.
python-log.zip

@sogartar Does the workspace folder you're working on contain a huge number of files?

Yes, it has many files.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label May 17, 2023
@karrtikr
Copy link

karrtikr commented Jul 21, 2023

Based on logs it seems you have opened several workspace folders at the same time, is that accurate?

Also, all of the watchers initialized are due to testing:

traceVerbose(`Testing: Setting up watcher for ${workspace.uri.fsPath}`);

Reassigning to @eleanorjboyd but it likely looks like an issue with VS Code when watching a lot of workspace folders. The fact that testing is using a very general watcher pattern does not help either:

const pattern = new RelativePattern(workspace, '**/{settings.json,pytest.ini,pyproject.toml,setup.cfg}');

const pattern = new RelativePattern(workspace, '**/*.py');

Maybe we could try to restrict it if possible.

@karrtikr karrtikr assigned eleanorjboyd and unassigned karrtikr Jul 21, 2023
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 21, 2023
@karrtikr karrtikr added area-testing and removed info-needed Issue requires more information from poster labels Jul 21, 2023
@eleanorjboyd
Copy link
Member

related to this issue: #21014, update should be made on what files are watched.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 21, 2023
@sogartar
Copy link
Author

Based on logs it seems you have opened several workspace folders at the same time, is that accurate?

Yes.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 25, 2023
@eleanorjboyd
Copy link
Member

@karrtikr and @karthiknadig, it makes sense to change the file watcher to restrict test searching in too many places. Do we have normal set of file structures we ignore such as the image below? Want to make sure I choose ones we are confident do not apply. Thanks

Perhaps you can use the following setting to exclude such directories: image

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 31, 2023
@eleanorjboyd
Copy link
Member

This change will be out on vscode insiders tomorrow if you want to give it a chance and see if it improves your experience! Thanks

@eleanorjboyd eleanorjboyd added this to the August 2023 milestone Aug 2, 2023
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Oct 25, 2023
@DonJayamanne DonJayamanne added the verified Verification succeeded label Oct 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants