You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2007/10/30 23:42:12 UTC
22.locale.messages hangs on Linux
The 22.locale.messages test hangs SUSE LINUX Enterprise Server 9
(x86_64). I reproduced the problem in a 15D build with gcc and in
a 12D build with Sun C++ on the same machine. Based on the stack
trace it looks like the test tries to throw an exception whose
what() string is then attempted to be formatted by the library
by using a messages facet. Since all message facets share the
same mutex the library deadlocks.
I wonder if this might be the cause of the problem:
http://svn.apache.org/viewvc?view=rev&revision=576787
In addition, the exec utility also seems to fail to kill the test
after the usual timeout and the test (and the rest of the build
process) hangs. The last change that went in to exec that looks
like a possible suspect is this:
http://svn.apache.org/viewvc?view=rev&revision=590124
(Farid, the ChangeLog has your name on it even though the change
itself was mine. Let it be a reminder to you to give blame where
blame is due :)
Here's the backtrace:
(gdb) run
Starting program:
/build/sebor/stdcxx-gcc-3.3.3_43.41-15D/tests/22.locale.messages
[Thread debugging using libthread_db enabled]
[New Thread 182903474464 (LWP 18155)]
# INFO (S1) (10 lines):
# TEXT:
# COMPILER: gcc 3.3.3, __VERSION__ = "3.3.3 (SuSE Linux)"
# ENVIRONMENT: x86_64/LP64 running linux-elf (SUSE LINUX Enterprise
Server 9 (x86_64)) with glibc 2.3
# FILE: 22.locale.messages.cpp
# COMPILED: Oct 30 2007, 16:10:02
# COMMENT:
############################################################
# CLAUSE: lib.category.messages
# NOTE (S2) (5 lines):
# TEXT: executing "locale -a > /tmp/tmpfile-JsufP8"
# CLAUSE: lib.category.messages
# FILE: process.cpp
# LINE: 270
# NOTE (S2) (5 lines):
# TEXT: executing "gencat rwstdmessages.cat rwstdmessages.msg"
# CLAUSE: lib.category.messages
# FILE: process.cpp
# LINE: 270
# INFO (S1) (4 lines):
# TEXT: std::messages<char>::open() and close() in locale(#C)
# CLAUSE: lib.category.messages
# LINE: 465
Program received signal SIGINT, Interrupt.
[Switching to Thread 182903474464 (LWP 18155)]
0x0000002a95a1afdb in __lll_mutex_lock_wait () from
/lib64/tls/libpthread.so.0
(gdb) where
#0 0x0000002a95a1afdb in __lll_mutex_lock_wait ()
from /lib64/tls/libpthread.so.0
#1 0x0000002a9585f440 in __rw::__rw_manage_cat_data(int&,
__rw::__rw_open_cat_data*)::catalogs ()
from /build/sebor/stdcxx-gcc-3.3.3_43.41-15D/lib/libstd15D.so
#2 0xffffffffffffffff in ?? ()
#3 0x0000002a95a17eec in pthread_mutex_lock () from
/lib64/tls/libpthread.so.0
#4 0x0000002a9555d724 in _dl_lookup_symbol_x ()
from /lib64/ld-linux-x86-64.so.2
#5 0x0000002a956c58cd in __rw_guard (this=0x7fbfffe3f0,
__mutex=@0x2a9585f440)
at _mutex.h:556
#6 0x0000002a956d6c6b in __rw::__rw_cat_open (cat_name=@0x7fbfffe510,
loc=@0x2a9587fe70) at $TOPDIR/src/messages.cpp:215
#7 0x0000002a956eb667 in std::messages<char>::do_open (this=0x2a9587ac00,
__fun=@0x7fbfffe510, __loc=@0x2a9587fe70) at _messages.cc:44
#8 0x0000002a956eb69a in std::messages<char>::open (this=0x2a9587ac00,
__fun=@0x7fbfffe510, __loc=@0x2a9587fe70) at _messages.h:89
#9 0x0000002a956c44af in __rw_vfmtwhat (buf=0x0, bufsize=0, id=7,
va=0x7fbfffe590) at $TOPDIR/src/exception.cpp:615
#10 0x0000002a956c5081 in __rw::__rw_throw (id=7)
at $TOPDIR/src/exception.cpp:825
#11 0x0000002a956d6f94 in __rw::__rw_cat_close (cat=0)
at $TOPDIR/src/messages.cpp:296
#12 0x0000002a956eb95f in std::messages<char>::do_close (this=0x2a95880440,
__cat=0) at _messages.cc:53
#13 0x0000002a956eb988 in std::messages<char>::close (this=0x2a95880440,
__c=0)
at _messages.h:98
#14 0x0000000000408b5f in close_catalog<char> (msgs=@0x2a95880440, cat=0,
expect_exception=true, cname=0x42543b "char", line=484)
at $TOPDIR/tests/localization/22.locale.messages.cpp:421
#15 0x00000000004058f9 in test_open_close<char> (loc_name=0x425421 "C",
cname=0x42543b "char")
at $TOPDIR/tests/localization/22.locale.messages.cpp:484
#16 0x00000000004051d9 in test_messages<char> (cname=0x42543b "char",
locname=0x539c72 "aa_DJ")
at $TOPDIR/tests/localization/22.locale.messages.cpp:792
#17 0x0000000000405010 in run_test ()
at $TOPDIR/tests/localization/22.locale.messages.cpp:831
#18 0x000000000040a9e0 in rw_vtest (argc=1, argv=0x7fbfffed38,
file_name=0x4254c0
"$TOPDIR/tests/localization/22.locale.messages.cpp", clause=0x4254a8
"lib.category.messages", comment=0x0,
fun=0x404f2e <run_test>,
optstr=0x425460 "|-has_facet~ |-open_close~ |-get~ |-codecvt~
|-nlspath~ |-s
tress-test~ ", va=0x7fbfffeae0)
at $TOPDIR/tests/src/driver.cpp:1030
#19 0x000000000040ae78 in rw_test (argc=1, argv=0x7fbfffed38,
fname=0x4254c0 "$TOPDIR/tests/localization/22.locale.messages.cpp",
clause=0x4254a8 "lib.category.messages", comment=0x0,
testfun=0x404f2e <run_test>,
optstr=0x425460 "|-has_facet~ |-open_close~ |-get~ |-codecvt~
|-nlspath~ |-stress-test~ ") at $TOPDIR/tests/src/driver.cpp:1127
#20 0x00000000004050b1 in main (argc=1, argv=0x7fbfffed38)
at $TOPDIR/tests/localization/22.locale.messages.cpp:849
Re: 22.locale.messages hangs on Linux
Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com]
>> Sent: Wednesday, October 31, 2007 12:42 AM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: 22.locale.messages hangs on Linux
>>
>> (Farid, the ChangeLog has your name on it even though the
>> change itself was mine. Let it be a reminder to you to give
>> blame where blame is due :)
>
> I thought, that if I merging the some changes, I need to specify
> myself
> in ChangeLog with the reference to the revision which was merged.
I don't think it's right when what's being merged is someone else's
change without any modifications. It makes it look like the person
who did the merge is also the author of the original change. If you
were adding your own changes to the original commit in the process
(i.e., you were somehow creatively contributing to the original
author's work), I'd agree but not in cases when all we do is copy
the original changes intact. But I could certainly be wrong and
am open to discussion. Do you know of any projects that follow
this policy? (AFAICT, GNU gcc doesn't).
Martin
RE: 22.locale.messages hangs on Linux
Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com]
> Sent: Wednesday, October 31, 2007 12:42 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: 22.locale.messages hangs on Linux
>
> (Farid, the ChangeLog has your name on it even though the
> change itself was mine. Let it be a reminder to you to give
> blame where blame is due :)
I thought, that if I merging the some changes, I need to specify
myself
in ChangeLog with the reference to the revision which was merged.
Farid.
Re: 22.locale.messages hangs on Linux
Posted by Martin Sebor <se...@roguewave.com>.
Travis Vitek wrote:
>
>
> Martin Sebor wrote:
>> [...]
>>
>> I wonder if this might be the cause of the problem:
>> http://svn.apache.org/viewvc?view=rev&revision=576787
>>
>> [...]
>>
>> (Farid, the ChangeLog has your name on it even though the change
>> itself was mine. Let it be a reminder to you to give blame where
>> blame is due :)
>>
>
> Are you sure? I specifically remember Farid and I trying to convince you
> that it needed to be a class guard instead of a static guard. The
> conversation is archived at
> http://www.nabble.com/forum/ViewPost.jtp?post=12680046.
That's right, this one is your guys' fault! ;-)
I was talking about the other change which I'm to blame for:
http://svn.apache.org/viewvc?view=rev&revision=588734
Farid was just nice enough to merge it to trunk for me and
in the process replaced my name in the ChangeLog with mine:
http://svn.apache.org/viewvc?view=rev&revision=590124
>
> It is likely that is actually the problem. As Farid and I agreed, the
> functions __rw_manage_cat_data, catopen, catclose, catgets need to use the
> same lock. Looks like we need to add a scope to isolate the guard so that
> the lock is released before the _RWSTD_REQUIRES().
Something like that. Btw., the deadlock problem here has been
an issue before -- see (Rogue Wave only):
http://insight.roguewave.com/onyxinsight/qa/qa30046.htm
Martin
Re: 22.locale.messages hangs on Linux
Posted by Travis Vitek <vi...@roguewave.com>.
Martin Sebor wrote:
>
> [...]
>
> I wonder if this might be the cause of the problem:
> http://svn.apache.org/viewvc?view=rev&revision=576787
>
> [...]
>
> (Farid, the ChangeLog has your name on it even though the change
> itself was mine. Let it be a reminder to you to give blame where
> blame is due :)
>
Are you sure? I specifically remember Farid and I trying to convince you
that it needed to be a class guard instead of a static guard. The
conversation is archived at
http://www.nabble.com/forum/ViewPost.jtp?post=12680046.
It is likely that is actually the problem. As Farid and I agreed, the
functions __rw_manage_cat_data, catopen, catclose, catgets need to use the
same lock. Looks like we need to add a scope to isolate the guard so that
the lock is released before the _RWSTD_REQUIRES().
Travis
--
View this message in context: http://www.nabble.com/22.locale.messages-hangs-on-Linux-tf4721753.html#a13499795
Sent from the stdcxx-dev mailing list archive at Nabble.com.