Skip to content

[BUG] Using of a CultureInfo parameter leads to a stack overflow. #1323

Closed

Description

@Tesmont

Describe the bug
It's impossible to use a CultureInfo type as a parameter for clients. I get an infinite loop and a stack overflow.

public interface IClient
{
    [Get("/testCulture")]
    Task<string> TestCulture([Query] CultureInfo culture);
}

Exception

Stack overflow.
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Span`1<System.Object> ByRef, System.Signature, Boolean, Boolean)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Object[])
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
...................................................
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation.BuildQueryMap(System.Object, System.String, Refit.RestMethodParameterInfo)
   at Refit.RequestBuilderImplementation+<>c__DisplayClass18_0.<BuildRequestFactoryForMethod>b__0(System.Object[])
   at Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2+<<BuildCancellableTaskFuncForMethod>b__0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2+<<BuildCancellableTaskFuncForMethod>b__0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Refit, Version=6.3.0.0, Culture=neutral, PublicKeyToken=2f9b1262776509f5]](<<BuildCancellableTaskFuncForMethod>b__0>d<System.__Canon,System.__Canon> ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2+<<BuildCancellableTaskFuncForMethod>b__0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Refit, Version=6.3.0.0, Culture=neutral, PublicKeyToken=2f9b1262776509f5]](<<BuildCancellableTaskFuncForMethod>b__0>d<System.__Canon,System.__Canon> ByRef)
   at Refit.RequestBuilderImplementation+<>c__DisplayClass14_0`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<BuildCancellableTaskFuncForMethod>b__0(System.Net.Http.HttpClient, System.Threading.CancellationToken, System.Object[])
   at Refit.RequestBuilderImplementation+<>c__DisplayClass22_0`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<BuildTaskFuncForMethod>b__0(System.Net.Http.HttpClient, System.Object[])
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Span`1<System.Object> ByRef, System.Signature, Boolean, Boolean)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Delegate.DynamicInvokeImpl(System.Object[])
   at System.Delegate.DynamicInvoke(System.Object[])
   at Refit.RequestBuilderImplementation+<>c__DisplayClass12_1.<BuildRestResultFuncForMethod>b__1(System.Net.Http.HttpClient, System.Object[])
   at Refit.Implementation.Generated+RefitClientIClient.global::Refit.Client.IClient.TestCulture(System.Globalization.CultureInfo)
   at Refit.Client.Program.Main(System.String[])

Expected behavior
If it's impossible to use a CultureInfo as a parameter then it would be better to see an exception.

Environment

  • OS: Win11
  • Version: 6.3.2

Activity

  1. added
    🔴 priority: high
    🌐 area: http-pipeline
    on Jun 16, 2026
  2. added a commit that references this issue on Jun 17, 2026
    7a3489e
  3. github-actions commented on Jul 2, 2026

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🌐 area: http-pipeline🐛 bug🔴 priority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions