Nicole Willson wrote:
Ok, in the messages.cpp test, the test_use_nls_path works fine, but the
stress test fails.
How does it fail? (Error messages, stack trace, ...) I get an
abort with xlC but not with gcc on the same machine (the stack
trace is attached). The test craps out long before it ever gets
to stress_test. This is the same problem with exceptions that
we talked about some time ago and that someone still needs to
get to the bottom of.
According to IBM, this is because the NLSPATH
environment variable needs to be set and setlocale must be called.
AFAICS, NLSPATH is set in test_use_nls_path and stays set for
the remainder of the lifetime of the test (which includes the
stress_test function).
Stress_test does not set the absolute path, but seems to set the locale.
My question is: since test_use_nls_path is called before stress_test, is
it expected that the NLSPATH variable will still be in the environment?
Yes. AFAICT, the test does nothing to remove it from the
environment so it should still be there.
[...]
Regarding pmr 17116,756, if the catalog file name referred to by the
CatalogName parameter contains a leading / (slash), it is assumed to be
an absolute path name. If the catalog file name is not an absolute path
name, the user environment determines which directory paths to search.
The NLSPATH environment variable defines the directory search path. When
this variable is used, the setlocale subroutine must be called before
the catopen subroutine.
I don't think the last sentence is correct. I certainly don't see
any such requirement in POSIX or on the Linux catopen() man page.
Also, I don't see any assumptions about this in the GNU catopen
sources (catopen() calls setlocale(LC_MESSAGES, 0) when the flag
is set to NL_CAT_LOCALE but only to retrieve the setting of the
LC_MESSAGES variable).
See http://tinyurl.com/s9mke and http://tinyurl.com/s9mke.
Martin
John Carver Phone: 512-823-9076
[EMAIL PROTECTED]
IBM Server Group (t/l 793-9076)
ISV Technical Programs
[EMAIL PROTECTED]
(gdb) run
Starting program: /build/sebor/xlc-8.0-15S/tests/22_messages
[Thread debugging using libthread_db enabled]
[New Thread 549758669984 (LWP 17737)]
# INFO (S1) (9 lines):
# TEXT:
# COMPILER: IBM VisualAge C++, __IBMCPP__ = 800
# ENVIRONMENT: unknown running linux-elf 2.6.5 with glibc 2.3
# FILE: 22_messages.cpp
# COMPILED: Jul 17 2006, 10:31:51
# COMMENT:
######################################################
# CLAUSE: lib.category.messages
# NOTE (S2) (5 lines):
# TEXT: executing "locale -a > /tmp/tmpfile-jLcq79"
# CLAUSE: lib.category.messages
# FILE: process.cpp
# LINE: 76
# NOTE (S2) (5 lines):
# TEXT: executing "gencat rwstdmessages.cat rwstdmessages.msg"
# CLAUSE: lib.category.messages
# FILE: process.cpp
# LINE: 76
# INFO (S1) (4 lines):
# TEXT: std::messages<char>::open () and close() in locale ("C")
# CLAUSE: lib.category.messages
# LINE: 468
Program received signal SIGABRT, Aborted.
[Switching to Thread 549758669984 (LWP 17737)]
0x00000080000ba454 in .raise () from /lib64/tls/libc.so.6
(gdb) where
#0 0x00000080000ba454 in .raise () from /lib64/tls/libc.so.6
#1 0x00000080000bbe2c in .abort () from /lib64/tls/libc.so.6
#2 0x00000000100d4400 in ._ZN10__cxxabiv111__terminateEPFvvE ()
#3 0x00000000100d443c in ._ZSt9terminatev ()
#4 0x00000000100d45b8 in .__cxa_throw ()
#5 0x000000001004eb88 in __rw::__rw_throw_exception (id=7,
what=0x80002b9b48 "/amd/devco/sebor/dev/stdlib/src/messages.cpp:301:
__rw::__rw_cat_close: invalid argument")
at /amd/devco/sebor/dev/stdlib/src/exception.cpp:680
#6 0x0000000010047628 in __rw::__rw_throw (id=7)
at /amd/devco/sebor/dev/stdlib/src/exception.cpp:825
#7 0x00000000100761f0 in __rw::__rw_cat_close (cat=0)
at /amd/devco/sebor/dev/stdlib/src/messages.cpp:300
#8 0x0000000010049fd4 in ._ZNKSt8messagesIcE8do_closeEi () at _messages.h:105
#9 0x00000000100077cc in std::messages<char>::close (this=0x101541f8, __c=0)
at _messages.h:91
#10 0x00000000100078ac in close_catalog<char> ([EMAIL PROTECTED], cat=0,
expect_exception=true, cname=0x100d8828 "char", line=484)
at /amd/devco/sebor/dev/stdlib/tests/localization/22_messages.cpp:432
#11 0x00000000100142f8 in test_open_close<char> (loc_name=0x100d7c4e "C",
cname=0x100d8828 "char")
at /amd/devco/sebor/dev/stdlib/tests/localization/22_messages.cpp:484
#12 0x0000000010015708 in test_messages<char> (cname=0x100d8828 "char",
locname=0x10167880 "aa_DJ")
at /amd/devco/sebor/dev/stdlib/tests/localization/22_messages.cpp:802
#13 0x0000000010015954 in run_test ()
at /amd/devco/sebor/dev/stdlib/tests/localization/22_messages.cpp:834
#14 0x00000000100170b8 in rw_vtest (argc=1, argv=0x1ffffffefe8,
file_name=0x100d8480
"/amd/devco/sebor/dev/stdlib/tests/localization/22_messages.cpp",
clause=0x100d8838 "lib.category.messages", comment=0x0,
[EMAIL PROTECTED]: 0x100158ec <run_test(int, char**)>,
optstr=0x100d8850 "|-has_facet~ |-open_close~ |-get~ |-codecvt~ |-nlspath~
|-stress-test~ ", va=0x1ffffffea58 "")
at /amd/devco/sebor/dev/stdlib/tests/src/driver.cpp:1043
#15 0x0000000010018234 in rw_test (argc=1, argv=0x1ffffffefe8,
fname=0x100d8480
"/amd/devco/sebor/dev/stdlib/tests/localization/22_messages.cpp",
clause=0x100d8838 "lib.category.messages", comment=0x0,
[EMAIL PROTECTED]: 0x100158ec <run_test(int, char**)>,
optstr=0x100d8850 "|-has_facet~ |-open_close~ |-get~ |-codecvt~ |-nlspath~
|-stress-test~ ") at /amd/devco/sebor/dev/stdlib/tests/src/driver.cpp:1140
#16 0x0000000010015a54 in main (argc=1, argv=0x1ffffffefe8)
at /amd/devco/sebor/dev/stdlib/tests/localization/22_messages.cpp:852