Please error, or at least warn, when a managed type is included in INetworkSerializeByMemcpy
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- csharp
- 領域
- networking
調査の方向性
まず INetworkSerializeByMemcpy の定義と、その検証またはシリアライズのテストを見つけます。実装する型がコンパイル時または実行時にどのようにチェックされるかを追跡し、その後、string フィールドやその他のマネージド フィールドのカバレッジを追加します。このような型が安全でない memcpy シリアライズを行う代わりに、ビルドエラーまたは警告を生成すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
My coworker was unfamiliar with INetworkSerializeByMemcpy and the FixedStringNNNBytes types, and added a string field to an existing INetworkSerializeByMemcpy struct. This caused me great headaches (it made it into a publicly released patch), trying to track down segfault heap corruption that only showed up in very specific multiplayer circumstances (the string was normally null, which probably masked the issue).
Describe the solution you'd like
Please cause a build error when a managed type (a class, a string, or the like) is included in an INetworkSerializeByMemcpy type. I cannot think of any use case where it would be valid or intended to serialize a managed GC pointer by memcpy. At least a warning if nothing else.
It doesn't have to be perfect, even just checking for string would be lovely - string specifically is such a massive footgun, it's so easy to accidentally include and think it'll work fine. The fact it crashes later on via unrelated segfault heap corruption bringing down the editor, instead of a C# Exception, is especially rough.
- 主要言語
- C#
- スター
- 2.3k
- フォーク
- 461
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 20
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Unity-Technologies/com.unity.netcode.gameobjects のほかの issue
-
stat:import type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
-
stat:reply-needed type:support
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · コメント 10 件 ·
-
stat:awaiting-triage stat:Investigating type:bug
Unity-Technologies/com.unity.netcode.gameobjects#3912 · コメント 5 件 · 担当者 1 名 ·
-
Tracking type:feature-2.x
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · コメント 5 件 ·
-
stat:awaiting-response stat:imported type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
Unity-Technologies/com.unity.netcode.gameobjects#3802 · コメント 2 件 ·
Unity-Technologies/com.unity.netcode.gameobjects の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
sillsdev/languageforge-lexbox#2665 ·
-
C: Syntax
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug documentation frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
azurenoops/spin_agent#975 ·
-
:watch: Not Triaged 11.0 fundamentals/subsvc
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
dotnet/AspNetCore.Docs#37699 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SubtitleEdit/subtitleedit#15108 · コメント 1 件 ·