ayush00git opened a new pull request, #3719: URL: https://github.com/apache/fory/pull/3719
<!-- **Thanks for contributing to Apache Fory™.** **If this is your first time opening a PR on fory, you can refer to [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).** Contribution Checklist - The **Apache Fory™** community has requirements on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md). - Apache Fory™ has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here. --> ## Why? <!-- Describe the purpose of this PR. --> ## What does this PR do? <!-- Describe the details of this PR. --> ## Related issues Closes #3718 ## AI Contribution Checklist Issue was flagged by claude ``` Confirmed bug 1. type_resolver.go:1018 — serializer-creation error is silently swallowed Confidence: high (confirmed by go vet and by reading the code). Severity: medium–high. serializer, err := r.createSerializer(value.Type(), false) if err != nil { fmt.Errorf("failed to create serializer: %w", err) // <-- result discarded } info.Serializer = serializer // serializer is nil here on error // ... r.typePointerCache[typePtr] = info // nil serializer gets cached return info, nil // returns nil error despite failure The error is built with fmt.Errorf but never returned or assigned. On the lazy-init path, when createSerializer fails, serializer is nil, that nil is stored into info.Serializer, cached, and the function returns (info, nil) — pretending success. A later serialize/deserialize then uses a nil serializer → wrong behavior or a nil-deref panic, far from the real cause. Fix: return nil, fmt.Errorf("failed to create serializer: %w", err) go vet flags this directly: type_resolver.go:1018:5: result of fmt.Errorf call not used ``` ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. Delete section if not applicable. --> -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
