Skip to content

Unix system executables terminate with error if transcription enabled #1920

Closed

Description

Steps to reproduce

Enable transcription (Start-Transcript)
Run any executable system command.

Expected behavior

Command executes and terminates cleanly.

Actual behavior

Command executes fine, but upon termination an error is always printed: Program 'foo' failed to run: The method or operation is not implemented.At line:1 char:1

Examples:

PS /> uname                                                                                                                                                                                                                                                              
Darwin
Program 'uname' failed to run: The method or operation is not implemented.At line:1 char:1
+ uname
+ ~~~~~.
At line:1 char:1
+ uname
+ ~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

PS /> curl google.com                                                                                                                                                                                                                                                    
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
Program 'curl' failed to run: The method or operation is not implemented.At line:1 char:1
+ curl google.com
+ ~~~~~~~~~~~~~~~.
At line:1 char:1
+ curl google.com
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

Does not happen if I capture the program's output into a variable:

PS /> $x = uname                                                                                                                                                                                                                                                         
PS /> $x                                                                                                                                                                                                                                                                 
Darwin

Stack:

PS /> $error[0].Exception.ToString()                                                                                                                                                                                                                                     
System.Management.Automation.ApplicationFailedException: Program 'curl' failed to run: The method or operation is not implemented.At line:1 char:1
+ curl google.com
+ ~~~~~~~~~~~~~~~. ---> System.NotImplementedException: The method or operation is not implemented.
   at Microsoft.PowerShell.ConsoleHostRawUserInterface.GetBufferContents(Rectangle rectangle)
   at System.Management.Automation.Internal.Host.InternalHostRawUserInterface.GetBufferContents(Rectangle r)
   at System.Management.Automation.NativeCommandProcessor.Complete()
   --- End of inner exception stack trace ---
   at System.Management.Automation.NativeCommandProcessor.Complete()
   at System.Management.Automation.CommandProcessorBase.DoComplete()
   at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop)
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Environment data

OSX Yosemite 14.5.0

> $PSVersionTable
PSVersion                      6.0.0-alpha                                                                                                                                                                                                                              
PSEdition                      Core                                                                                                                                                                                                                                     
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                  
BuildVersion                   3.0.0.0                                                                                                                                                                                                                                  
GitCommitId                    v6.0.0-alpha.9                                                                                                                                                                                                                           
CLRVersion                                                                                                                                                                                                                                                              
WSManStackVersion              3.0                                                                                                                                                                                                                                      
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                      
SerializationVersion           1.1.0.1 

Activity

  1. daviwil commented on Aug 19, 2016

    @daviwil
    Contributor

    Strange, I'm not seeing that on my MacBook:

    screen shot 2016-08-18 at 5 21 59 pm

    I'm running El Capitan, I wonder if the older OSX has issues? Looks like the console host APIs are playing up for some reason.

  2. latkin commented on Aug 19, 2016

    @latkin
    ContributorAuthor

    Ah! Please shoo me away, if you like, as I'm not technically running a compliant version of Mac. Would be nice to have confirmation that these are known-bad APIs on Yosemite.

  3. latkin commented on Aug 19, 2016

    @latkin
    ContributorAuthor

    I just upgraded to OSX El Capitan and I'm still seeing this. :-/

    OS details: Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64

  4. latkin commented on Aug 19, 2016

    @latkin
    ContributorAuthor

    Open source FTW! Problem is due to the fact that I am transcribing. Native apps will always fail like this on Unix if you have transcription enabled. After disabling transcription, things work as expected.

    The error stack points to the not-implemented (on UNIX) method:

    public override BufferCell[,] GetBufferContents(Rectangle rectangle)
    {
    throw new NotImplementedException("The method or operation is not implemented.");
    }

    Following that back, this codepath gets invoked when you run a native application standalone, with transcription enabled:

    Host.BufferCell[,] bufferContents = this.Command.Context.EngineHostInterface.UI.RawUI.GetBufferContents(

  5. changed the title [-]All system executables terminate with error[/-] [+]Unix system executables terminate with error if transcription enabled[/+] on Aug 19, 2016
  6. daviwil commented on Aug 19, 2016

    @daviwil
    Contributor

    Thanks a lot for the excellent analysis! Hopefully someone with console host knowledge can chime in about why this might be causing trouble on OS X.

  7. added this to the milestone on Sep 29, 2016
  8. modified the milestones: , on May 24, 2017
  9. joeyaiello commented on May 24, 2017

    @joeyaiello
    Contributor

    Bruce Payette (@BrucePay) or James Truher (@JamesWTruher), can you please validate this on macOS? Works fine for me on CentOS 7 right now:

    Start-Transcript
    uname
    curl google.com
    Stop-Transcript
    cat ~/PowerShell_transcript*.txt
  10. joeyaiello commented on Sep 19, 2017

    @joeyaiello
    Contributor

    Andrew (@anmenaga) if this doesn't repro anymore, feel free to close it.

  11. modified the milestones: , on Sep 20, 2017
  12. SteveL-MSFT commented on Sep 20, 2017

    @SteveL-MSFT
    Member

    This repros for me on Darwin 16.7.0 Darwin Kernel Version 16.7.0

  13. SteveL-MSFT commented on Sep 20, 2017

    @SteveL-MSFT
    Member

    I found the issue, working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

OS-macOSResolution-FixedWG-Interactive-Console

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions