waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.

Home Page:https://fuqua.io/CSharpRepl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CTRL+X sometimes crashes on Linux

Emik03 opened this issue · comments

commented

Version

C# REPL 0.6.6+ba21d409af4dce77f8be07f6a61cdb24cd19bb29

What happened?

Clearing the clipboard made it stop crashing, possibly related to #325, but having 🏴󠁧󠁢󠁥󠁮󠁧󠁿 in the clipboard, or arbitrary large text doesn't seem to annoy it in any capacity.

The keystrokes leading to the crash are: csharprepl --trace, ENTER, CTRL+X.

csharprepl --trace

Writing trace log to /home/emik/csharprepl-tracelog-2024-01-10.txt

Welcome to the C# REPL (Read Eval Print Loop)!
Type C# expressions and statements at the prompt and press Enter to evaluate them.
Type help to learn more, exit to quit, and clear to clear your terminal.

> Unhandled exception. System.Exception: Process timed out. Command line: bash -c "cat /tmp/tmpWDKMZj.tmp | xsel -i --clipboard ".
Output: 
Error: 
   at BashRunner.Run(String commandLine) in /_/src/TextCopy/BashRunner.cs:line 32
   at LinuxClipboard.InnerSetText(String tempFileName) in /_/src/TextCopy/LinuxClipboard_2.1.cs:line 42
   at LinuxClipboard.SetTextAsync(String text, CancellationToken cancellation) in /_/src/TextCopy/LinuxClipboard_2.1.cs:line 22
   at PrettyPrompt.TextSelection.WrappedClipboard.SetTextAsync(String text, CancellationToken cancellation)
   at PrettyPrompt.Panes.CodePane.OnKeyDown(KeyPress key, CancellationToken cancellationToken)
   at PrettyPrompt.Prompt.<>c__DisplayClass9_0.<<ReadLineAsync>g__InterpretKeyPress|0>d.MoveNext()
--- End of stack trace from previous location ---
   at PrettyPrompt.Prompt.ReadLineAsync()
   at CSharpRepl.ReadEvalPrintLoop.RunAsync(Configuration config) in /_/CSharpRepl/ReadEvalPrintLoop.cs:line 49
   at CSharpRepl.Program.Main(String[] args) in /_/CSharpRepl/Program.cs:line 68
   at CSharpRepl.Program.Main(String[] args) in /_/CSharpRepl/Program.cs:line 74
   at CSharpRepl.Program.<Main>(String[] args)
Aborted (core dumped)

Causes following log.

