Skip to content

Explore extension host error spamming the core #22804

Closed

Description

@kieferrm

Explore if the extension host can bring down the core using the API or through errors.

Activity

  1. kieferrm commented on Mar 20, 2017

    @kieferrm
    MemberAuthor

    I created an extension (see https://github.com/kieferrm/vscode-22804). It provides the following commands:
    screen shot 2017-03-20 at 8 10 50 am

    The idea behind those commands are that an extension does not intentionally try to behave badly but that it is an unintentional outcome of how it is implemented. For example, it produces tons of output, exceptions, problems, etc.

    Findings so far ordered by severity:

    • Flooding the core with output to output channels leads to a temporary freeze of the UI. Depending on the number of message written to the channel the UI can freeze for minutes. The user experiences the "Windows is not responding" dialog.
    • Flooding the core with problems leads to a temporary freeze of the UI. If an extension creates too many problems, the extension host dies with out-of-memory. I have also seen internal errors when creating more than 5000 problems, but this is not a reliably reproducible issue.
    • There are no issues when an extension generates thousands of exceptions.
    • There are no issues when an extension floods terminals with thousands of output messages.
    • Combining several types of "flooding" is purely additive, i.e. the user experience is not much worse.
  2. kieferrm commented on Mar 20, 2017

    @kieferrm
    MemberAuthor
  3. jrieken commented on Mar 20, 2017

    @jrieken
    Contributor

    cc Isidor Nikolic (@isidorn) for the output freeze which might be due to excessive (text) model updating and Sandeep Somavarapu (@sandy081) for the diagnostics view.

    have also seen internal errors when creating more than 5000 problems,

    Kai Maetzel (@kieferrm) There should be some guard that we don't produce too many diagnostics per resource but those checks are easy to around

  4. isidorn commented on Mar 20, 2017

    @isidorn

    We had previous issue reports regarding the slow output and we are currently already protecting ourselfs from excessive text model updating.

    More details can be found in this issue which also links to some other related issues #12265

  5. sandy081 commented on Mar 20, 2017

    @sandy081
    Member

    If I remember we fixed this performance issue with diagnostics when the extension created too many diagnostics - #11976. I will investigate the root-cause of the issue happening here

  6. jrieken commented on Mar 20, 2017

    @jrieken
    Contributor

    For crazy diagnostics we spend most time in receiving, esp parsing, data... Sandeep Somavarapu (@sandy081) is off the hook ;-)

    screen shot 2017-03-20 at 18 21 52

    crazy-diag.cpuprofile.txt

  7. jrieken commented on Mar 20, 2017

    @jrieken
    Contributor

    48seconds in OutputService#append. Isidor Nikolic (@isidorn) wins the the prize... Basically, this is all due to us making a lot of new strings and calling substr very often. Isidor Nikolic (@isidorn) let's sit and make this better.

    screen shot 2017-03-20 at 18 26 52

    crazy-output.cpuprofile.txt

  8. isidorn commented on Mar 21, 2017

    @isidorn

    Johannes Rieken (@jrieken) and me have improved the performance of appending to output channels by reducing the number of creating new strings. We now use a data structure which handles appending a compute a delta of an output in a more efficent way.
    Though when bombarding the output with 100000 messages vscode will still freeze for a couple of seconds due to the most time being spent in sending json objects around.

  9. locked and limited conversation to collaborators on Nov 18, 2017
  10. added a commit that references this issue on Sep 6, 2026
    e686ee0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions