Add protection against corrupt DLLs

Issue #67 resolved
Yusuf Ismail repo owner created an issue

Currently a corrupt DLL can cause BadImageFormatException to be thrown when QC tries to initialize, causing it to fail and go into an init loop

Adding protection that would catch these errors and report them properly would aid in stability and debugging

Comments (8)

  1. Yusuf Ismail reporter

    Exceptions will now be caught and a warning about the offending type and assembly will now be reported

    Additionally, NSubstitute has been added to the command exclusion list as this is where all reports of the issue originated from

  2. Yusuf Ismail reporter

    The following assembly also seems to be causing issues JetBrains.Rider.Unity.Editor.Plugin.Full.Repacked`

    These types in specific

    • System.Linq.Parallel.GroupJoinQueryOperator`4[TLeftInput,TRightInput,TKey,TOutput]
    • System.Linq.Parallel.JoinQueryOperator`4[TLeftInput,TRightInput,TKey,TOutput]`
    • System.Linq.Parallel.GroupByQueryOperator`3[TSource,TGroupKey,TElement]`
    • System.Linq.Parallel.SelectManyQueryOperator`3[TLeftInput,TRightInput,TOutput]`

    I believe these are the same types that caused issues in NSubstitute. I will try to work out what about these is causing the issue and if there is a proper solution to this

  3. Yusuf Ismail reporter

    This has been reproduced as a bug in Mono

    Mono Issue: https://github.com/mono/mono/issues/17278

    Unity Issue: https://issuetracker.unity3d.com/issues/badimageformatexception-is-thrown-when-calling-getcustomattributes-on-certain-memberinfo-instances

    Since this is a bug with Mono itself, there is nothing I can do myself to fix it. I believe however, that it doesn’t ever get thrown when inspecting user code; if this is the case then it can be safely ignored

  4. Yusuf Ismail reporter

    As this issue is very unlikely to manifest itself in user code, this warning will no longer be generated

  5. Log in to comment