ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: merch-redmine@jeremyevans.net
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50953] [Ruby master Bug#15178] Wrong paramaters passing to pthread_setname_np(3)
Date: Mon, 31 Aug 2020 21:22:51 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-87328.20200831212250.375@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-15178.20180929154345.375@ruby-lang.org>

Issue #15178 has been updated by jeremyevans0 (Jeremy Evans).


I agree with your analysis.  Looking at the NetBSD man page for pthread_setname_np (https://netbsd.gw.com/cgi-bin/man-cgi?pthread_setname_np++NetBSD-current), the format string is clearly the 2nd argument and not the third.  The only reason this hasn't caused problems is that few thread names are going to use printf(3) format specifiers.  I've added a pull request to fix this: https://github.com/ruby/ruby/pull/3492

----------------------------------------
Bug #15178: Wrong paramaters passing to pthread_setname_np(3)
https://bugs.ruby-lang.org/issues/15178#change-87328

* Author: taca (Takahiro Kambe)
* Status: Open
* Priority: Normal
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Ruby 2.6.0-preview2の動作を調べている途中で見つけました。

[Bug #9586]の修正r45713で、NetBSDの場合のpthread_setname_np(3)の引数を修正しています。
ここは第2引数と第3引数を入れ替えるのではなく、単に二重引用符を適切にquoteするだけとすべき
だったのではないでしょうか。

また、実際にthread_pthread.cで`SET_CURRENT_THREAD_NAME`を介してpthread_setname_np(3)が
呼び出される状況を理解していないのですが、指定する名前は`PTHREAD_MAX_NAMELEN_NP`を超える
ことはないと思って良いのでしょうか。(`PTHREAD_MAX_NAMELEN_NP`の値は32です。)

---Files--------------------------------
configure.ac.diff (645 Bytes)


-- 
https://bugs.ruby-lang.org/

       reply	other threads:[~2020-08-31 21:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15178.20180929154345.375@ruby-lang.org>
2020-08-31 21:22 ` merch-redmine [this message]
2020-12-31  6:37 ` [ruby-dev:50986] " nagachika00
2021-04-04 23:30 ` [ruby-dev:51044] " usa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-87328.20200831212250.375@ruby-lang.org \
    --to=merch-redmine@jeremyevans.net \
    --cc=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).