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

scan crashing with AccessViolation in System.Text.RegularExpressions.RegexInterpreter #60

Open
hauntingEcho opened this issue Mar 28, 2020 · 3 comments

Comments

@hauntingEcho
Copy link

hauntingEcho commented Mar 28, 2020

Running the 10.5.2-arm docker image with Anime plugin 7.0.0, using AniList causes crashes whenever a library is scanned, giving the logs below. Disabling AniList seems to solve the issue.

[22:03:20] [INF] [42] Jellyfin.Plugin.Anime.Providers.AniList.AniListSeriesProvider: Start AniList... Searching(Black Rock Shooter)
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Text.RegularExpressions.RegexInterpreter.Forwardcharnext()
   at System.Text.RegularExpressions.RegexInterpreter.Go()
   at System.Text.RegularExpressions.RegexRunner.Scan(System.Text.RegularExpressions.Regex, System.String, Int32, Int32, Int32, Int32, Boolean, System.TimeSpan)
   at System.Text.RegularExpressions.Regex.Run(Boolean, Int32, System.String, Int32, Int32, Int32)
   at System.Text.RegularExpressions.MatchCollection.GetMatch(Int32)
   at System.Text.RegularExpressions.MatchCollection+Enumerator.MoveNext()
   at Jellyfin.Plugin.Anime.Providers.Equals_check+<One_line_regex>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Jellyfin.Plugin.Anime.Providers.Equals_check+<One_line_regex>d__6, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]](<One_line_regex>d__6 ByRef)
   at Jellyfin.Plugin.Anime.Providers.Equals_check.One_line_regex(System.Text.RegularExpressions.Regex, System.String, System.Threading.CancellationToken, Int32, Int32)
   at Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TrySetResult(System.__Canon)
   at Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.FinishSlow(Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteFromThreadPool(System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[22:03:53] [INF] [1] Main: Jellyfin version: 10.5.2
@hauntingEcho
Copy link
Author

after letting it run awhile, it looks like I'm getting this issue from RegExes elsewhere too. For what it's worth, other series with spaces in their names worked fine.

[22:53:11] [INF] [19] AniSearch: Start AniSearch... Searching(Koe no Katachi)
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Text.RegularExpressions.RegexInterpreter.Go()
   at System.Text.RegularExpressions.RegexRunner.Scan(System.Text.RegularExpressions.Regex, System.String, Int32, Int32, Int32, Int32, Boolean, System.TimeSpan)
   at System.Text.RegularExpressions.Regex.Run(Boolean, Int32, System.String, Int32, Int32, Int32)
   at System.Text.RegularExpressions.MatchCollection.GetMatch(Int32)
   at System.Text.RegularExpressions.MatchCollection+Enumerator.MoveNext()
   at Jellyfin.Plugin.Anime.Providers.Equals_check+<One_line_regex>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Jellyfin.Plugin.Anime.Providers.Equals_check+<One_line_regex>d__6, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]](<One_line_regex>d__6 ByRef)
   at Jellyfin.Plugin.Anime.Providers.Equals_check.One_line_regex(System.Text.RegularExpressions.Regex, System.String, System.Threading.CancellationToken, Int32, Int32)
   at Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Fast_xml_search>d__7, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TrySetResult(System.__Canon)
   at Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Jellyfin.Plugin.Anime.Providers.Equals_check+<Half_string>d__5, Jellyfin.Plugin.Anime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.FinishSlow(Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteFromThreadPool(System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

@hauntingEcho hauntingEcho changed the title Anilist crashing scan crashing with AccessViolation in System.Text.RegularExpressions.RegexInterpreter Mar 28, 2020
@hauntingEcho
Copy link
Author

For what it's worth, my logs are also getting spammed hard from jellyfin/jellyfin#2471 - hopefully that turns out to be the root cause of the issue, since I'm also getting crashes without the above error

@hauntingEcho
Copy link
Author

reverting to 10.4.3 with plugin v4 seems to have worked as a temporary resolution. It feels like a use-after-free issue, but I'm not familiar enough with C# diagnostics to be able to track that down.

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

No branches or pull requests

1 participant