Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exceptions #31

Closed
redcrayonn opened this issue Feb 12, 2019 · 16 comments
Closed

Unhandled exceptions #31

redcrayonn opened this issue Feb 12, 2019 · 16 comments

Comments

@redcrayonn
Copy link

redcrayonn commented Feb 12, 2019

We've started to use your extension in combination with our webapplications. So far we've managed to fix a lot of SCSS errors which we otherwise wouldn't have noticed.

But one thing seems odd to us; there's a lot of unhandled exceptions which prevent you from starting a debugging session with for example MVC .NET 4.7.1.

My questions is whether it is at all possible to catch these exceptions and pass / bubble them to the application. We already handle exceptions thrown by the sass compiler, but it seems some exceptions take place within your extension which we cannot handle. Is it at all possible to handle them one way or another?

Error:
An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Reproduction:

  • MVC .NET web application with sass.
  • Remove a trailing { on a random class.
  • Try to debug the application.

We'd love to hear your feedback!

@Taritsyn
Copy link
Owner

Hello, Olaf!

Thanks for information! In the near future I will research this problem.

@Taritsyn
Copy link
Owner

Hello, Olaf!

I cannot reproduce this error.

You are using a modified or original version of the LibSass? Show me the full error message with stack trace.

@Taritsyn Taritsyn closed this as completed Mar 2, 2019
@DaveEmmerson
Copy link

at LibSassHost.Helpers.MarshallingHelpers.PtrToString(IntPtr ptr)
at LibSassHost.Internal.SassCompilerProxy.FillManagedContextError(SassContextBase context, Sass_Context& ctx)
at LibSassHost.Internal.SassCompilerProxy.Compile(SassDataContext dataContext)
at LibSassHost.SassCompiler.InnerCompile(String content, Boolean indentedSyntax, String inputPath, String outputPath, String sourceMapPath, CompilationOptions options)
at LibSassHost.SassCompiler.Compile(String content, String inputPath, String outputPath, String sourceMapPath, CompilationOptions options)
at BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.InnerTranslate(IAsset asset, CompilationOptions sassOptions, Boolean enableNativeMinification)
at BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.Translate(IList1 assets) at BundleTransformer.Core.Transformers.TransformerBase.Translate(IList1 assets, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.TransformerBase.Transform(IList1 assets, BundleContext bundleContext, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, Boolean isDebugMode) at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse, Boolean isDebugMode) at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse) at System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable1 bundleFiles)
at System.Web.Optimization.Bundle.GenerateBundleResponse(BundleContext context)
at System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context)
at System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath)
at System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable`1 assets)
at System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths)
at System.Web.Optimization.Styles.RenderFormat(String tagFormat, String[] paths)
at System.Web.Optimization.Styles.Render(String[] paths)

LibSassHost.1.2.7
LibSassHost.Native.win-x86.1.2.7

I'm trying to track down exactly where it fails.

@Taritsyn
Copy link
Owner

Hello, Dave!

You have only given a stack trace. I don't see the error message itself.

@DaveEmmerson
Copy link

DaveEmmerson commented Oct 25, 2019 via email

@Taritsyn
Copy link
Owner

@DaveEmmerson Is this error persistent?

Apparently it occurs during processing of the Sass syntax error:

…
at LibSassHost.Internal.SassCompilerProxy.FillManagedContextError(SassContextBase context, Sass_Context& ctx)
…

@DaveEmmerson
Copy link

DaveEmmerson commented Oct 25, 2019 via email

@Taritsyn
Copy link
Owner

What version of .NET are you using? Implementation of the PtrToString method just depends on it.

@DaveEmmerson
Copy link

DaveEmmerson commented Oct 25, 2019 via email

@Taritsyn Taritsyn reopened this Oct 25, 2019
@DaveEmmerson
Copy link

Hi

Yeah, it's framework and 4.6.2 on this project.

Thanks

@Taritsyn
Copy link
Owner

@redcrayonn @DaveEmmerson In version 1.2.8 fixed this error. The error was at the LibSass level.

@DaveEmmerson
Copy link

@Taritsyn thanks! I've created some local nuget packages of the latest commit and updated my libsasshost/libsassnative/bundletransformer.sass references and it seems to be working (in my sample size of 1 error 😁 )

@Taritsyn
Copy link
Owner

@DaveEmmerson Why create local nuget packages? Packages are in release.

@DaveEmmerson
Copy link

Ah, woops.

Does https://github.com/Taritsyn/BundleTransformer/blob/64c05f32757e469edb3b2e3f7d7d63dd6c0f82d8/src/BundleTransformer.SassAndScss/BundleTransformer.SassAndScss.csproj#L31 need to be updated though?

I'm very new to LibSass (like 2 days in), so I'm not 100% on how all the bits fit together yet.

@Taritsyn
Copy link
Owner

There were no changes in interface of the LibSassHost library, so you can just update the LibSassHost's packages.

@DaveEmmerson
Copy link

👍 thanks again - works fine after a good number of parse errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants