Repository navigation
Closed
Labels
Milestone
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
daviwil commentedon Aug 19, 2016
Strange, I'm not seeing that on my MacBook:
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.
latkin commentedon Aug 19, 2016
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.
latkin commentedon Aug 19, 2016
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_64latkin commentedon Aug 19, 2016
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:PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs
Lines 1738 to 1741 in c1faf1e
Following that back, this codepath gets invoked when you run a native application standalone, with transcription enabled:
PowerShell/src/System.Management.Automation/engine/NativeCommandProcessor.cs
Line 586 in c1faf1e
[-]All system executables terminate with error[/-][+]Unix system executables terminate with error if transcription enabled[/+]daviwil commentedon Aug 19, 2016
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.
joeyaiello commentedon May 24, 2017
Bruce Payette (@BrucePay) or James Truher (@JamesWTruher), can you please validate this on macOS? Works fine for me on CentOS 7 right now:
joeyaiello commentedon Sep 19, 2017
Andrew (@anmenaga) if this doesn't repro anymore, feel free to close it.
SteveL-MSFT commentedon Sep 20, 2017
This repros for me on Darwin 16.7.0 Darwin Kernel Version 16.7.0
SteveL-MSFT commentedon Sep 20, 2017
I found the issue, working on a fix.