-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Description
Issue Type: Bug
When running a process from the integrated terminal it seems some file-descriptors are inherited. For example my bash has some open file-descriptors to various asar and font files (and a lot of shared memory!).
To reproduce (on Linux) use the following command directly in the integrated Terminal: ls -l /proc/$$/fd
This lists all open files for the current process (the bash) from the /proc file system. If you use the -l switch it shows to which file the file-descriptor points too.
Example output (in summary because of long output)
$ ls -l /proc/$$/fd
total 0
lrwx------ 1 johannes johannes 64 Sep 17 12:10 0 -> /dev/pts/12
lrwx------ 1 johannes johannes 64 Sep 17 12:10 1 -> /dev/pts/12
lr-x------ 1 johannes johannes 64 Sep 17 12:10 10 -> /usr/share/code/pdf_viewer_resources.pak
lrwx------ 1 johannes johannes 64 Sep 17 12:10 100 -> '/dev/shm/.org.chromium.Chromium.HWn72A (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 101 -> '/dev/shm/.org.chromium.Chromium.xhltP6 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 102 -> '/dev/shm/.org.chromium.Chromium.mGbMg5 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 103 -> '/dev/shm/.org.chromium.Chromium.tgA7H3 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 104 -> '/dev/shm/.org.chromium.Chromium.iQqruz (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 105 -> '/dev/shm/.org.chromium.Chromium.xo8u0x (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 106 -> '/dev/shm/.org.chromium.Chromium.VwDTi2 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 107 -> '/dev/shm/.org.chromium.Chromium.sptiBw (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 108 -> '/dev/shm/.org.chromium.Chromium.vRJj7S (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 109 -> '/dev/shm/.org.chromium.Chromium.8xnka2 (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 11 -> /usr/share/code/blink_image_resources_200_percent.pak
lrwx------ 1 johannes johannes 64 Sep 17 12:10 110 -> '/dev/shm/.org.chromium.Chromium.Md4G4x (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 112 -> '/dev/shm/.org.chromium.Chromium.b7N4Y3 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 113 -> '/dev/shm/.org.chromium.Chromium.XvX6Cs (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 114 -> '/dev/shm/.org.chromium.Chromium.vdpNXz (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 117 -> '/dev/shm/.org.chromium.Chromium.AbehVB (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 119 -> '/dev/shm/.org.chromium.Chromium.JXv2T7 (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 12 -> /usr/share/code/content_resources_200_percent.pak
lrwx------ 1 johannes johannes 64 Sep 17 12:10 121 -> '/dev/shm/.org.chromium.Chromium.o5F609 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 122 -> '/dev/shm/.org.chromium.Chromium.wRzQSD (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 123 -> '/dev/shm/.org.chromium.Chromium.Mr52wG (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 124 -> '/dev/shm/.org.chromium.Chromium.L6r02c (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 125 -> '/dev/shm/.org.chromium.Chromium.Kf0YyJ (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 126 -> '/dev/shm/.org.chromium.Chromium.t87X4f (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 127 -> /usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 128 -> /usr/share/fonts/truetype/liberation2/LiberationMono-Bold.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 129 -> /usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 13 -> /usr/share/code/ui_resources_200_percent.pak
lrwx------ 1 johannes johannes 64 Sep 17 12:10 130 -> '/dev/shm/.org.chromium.Chromium.5vO06i (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 131 -> '/dev/shm/.org.chromium.Chromium.EU0YAM (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 132 -> '/dev/shm/.org.chromium.Chromium.Dq7802 (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 14 -> /usr/share/code/views_resources_200_percent.pak
lrwx------ 1 johannes johannes 64 Sep 17 12:10 17 -> 'socket:[609354]'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 18 -> /usr/share/code/natives_blob.bin
lr-x------ 1 johannes johannes 64 Sep 17 12:10 19 -> /usr/share/code/snapshot_blob.bin
lrwx------ 1 johannes johannes 64 Sep 17 12:10 2 -> /dev/pts/12
lrwx------ 1 johannes johannes 64 Sep 17 12:10 24 -> 'anon_inode:[eventpoll]'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 255 -> /dev/pts/12
lrwx------ 1 johannes johannes 64 Sep 17 12:10 30 -> 'socket:[604449]'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 36 -> 'socket:[602066]'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 37 -> /usr/share/code/resources/app/node_modules.asar
lr-x------ 1 johannes johannes 64 Sep 17 12:10 38 -> /usr/share/code/resources/electron.asar
lrwx------ 1 johannes johannes 64 Sep 17 12:10 39 -> '/dev/shm/.org.chromium.Chromium.yM9tCr (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 4 -> 'socket:[43671]'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 40 -> /usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf
lrwx------ 1 johannes johannes 64 Sep 17 12:10 41 -> '/dev/shm/.org.chromium.Chromium.C94wW5 (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 42 -> /usr/share/fonts/truetype/freefont/FreeSerif.ttf
lrwx------ 1 johannes johannes 64 Sep 17 12:10 43 -> '/dev/shm/.org.chromium.Chromium.pTAaGy (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 44 -> '/dev/shm/.org.chromium.Chromium.CiV1s5 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 45 -> '/dev/shm/.org.chromium.Chromium.PEZWfC (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 48 -> /usr/share/fonts/truetype/liberation2/LiberationSerif-Regular.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 5 -> /usr/share/code/icudtl.dat
lrwx------ 1 johannes johannes 64 Sep 17 12:10 51 -> '/dev/shm/.org.chromium.Chromium.yOHgod (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 53 -> /usr/share/fonts/truetype/liberation2/LiberationMono-Regular.ttf
lrwx------ 1 johannes johannes 64 Sep 17 12:10 54 -> '/dev/shm/.org.chromium.Chromium.xUg3RS (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 55 -> /usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 57 -> /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
lrwx------ 1 johannes johannes 64 Sep 17 12:10 58 -> '/dev/shm/.org.chromium.Chromium.0MbhSI (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 6 -> /usr/share/code/snapshot_blob.bin
lr-x------ 1 johannes johannes 64 Sep 17 12:10 60 -> /usr/share/fonts/truetype/ubuntu/UbuntuMono-RI.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 61 -> /usr/share/fonts/truetype/liberation2/LiberationMono-Italic.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 62 -> /usr/share/fonts/truetype/ubuntu/UbuntuMono-RI.ttf
lrwx------ 1 johannes johannes 64 Sep 17 12:10 63 -> '/dev/shm/.org.chromium.Chromium.WGxD5c (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 64 -> '/dev/shm/.org.chromium.Chromium.auH0iH (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 65 -> '/dev/shm/.org.chromium.Chromium.WW6CK2 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 66 -> '/dev/shm/.org.chromium.Chromium.rFgowb (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 67 -> '/dev/shm/.org.chromium.Chromium.yPgMJF (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 68 -> '/dev/shm/.org.chromium.Chromium.LEEjo8 (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 7 -> /usr/share/code/natives_blob.bin
lr-x------ 1 johannes johannes 64 Sep 17 12:10 70 -> /usr/share/fonts/truetype/ubuntu/Ubuntu-RI.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 72 -> /usr/share/fonts/truetype/liberation2/LiberationSans-Italic.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 75 -> /usr/share/fonts/truetype/ubuntu/Ubuntu-RI.ttf
lrwx------ 1 johannes johannes 64 Sep 17 12:10 76 -> /dev/ptmx
lr-x------ 1 johannes johannes 64 Sep 17 12:10 78 -> /usr/share/fonts/truetype/liberation2/LiberationSans-Regular.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 79 -> /usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 8 -> /usr/share/code/locales/en-US.pak
lr-x------ 1 johannes johannes 64 Sep 17 12:10 80 -> /usr/share/fonts/truetype/ubuntu/Ubuntu-B.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 81 -> /usr/share/fonts/truetype/liberation2/LiberationSans-Bold.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 82 -> /usr/share/fonts/truetype/ubuntu/Ubuntu-B.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 83 -> /usr/share/fonts/truetype/oxygen/Oxygen-Sans.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 84 -> /usr/share/fonts/truetype/liberation2/LiberationSerif-Regular.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 85 -> /usr/share/fonts/opentype/font-awesome/FontAwesome.otf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 86 -> /usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 87 -> /usr/share/fonts/truetype/liberation2/LiberationMono-Regular.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 88 -> /usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 89 -> /usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 9 -> /usr/share/code/content_shell.pak
lrwx------ 1 johannes johannes 64 Sep 17 12:10 90 -> '/dev/shm/.org.chromium.Chromium.9VuhX9 (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 92 -> '/dev/shm/.org.chromium.Chromium.pLcNaE (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 93 -> '/dev/shm/.org.chromium.Chromium.RU2r1N (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 94 -> '/dev/shm/.org.chromium.Chromium.JOHE9m (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 95 -> '/dev/shm/.org.chromium.Chromium.kLfShW (deleted)'
lrwx------ 1 johannes johannes 64 Sep 17 12:10 96 -> '/dev/shm/.org.chromium.Chromium.cV6mrv (deleted)'
lr-x------ 1 johannes johannes 64 Sep 17 12:10 97 -> /usr/share/fonts/truetype/liberation2/LiberationSans-Regular.ttf
lr-x------ 1 johannes johannes 64 Sep 17 12:10 98 -> /usr/share/fonts/truetype/freefont/FreeMono.ttf
lrwx------ 1 johannes johannes 64 Sep 17 12:10 99 -> '/dev/shm/.org.chromium.Chromium.fFzQBC (deleted)'
I can see no direct issue for now but it is possible to access files or shared memory this way and probably crash VScode this way. Additionally it is completely unexpected behaviour (i was stumped why my single-file python process had over 100 open file descriptors).
VS Code version: Code 1.27.1 (5944e81, 2018-09-06T09:21:47.222Z)
OS version: Linux x64 4.15.0-34-generic
Ubuntu 18.04
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 x 1487) |
| GPU Status | 2d_canvas: enabled checker_imaging: disabled_off flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: disabled_software rasterization: disabled_software video_decode: unavailable_software video_encode: unavailable_software webgl: enabled webgl2: enabled |
| Load (avg) | 1, 1, 1 |
| Memory (System) | 31.34GB (15.56GB free) |
| Process Argv | /usr/share/code/code --unity-launch |
| Screen Reader | no |
| VM | 0% |
Extensions (26)
| Extension | Author (truncated) | Version |
|---|---|---|
| EditorConfig | Edi | 0.12.4 |
| postgresql | JPT | 0.0.2 |
| better-toml | bun | 0.3.2 |
| npm-intellisense | chr | 1.3.0 |
| vscode-eslint | dba | 1.6.0 |
| vscode-dash | dee | 1.10.0 |
| jupyter | don | 1.1.4 |
| gitlens | eam | 8.5.6 |
| vscode-npm-script | eg2 | 0.3.5 |
| vscode-npm | fkn | 3.3.0 |
| gc-excelviewer | Gra | 2.1.26 |
| todo-tree | Gru | 0.0.86 |
| node-module-intellisense | lei | 1.5.0 |
| restructuredtext | lex | 78.0.0 |
| rainbow-csv | mec | 0.5.0 |
| ecdc | mit | 0.12.0 |
| python | ms- | 2018.8.0 |
| cpptools | ms- | 0.18.1 |
| vsliveshare | ms- | 0.3.666 |
| vscode-versionlens | pfl | 0.21.1 |
| vscode-sort-json | ric | 1.13.0 |
| vscode-icons | rob | 7.26.0 |
| rust | rus | 0.4.10 |
| vscode-hexdump | sle | 1.6.0 |
| vscode-lldb | vad | 0.8.9 |
| debug | web | 0.22.0 |