[sylpheed-jp:10748] Re: sylpheed(svnバージョン) がハングします。

Hiroyuki Yamamoto <[email protected]>
Newsgroups gmane.mail.sylpheed.general.japanese
Message-ID <[email protected]>
山本です。

On Mon, 16 Mar 2009 11:07:40 +0900
MASAO TAKAHASHI <[email protected]> wrote:

> > > 本日のsvnアップデート後(3/13)
> > > 受信でハングします。
> > > 
> > > libsylph/mh.cの461行の
> > > if (g_link(fileinfo->file, destfile) < 0) {
> > > が問題のようです。
> > > if (link(fileinfo->file, destfile) < 0) {
> > > と元にもどすとハングしなくなりました。
> > 
> > 確かにこちらでも再現しました(確認してから commit しろと>自分)
> > 
> > ハング中は CPU を 90% くらい食っているようなので、無限ループに
> > 陥っているようです。
> > 
> > うーん、 Linux の場合は単に #define g_link link
> > しているだけなのに何でこうなるのか謎です^^;
> おっしゃるとおり。gcc -Eスイッチで見ると確かに
> link()となっておりました。正確には、3/13のsvnアップデートを
> 適用する前に戻すとOKです。

原因が判明しました。
G_OS_UNIX が定義されている場合、 utils.c 内の g_link() 関数の名前
自体が g_link -> link と置換されてしまい、その中でさらに link()
を呼んでいるため、 link() を呼び出すと自分が再帰的に呼び出されて
無限ループに陥ってしまう、という話でした。

修正して commit しました(r2120)。

-- 
Hiroyuki Yamamoto <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.