2024-01-10T21:12:13 - Trace session starting
2024-01-10T21:12:13 - Starting background initialization
2024-01-10T21:12:13 - Discovered dotnet version .NET Core SDK 8.0.100 at /home/emik/.dotnet/sdk/8.0.100.
2024-01-10T21:12:13 - Available Reference Assemblies: "/home/emik/.dotnet/packs/Microsoft.NETCore.App.Ref": ["5.0.0", "8.0.0-rc.1.23419.4", "6.0.22", "7.0.11", "6.0.23", "7.0.12", "8.0.0-rc.2.23479.6", "6.0.24", "7.0.13", "6.0.25", "7.0.14", "8.0.0", "3.1.0", "3.0.0"]
2024-01-10T21:12:13 - Available Implementation Assemblies: "/home/emik/.dotnet/shared/Microsoft.NETCore.App": ["5.0.17", "6.0.25", "7.0.14", "8.0.0", "3.1.32", "3.0.3", "2.2.7", "2.1.30", "2.0.9"]
2024-01-10T21:12:13 - .NET Version: Microsoft.NETCore.App / 8.0.0
2024-01-10T21:12:13 - Reference Assembly Paths: /home/emik/.dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/ref/net8.0
2024-01-10T21:12:13 - Implementation Assembly Paths: /home/emik/.dotnet/shared/Microsoft.NETCore.App/8.0.0
2024-01-10T21:12:13 - Shared Framework Paths: /home/emik/.dotnet/shared/Microsoft.NETCore.App/8.0.0
2024-01-10T21:12:13 - Loaded Reference Assemblies: "/home/emik/.dotnet/packs/Microsoft.NETCore.App.Ref/8.0.0/ref/net8.0": ["System.IO.UnmanagedMemoryStream.dll", "System.Runtime.Numerics.dll", "System.Reflection.Emit.Lightweight.dll", "System.Memory.dll", "System.Net.WebClient.dll", "System.Text.RegularExpressions.dll", "System.Xml.XDocument.dll", "System.Runtime.InteropServices.RuntimeInformation.dll", "System.Collections.Specialized.dll", "System.Runtime.CompilerServices.VisualC.dll", "System.Xml.ReaderWriter.dll", "System.Linq.Parallel.dll", "System.ComponentModel.DataAnnotations.dll", "Microsoft.CSharp.dll", "Microsoft.VisualBasic.Core.dll", "System.IO.Compression.Brotli.dll", "System.Data.dll", "System.Dynamic.Runtime.dll", "System.AppContext.dll", "System.ServiceModel.Web.dll", "System.Xml.XPath.dll", "System.Runtime.InteropServices.JavaScript.dll", "System.Security.Cryptography.X509Certificates.dll", "System.Security.Principal.dll", "System.Globalization.Calendars.dll", "System.Formats.Tar.dll", "System.Net.WebSockets.dll", "System.Linq.Expressions.dll", "System.Runtime.Serialization.dll", "System.Net.NameResolution.dll", "netstandard.dll", "System.ObjectModel.dll", "System.Xml.dll", "System.Security.Cryptography.Cng.dll", "System.Numerics.dll", "System.Reflection.Emit.ILGeneration.dll", "System.Diagnostics.DiagnosticSource.dll", "System.Transactions.dll", "System.IO.Compression.FileSystem.dll", "System.Runtime.CompilerServices.Unsafe.dll", "System.Windows.dll", "System.Security.Principal.Windows.dll", "System.Reflection.TypeExtensions.dll", "System.Runtime.Serialization.Formatters.dll", "System.Net.Ping.dll", "System.Net.Quic.dll", "System.Data.Common.dll", "System.Console.dll", "System.Buffers.dll", "System.Text.Encoding.dll", "System.Net.WebSockets.Client.dll", "System.Threading.Tasks.dll", "System.Security.dll", "System.Security.Cryptography.Algorithms.dll", "System.Diagnostics.Contracts.dll", "System.Security.Cryptography.OpenSsl.dll", "Microsoft.VisualBasic.dll", "System.Security.SecureString.dll", "System.Collections.Concurrent.dll", "System.Formats.Asn1.dll", "System.Net.WebProxy.dll", "System.Net.Http.dll", "System.Security.Cryptography.Encoding.dll", "System.Security.AccessControl.dll", "System.Diagnostics.Tracing.dll", "System.Threading.dll", "System.Runtime.Loader.dll", "mscorlib.dll", "System.Net.Security.dll", "System.Diagnostics.Tools.dll", "System.Security.Claims.dll", "System.Security.Cryptography.Primitives.dll", "System.Collections.Immutable.dll", "System.Runtime.Intrinsics.dll", "System.IO.Compression.ZipFile.dll", "System.Net.Primitives.dll", "System.Net.dll", "System.Linq.dll", "System.Threading.Channels.dll", "System.Collections.dll", "System.Text.Encoding.Extensions.dll", "System.ComponentModel.EventBasedAsync.dll", "System.ComponentModel.dll", "System.dll", "System.Resources.ResourceManager.dll", "System.Core.dll", "System.Net.Http.Json.dll", "System.Runtime.InteropServices.dll", "System.Net.Mail.dll", "System.Runtime.dll", "System.Xml.XmlDocument.dll", "System.Reflection.Primitives.dll", "System.Diagnostics.Debug.dll", "System.Web.HttpUtility.dll", "System.Diagnostics.TextWriterTraceListener.dll", "System.Reflection.Extensions.dll", "System.ValueTuple.dll", "System.IO.MemoryMappedFiles.dll", "System.Xml.Serialization.dll", "System.Diagnostics.FileVersionInfo.dll", "System.Runtime.Serialization.Primitives.dll", "System.Reflection.Emit.dll", "System.Security.Cryptography.Csp.dll", "System.Diagnostics.Process.dll", "System.IO.FileSystem.Watcher.dll", "System.Xml.XPath.XDocument.dll", "System.Diagnostics.TraceSource.dll", "System.Net.Sockets.dll", "Microsoft.Win32.Primitives.dll", "System.Drawing.Primitives.dll", "System.ServiceProcess.dll", "System.Net.HttpListener.dll", "System.ComponentModel.Annotations.dll", "System.IO.Compression.dll", "System.Threading.Tasks.Extensions.dll", "System.Globalization.Extensions.dll", "System.Reflection.Metadata.dll", "System.Data.DataSetExtensions.dll", "System.Runtime.Serialization.Json.dll", "System.Net.WebHeaderCollection.dll", "System.IO.Pipes.AccessControl.dll", "System.IO.FileSystem.DriveInfo.dll", "WindowsBase.dll", "System.Threading.Tasks.Dataflow.dll", "System.Diagnostics.StackTrace.dll", "System.Runtime.Handles.dll", "System.Text.Encodings.Web.dll", "System.IO.FileSystem.AccessControl.dll", "System.Net.NetworkInformation.dll", "System.IO.IsolatedStorage.dll", "System.Collections.NonGeneric.dll", "System.Numerics.Vectors.dll", "System.Web.dll", "System.Runtime.Serialization.Xml.dll", "System.ComponentModel.TypeConverter.dll", "System.Drawing.dll", "System.Reflection.dll", "System.Configuration.dll", "System.Runtime.Extensions.dll", "System.Text.Encoding.CodePages.dll", "System.ComponentModel.Primitives.dll", "System.Threading.Timer.dll", "System.Resources.Reader.dll", "System.Net.ServicePoint.dll", "System.Resources.Writer.dll", "System.Threading.ThreadPool.dll", "System.Net.Requests.dll", "System.Text.Json.dll", "System.IO.FileSystem.dll", "System.Linq.Queryable.dll", "System.Reflection.DispatchProxy.dll", "System.Globalization.dll", "System.IO.FileSystem.Primitives.dll", "System.Threading.Overlapped.dll", "System.IO.Pipes.dll", "System.Xml.XmlSerializer.dll", "System.Transactions.Local.dll", "Microsoft.Win32.Registry.dll", "System.Security.Cryptography.dll", "System.Threading.Thread.dll", "System.Xml.Linq.dll", "System.Threading.Tasks.Parallel.dll", "System.IO.dll"]
2024-01-10T21:12:13 - Loaded Implementation Assemblies: "/home/emik/.dotnet/shared/Microsoft.NETCore.App/8.0.0": ["System.Text.Encoding.Extensions.dll", "System.Reflection.Extensions.dll", "System.ValueTuple.dll", "System.IO.MemoryMappedFiles.dll", "System.Xml.Serialization.dll", "System.Diagnostics.FileVersionInfo.dll", "System.Runtime.Serialization.Primitives.dll", "System.Reflection.Emit.dll", "System.Security.Cryptography.Csp.dll", "System.Diagnostics.Process.dll", "System.IO.FileSystem.Watcher.dll", "System.Xml.XPath.XDocument.dll", "System.Diagnostics.TraceSource.dll", "System.Net.Sockets.dll", "System.Globalization.Calendars.dll", "System.Net.WebSockets.dll", "System.Drawing.dll", "System.Reflection.dll", "System.Configuration.dll", "System.Runtime.Extensions.dll", "System.Text.Encoding.CodePages.dll", "System.ComponentModel.Primitives.dll", "System.Threading.Timer.dll", "System.Resources.Reader.dll", "System.Net.ServicePoint.dll", "System.Resources.Writer.dll", "System.Threading.ThreadPool.dll", "System.Net.Requests.dll", "Microsoft.Win32.Primitives.dll", "System.Runtime.Numerics.dll", "System.Memory.dll", "System.Text.RegularExpressions.dll", "System.Runtime.InteropServices.RuntimeInformation.dll", "System.Runtime.CompilerServices.VisualC.dll", "System.Linq.Parallel.dll", "Microsoft.CSharp.dll", "System.IO.Compression.Brotli.dll", "System.Dynamic.Runtime.dll", "System.ServiceModel.Web.dll", "System.Runtime.InteropServices.JavaScript.dll", "System.Security.Principal.dll", "System.Formats.Tar.dll", "System.Text.Json.dll", "System.IO.FileSystem.dll", "System.ComponentModel.EventBasedAsync.dll", "System.ComponentModel.dll", "System.dll", "System.Resources.ResourceManager.dll", "System.Core.dll", "System.Net.Http.Json.dll", "System.Runtime.InteropServices.dll", "System.Net.Mail.dll", "System.Runtime.dll", "System.Xml.XmlDocument.dll", "System.Reflection.Primitives.dll", "System.Diagnostics.Debug.dll", "System.Web.dll", "System.Runtime.Serialization.Xml.dll", "System.ComponentModel.TypeConverter.dll", "System.Drawing.Primitives.dll", "System.ServiceProcess.dll", "System.Net.HttpListener.dll", "System.ComponentModel.Annotations.dll", "System.IO.Compression.dll", "System.Threading.Tasks.Extensions.dll", "System.Globalization.Extensions.dll", "System.Reflection.Metadata.dll", "System.Data.DataSetExtensions.dll", "System.Runtime.Serialization.Json.dll", "System.Net.WebHeaderCollection.dll", "System.Runtime.Loader.dll", "System.Runtime.Serialization.dll", "System.Net.NameResolution.dll", "netstandard.dll", "System.ObjectModel.dll", "System.Xml.dll", "System.Security.Cryptography.Cng.dll", "System.Numerics.dll", "System.Reflection.Emit.ILGeneration.dll", "System.Diagnostics.DiagnosticSource.dll", "System.Transactions.dll", "System.IO.Compression.FileSystem.dll", "System.Runtime.CompilerServices.Unsafe.dll", "System.Windows.dll", "System.IO.Pipes.AccessControl.dll", "System.IO.FileSystem.DriveInfo.dll", "System.Diagnostics.Contracts.dll", "System.Security.Cryptography.OpenSsl.dll", "Microsoft.VisualBasic.dll", "System.Security.SecureString.dll", "System.Collections.Concurrent.dll", "System.Formats.Asn1.dll", "System.Net.WebProxy.dll", "System.Net.Http.dll", "System.Security.Cryptography.Encoding.dll", "System.Security.AccessControl.dll", "System.Diagnostics.Tracing.dll", "System.Threading.dll", "System.Private.Uri.dll", "System.Web.HttpUtility.dll", "System.Diagnostics.TextWriterTraceListener.dll", "System.Linq.Queryable.dll", "System.Reflection.DispatchProxy.dll", "System.Globalization.dll", "System.IO.FileSystem.Primitives.dll", "System.Threading.Overlapped.dll", "System.IO.Pipes.dll", "System.Xml.XmlSerializer.dll", "System.Transactions.Local.dll", "Microsoft.Win32.Registry.dll", "System.Security.Cryptography.dll", "System.Threading.Thread.dll", "mscorlib.dll", "System.Net.Security.dll", "System.Diagnostics.Tools.dll", "System.Security.Claims.dll", "System.Security.Cryptography.Primitives.dll", "System.Collections.Immutable.dll", "System.Runtime.Intrinsics.dll", "System.Private.DataContractSerialization.dll", "System.IO.Compression.ZipFile.dll", "System.Net.Primitives.dll", "System.Net.dll", "System.Linq.dll", "System.Threading.Channels.dll", "System.Collections.dll", "System.Linq.Expressions.dll", "System.IO.UnmanagedMemoryStream.dll", "System.Private.Xml.Linq.dll", "System.Reflection.Emit.Lightweight.dll", "System.Net.WebClient.dll", "System.Xml.XDocument.dll", "System.Collections.Specialized.dll", "System.Xml.ReaderWriter.dll", "System.ComponentModel.DataAnnotations.dll", "Microsoft.VisualBasic.Core.dll", "System.Data.dll", "System.AppContext.dll", "System.Xml.XPath.dll", "System.Security.Cryptography.X509Certificates.dll", "System.Threading.Tasks.dll", "System.Security.dll", "System.Security.Cryptography.Algorithms.dll", "WindowsBase.dll", "System.Private.Xml.dll", "System.Threading.Tasks.Dataflow.dll", "System.Diagnostics.StackTrace.dll", "System.Runtime.Handles.dll", "System.Text.Encodings.Web.dll", "System.IO.FileSystem.AccessControl.dll", "System.Net.NetworkInformation.dll", "System.IO.IsolatedStorage.dll", "System.Collections.NonGeneric.dll", "System.Numerics.Vectors.dll", "System.Xml.Linq.dll", "System.Threading.Tasks.Parallel.dll", "System.IO.dll", "System.Security.Principal.Windows.dll", "System.Private.CoreLib.dll", "System.Reflection.TypeExtensions.dll", "System.Runtime.Serialization.Formatters.dll", "System.Net.Ping.dll", "System.Net.Quic.dll", "System.Data.Common.dll", "System.Console.dll", "System.Buffers.dll", "System.Text.Encoding.dll", "System.Net.WebSockets.Client.dll"]
2024-01-10T21:12:14 - MEF Default Assemblies: /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0/any/Microsoft.CodeAnalysis.Workspaces.dll, /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0/any/Microsoft.CodeAnalysis.CSharp.Workspaces.dll, /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0/any/Microsoft.CodeAnalysis.Features.dll, /home/emik/.dotnet/tools/.store/csharprepl/0.6.6/csharprepl/0.6.6/tools/net8.0/any/Microsoft.CodeAnalysis.CSharp.Features.dll
2024-01-10T21:12:14 - Background initialization complete
2024-01-10T21:12:14 - Warm-up Starting
2024-01-10T21:12:15 - Unhandled Exception: System.Exception: Process timed out. Command line: bash -c "cat /tmp/tmpWDKMZj.tmp | xsel -i --clipboard ".
Output: 
Error: 
   at BashRunner.Run(String commandLine) in /_/src/TextCopy/BashRunner.cs:line 32
   at LinuxClipboard.InnerSetText(String tempFileName) in /_/src/TextCopy/LinuxClipboard_2.1.cs:line 42
   at LinuxClipboard.SetTextAsync(String text, CancellationToken cancellation) in /_/src/TextCopy/LinuxClipboard_2.1.cs:line 22
   at PrettyPrompt.TextSelection.WrappedClipboard.SetTextAsync(String text, CancellationToken cancellation)
   at PrettyPrompt.Panes.CodePane.OnKeyDown(KeyPress key, CancellationToken cancellationToken)
   at PrettyPrompt.Prompt.<>c__DisplayClass9_0.<<ReadLineAsync>g__InterpretKeyPress|0>d.MoveNext()
--- End of stack trace from previous location ---
   at PrettyPrompt.Prompt.ReadLineAsync()
   at CSharpRepl.ReadEvalPrintLoop.RunAsync(Configuration config) in /_/CSharpRepl/ReadEvalPrintLoop.cs:line 49
   at CSharpRepl.Program.Main(String[] args) in /_/CSharpRepl/Program.cs:line 68
   at CSharpRepl.Program.Main(String[] args) in /_/CSharpRepl/Program.cs:line 74
   at CSharpRepl.Program.<Main>(String[] args)

Appears to be due to a hard-coded 500ms timeout in the underlying TextCopy package: https://github.com/CopyText/TextCopy/blob/701c64408f75a7a5a8f4b0328372aca643a69c06/src/TextCopy/BashRunner.cs#L48

EDIT: Opened CopyText/TextCopy#830