镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Race condition on GraphicOptionsDefaultsExtensions.GetGraphicsOptions #1273

Closed

Description

@DTTerastar

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

Occasionally I'm getting the following exception which appears to be a threading race:

System.NullReferenceException: Object reference not set to an instance of an object.
at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(Configuration configuration)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(IImageProcessingContext context)
at Iol.Content.Services.ImageMutationExtensions.<>c__DisplayClass0_1.b__3(IImageProcessingContext x) in /agent/work/7cdd69e844c80f2c/src/Iol.Content/Services/ImageMutationExtensions.cs:line 54
at SixLabors.ImageSharp.Processing.ProcessingExtensions.ProcessingVisitor.Visit[TPixel](Image1 image) at Iol.Content.Services.ImageMutationExtensions.Mutate(Image image, List1 imageCommands) in /agent/work/7cdd69e844c80f2c/src/Iol.Content/Services/ImageMutationExtensions.cs:line 65

Steps to Reproduce

I don't have a good repro. It happens once every hour or so with hundreds of container starts under 100k rpm image hosting. But I do think the fix is to just move to a ConcurrentDictionary.

System Configuration

  • ImageSharp version:
  • Other ImageSharp packages and versions:
  • Environment (Operating system, version and so on):
  • .NET Framework version:
  • Additional information:

Activity

  1. JimBobSquarePants commented on Jul 13, 2020

    @JimBobSquarePants
    Member

    What version are you using? You’ve checked the “I’m using the latest” box but that doesn’t reflect the possible stack trace for that feature

  2. JimBobSquarePants commented on Jul 13, 2020

    @JimBobSquarePants
    Member

    See #1234

  3. DTTerastar commented on Jul 14, 2020

    @DTTerastar
    Author

    What version are you using? You’ve checked the “I’m using the latest” box but that doesn’t reflect the possible stack trace for that feature

    Sorry, Forgot that stupid Include Prereleases checkbox. I was on rc001, I'll try rc0003.

  4. JimBobSquarePants commented on Jul 14, 2020

    @JimBobSquarePants
    Member

    Easy mistake to make 😄 RC0003 will have your fix in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions