ashmind / unbreakable Goto Github PK
View Code? Open in Web Editor NEWAlive, dammit!
License: MIT License
Alive, dammit!
License: MIT License
Please consider allowing System.Buffers
namespace. Currently:
class Program
{
static void Main() => System.Buffers.ArrayPool<char>.Shared.Rent(10);
}
throws:
Unbreakable.AssemblyGuardException: Namespace System.Buffers is not allowed.
Take a simple scenario including a non-exhaustive switch expression:
int x = 0;
_ = x switch { 1 => 2 }; // warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '0' is not covered.
It looks like the type System.Runtime.CompilerServices.SwitchExpressionException
needs to be explicitly allowed by Unbreakable for this to be allowed to run on SharpLab.
Required for e.g. Microsoft.FSharp.Core.FSharpFunc
2`.
I have discovered a security vulnerability that can potentially crash an application that uses Unbreakable.
Despite having not managed to reliably reproduce it on a local SharpLab instance I created, running an exploit in LINQPad had the effect I anticipated.
Its fix is easy but since the project is not very active I am not sure how quickly it would be merged and deployed had I just applied the PR.
With that in mind @ashmind, is there any way for me to privately tell you the details of that issue?
Generated by F# code (private, 1)
This takes far longer than 10s to terminate.
using System;
using System.Collections.Generic;
using System.Linq;
static class Program {
static int Run() {
IEnumerable<string> prev = new string[0];
for (var i = 0; i < 100; i++)
prev = prev.Concat(prev);
string.Join(", ", prev);
return 0;
}
}
I have a console application that I want to rewrite using Unbreakable and then run using dotnet app.dll
. This currently fails with:
Unhandled Exception: Unhandled exception. System.TypeInitializationException: The type initializer for '<Unbreakable>.<RuntimeGuardInstance>' threw an exception.
---> Unbreakable.Runtime.GuardException: Rewritten assembly can only be used within RuntimeGuardToken.Scope().
at Unbreakable.Runtime.Internal.RuntimeGuardInstances.Get(String idString)
at <Unbreakable>.<RuntimeGuardInstance>..cctor()
--- End of inner exception stack trace ---
at Program.Main()
Since the application is in a different process than the code that is doing the rewriting, starting the scope is challenging.
What would be a good way to make this work? I think I don't actually need RuntimeGuardToken.Scope()
, so simply adding a setting to AssemblyGuardSettings
to disable this check should be enough for my needs. I am willing to contribute the required changes to Unbreakable, if that would be helpful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.