esnet / netshell

Kernel and companion software that support ENOS applications (NOT ACTIVELY MAINTAINED)
Other
6 stars 1 forks source link

Typing an particular set of incorrect python crashes the SSH session #14

Open lomaxfrog opened 8 years ago

lomaxfrog commented 8 years ago

How to reproduce:

NetShell> python

The ssh session hangs and the python error message shows on the netshell console (karaf). Seems to be an incorrect exception handling and outputstream,

lomaxfrog commented 8 years ago

Note that it take several attempt to generate the problem before it actually happens.

Another fact: this problem seem to happen only when NetShell is running within karaf. It does not happen when NetShell is running as a standalone.

Raising the estimate from 1 to 2 due the perceived increased complexity of debugging this.

lomaxfrog commented 8 years ago

The problem is directly related to a NetShell Python Shell feature: python environment can be shared, in other words, having a python interpreter running in same as a previous instance. This has several problem because it can only be done safely if sharing the environment of dead interpreters, but the most useful usage is to share it with live interpreters. For instance the MP-VPN CLI shares the environment of the instance of the service.

This causes many sort of problems because the share state include stdin, stdout, stderr, python path, and some other state.

The proposed fix is to:

Due to refactoring, raising complexity to 5