port_driver_destroy_cb is never called and only appears in tests
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- c, erlang
- 領域
- embedded-iot
調査の方向性
Read src/platforms/esp32/test/main/test_main.c and the app_main() entry points in src/platforms/esp32/main.c and src/platforms/rp2/src/main.c, then trace port_driver_destroy_all and nif_collection_destroy_all in the named source files. Check which cleanup calls belong at shutdown in each platform and how the existing driver cleanup tests cover them. Done means the ESP32 and RP2 shutdown paths perform the intended cleanup and relevant tests pass.
索引モデルが issue の本文から書いたものです。
説明
port_driver_destroy_cb is a field of PortDriverDef in portnifloader.h that is set to the DESTROY_CB parameter by the REGISTER_PORT_DRIVER macro.
The field is used by the port_driver_destroy_all functions in src/libAtomVM/portnifloader.c and src/platforms/rp2/src/lib/sys.c
port_driver_driver_destroy_all is only called in src/platforms/esp32/test/main/test_main.c
It is never called in actual code.
I believe it is meant to do global cleanup of all the instances or ports of the driver.
Very few of the drivers in the esp32 tree use the destroy callback, but it is still used in a few drivers such as socket_driver.c
My driver can do cleanup with a "close" mailbox action, but I still think a driver-wide cleanup like you have in your design makes sense in case there is any other driver-wide shutdown needed or as a fallback to get the hardware to a sane state if mailbox messages aren't delivered.
test_main.c shows a pattern for how it could be inserted into src/platforms/esp32/main.c:app_main() at the end.
The RP2 tree also may need to call it in src/platforms/rp2/src/main.c:app_main()
nif_collection_destroy_all isn't called in the ESP32 tree either, but it is called in RP2.
Or maybe I'm missing something and these functions are called elsewhere.
It looks like a possibly smart API design sign, just a mistake in not calling it. I can write a PR to add those missing calls if needed, let me know. It might need a lot of testing since it is an unused code path that some drivers implement but haven't tested.
- 主要言語
- Erlang
- スター
- 2.3k
- フォーク
- 171
- 平均マージ
- 5日 11時間
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
atomvm/AtomVM のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
unicode:characters_to_list/binary return an uninitialized term for a non-chardata argument対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
atomvm/AtomVM#2435 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
atomvm/AtomVM#2429 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
chipsalliance/rocket-chip#3844 ·
-
[Bug] uavcan GNSS: GPS/TAI leap-second correction is applied in microseconds instead of secondsオープンstatus:needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
PX4/PX4-Autopilot#29709 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
prestonbrown/helixscreen#2083 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
earlephilhower/arduino-pico#3612 ·
メンテナーはふだん 1 日以内に返信