You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "shangxinxiaolin (via GitHub)" <gi...@apache.org> on 2026/10/11 19:34:12 UTC

[I] [Bug]: Bean generalization silently drops shared non-cyclic pointers [dubbo-go]

shangxinxiaolin opened a new issue, #3761:
URL: https://github.com/apache/dubbo-go/issues/3761

   ### What happened?
   
   Bean generic conversion silently replaces repeated references to the same non-cyclic object with nil. For example, two address fields that point to the same address round-trip with the second field missing. The same issue affects slice elements and map values (which entry loses its value depends on map iteration order).
   
   ### Reproduction
   
   ```go
   g := generalizer.GetBeanGeneralizer()
   value := 42
   original := []*int{&value, &value}
   encoded, err := g.Generalize(original)
   if err != nil { panic(err) }
   decoded, err := g.Realize(encoded, reflect.TypeOf(original))
   if err != nil { panic(err) }
   fmt.Printf("%#v\n", decoded)
   ```
   
   Expected: both elements contain 42. Actual: the second element is nil.
   
   The `visited` pointer set in `BeanGeneralizer.toDescriptor()` is retained for the entire traversal, so a shared object reached through two sibling paths is mistaken for an ancestor cycle. Removing the pointer from the set when its recursive conversion returns distinguishes sharing from actual cycles.
   
   ### Environment
   
   - Upstream develop: `5cfd927a52a48cb6a673f06b6549133b12b9464e`
   - Go 1.25.5, Windows amd64
   - Three public-API round-trip regression cases (struct fields, slice elements, map values) fail before the fix and pass afterwards. Existing self-cycle and mutual-cycle tests also pass.
   
   Fix and tests are ready and will be submitted in the linked PR. Reproduction exercises conversion only, without a running RPC server.
   


-- 
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]: Bean generalization silently drops shared non-cyclic pointers [dubbo-go]

Posted by "shangxinxiaolin (via GitHub)" <gi...@apache.org>.
shangxinxiaolin closed issue #3761: [Bug]: Bean generalization silently drops shared non-cyclic pointers
URL: https://github.com/apache/dubbo-go/issues/3761


-- 
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