Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Check types of method/signal arguments and return values

オープン
#118 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
ruby

調査の方向性

Start by reviewing the requirements for client and service method arguments and return values, signal delivery, and Properties.Set, along with related issue #97. Identify the existing client/service dispatch and introspection paths before deciding the scope. Done should include deliberate type errors with defined error behavior across the listed cases.

索引モデルが issue の本文から書いたものです。

説明

Both at the client and service side we should add type checking of method arguments and return values

(This is related to #97 which was specifically about properties)

  1. Client method arguments, emitting signals: trying to use a string instead of an integer, or the other way around, will raise an exception before the bus sees the wrong type, but the exception is an implementation accident. It should be an explicit

    type A was expected but type B was seen, in argument foo

    (the the method and interface names will be easily seen from the backtrace)

  2. Client return values: not trying to catch confused/malicious services for now

  3. Service method arguments: this should be avoided by client libraries paying attention to introspection data and doing their own type checking (see (1)), but it is relatively easy to send a mistyped call. Here an example of passing an integer where a string is expected, the caller gets to see an exception caused by the wrong type:

    $ dbus-send --print-reply --session --dest=org.ruby.service /org/ruby/MyInstance org.ruby.AnotherInterface.Reverse uint32:42 
    Error org.freedesktop.DBus.Error.Failed: undefined method `split' for 42:Integer
    
         outstr = instr.split(//).reverse.join
                        ^^^^^^; caused by 1 sender=:1.1226 -> dest=org.ruby.service serial=2 reply_serial= path=/org/ruby/MyInstance;  interface=org.ruby.AnotherInterface; member=Reverse error_name=
    

    TODO: find a well known error name+format for type errors

    Listening for signals: what if someone sends a mistyped signal? Could be even pretty easy if the listener filters only on interface and not a well-known sender

    Properties.Set with a wrong type: I know I said this was about methods, not properties, but I think this check is still missing :-(

  4. Service return values: similar to (1)

主要言語
Ruby
スター
174
フォーク
51
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mvidner/ruby-dbus のほかの issue

mvidner/ruby-dbus の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。