You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Lcos-000 (via GitHub)" <gi...@apache.org> on 2026/08/19 09:55:01 UTC

[I] ActualMethodName() panics on malformed $invoke arguments when filter order is customized [dubbo-go]

Lcos-000 opened a new issue, #3683:
URL: https://github.com/apache/dubbo-go/issues/3683

   ### Description
   
   Follow-up to #3680.
   
   `RPCInvocation.ActualMethodName()` (`protocol/invocation/rpcinvocation.go:85-91`) performs an unguarded type assertion on the first generic-call argument:
   
   ```go
   func (r *RPCInvocation) ActualMethodName() string {
       if r.IsGenericInvocation() {
           return r.Arguments()[0].(string)   // panics if arg[0] is not a string
       } else {
           return r.MethodName()
       }
   }
   ```
   
   `IsGenericInvocation()` only checks `len(Arguments)==3`, not the element types. A malformed `$invoke` with a non-string `arg[0]` reaches this line and panics with `interface conversion: interface {} is X, not string`.
   
   ### Reproduction
   
   ```go
   inv := invocation.NewRPCInvocation(constant.Generic,
       []any{123, []string{}, []hessian.Object{}},
       map[string]{constant.GenericKey: "true"})
   // inv.ActualMethodName() -> panic: interface conversion: interface {} is int, not string
   ```
   
   ### Reachability
   
   In the default `DefaultServiceFilters` chain, `genericServiceFilter` (fixed by #3680) runs **before** `otelServerFilter` and short-circuits malformed invocations, so `ActualMethodName()` is not reached. This is therefore **not reachable by default**.
   
   However, `otelServerFilter` is appended to the filter chain when `otel.tracing.enable=true` (`server/action.go:388-389`), and the filter order is user-configurable via the service/provider `filter` setting (`server/action.go:380`). If a user places `otelServerTrace` before `generic_service`, or omits `generic_service` from a custom chain, the panic becomes reachable on the only server-side call site (`filter/otel/trace/filter.go:83`).
   
   The remaining 6 call sites are client-side (cluster invokers / loadbalance) and handle locally-constructed invocations, so they are not externally reachable.
   
   ### Affected call sites
   
   | Location | Side | Reachable? |
   |---|---|---|
   | `filter/otel/trace/filter.go:83` (otelServerFilter.Invoke) | server | Only with non-default filter ordering + tracing enabled |
   | `filter/otel/trace/filter.go:126` (otelClientFilter.Invoke) | client | No |
   | `cluster/cluster/failover/cluster_invoker.go:64` | client | No |
   | `cluster/cluster/failfast/cluster_invoker.go:49` | client | No |
   | `cluster/cluster/forking/cluster_invoker.go:66` | client | No |
   | `cluster/cluster/zoneaware/cluster_invoker.go:88` | client | No |
   | `cluster/loadbalance/p2c/loadbalance.go:118` | client | No |
   
   ### Environment
   
   - dubbo-go version: `develop` @ `9757e773`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] ActualMethodName() panics on malformed $invoke arguments [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on issue #3683:
URL: https://github.com/apache/dubbo-go/issues/3683#issuecomment-5351653324

   close via #3684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] ActualMethodName() panics on malformed $invoke arguments [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed issue #3683: [Bug] ActualMethodName() panics on malformed $invoke arguments
URL: https://github.com/apache/dubbo-go/issues/3683


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] ActualMethodName() panics on malformed $invoke arguments [dubbo-go]

Posted by "Lcos-000 (via GitHub)" <gi...@apache.org>.
Lcos-000 commented on issue #3683:
URL: https://github.com/apache/dubbo-go/issues/3683#issuecomment-5340821978

   same kind but anothor place as the #3680


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] ActualMethodName() panics on malformed $invoke arguments [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on issue #3683:
URL: https://github.com/apache/dubbo-go/issues/3683#issuecomment-5340610821

   does this issue solved yesterday?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] ActualMethodName() panics on malformed $invoke arguments when filter order is customized [dubbo-go]

Posted by "Lcos-000 (via GitHub)" <gi...@apache.org>.
Lcos-000 commented on issue #3683:
URL: https://github.com/apache/dubbo-go/issues/3683#issuecomment-5340479487

   /assign


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org