------- Comment #3 from dave at hiauly1 dot hia dot nrc dot ca  2007-04-01 
21:36 -------
Subject: Re:  FAIL: 22_locale/time_get/get_date/wchar_t/4.cc execution test

> Dave, unfortunately all the other linux targets are fine, therefore we have
> very big troubles figuring out what is happening on hppa only. Given that, as
> far as I know, no one among the v3 maintainers has access to hppa machines, 
> I'm
> afraid that you have to do most of the investigation work here, despite the PR
> being categorized as libstdc++-v3... Just follow get_date... (remember to 
> build
> the library -O0 -g3)

Ok, I built the library with -O0 -g3 and stepped through trying to find
the failure.

It appears that the failure occurs here:

std::ctype<wchar_t>::do_narrow (this=0x101f80, __wc=35199, __dfault=42 '*')
    at ctype_members.cc:221
221       do_narrow(wchar_t __wc, char __dfault) const
Current language:  auto; currently c++
(gdb) p/x __wc
$20 = 0x897f
(gdb) step
223         if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
(gdb)
226         __c_locale __old = __uselocale(_M_c_locale_ctype);
(gdb)
228         const int __c = wctob(__wc);
(gdb)
230         __uselocale(__old);
(gdb)
232         return (__c == EOF ? __dfault : static_cast<char>(__c));
(gdb) p __c
$22 = -1

The backtrace is:

(gdb) bt
#0  std::ctype<wchar_t>::do_narrow (this=0x101f80, __wc=35199, __dfault=42 '*')
    at ctype_members.cc:232
#1  0x00014a30 in std::__ctype_abstract_base<wchar_t>::narrow (this=0x101f80,
__c=35199, __dfault=42 '*')
    at
/home/dave/gnu/gcc-4.2/objdir/hppa-linux/libstdc++-v3/include/bits/locale_facets.h:327
#2  0x00035c94 in std::time_get<wchar_t, std::istreambuf_iterator<wchar_t,
std::char_traits<wchar_t> > >::_M_extract_num (this=0x101f80, __beg=
  {<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x101518, _M_c =
704643144}, __end=
{<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x897f, _M_c = 14},
[EMAIL PROTECTED],
 __min=-1073172736, __max=0, __len=951080, [EMAIL PROTECTED], [EMAIL PROTECTED])
    at
/home/dave/gnu/gcc-4.2/objdir/hppa-linux/libstdc++-v3/include/bits/locale_facets.tcc:2040
#3  0x00039194 in std::time_get<wchar_t, std::istreambuf_iterator<wchar_t,
std::char_traits<wchar_t> > >::_M_extract_via_format (this=0x101f80, __beg=
 {<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x101518, _M_c =
704643144}, __end=
 {<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x897f, _M_c = 14},
[EMAIL PROTECTED],
 [EMAIL PROTECTED], __tm=0x0, __format=0xe8328)
    at
/home/dave/gnu/gcc-4.2/objdir/hppa-linux/libstdc++-v3/include/bits/locale_facets.tcc:1973
#4  0x000395d0 in std::time_get<wchar_t, std::istreambuf_iterator<wchar_t,
std::char_traits<wchar_t> > >::do_get_date (this=0x101f80, __beg=
 {<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x101518, _M_c =
704643144}, __end=
 {<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x897f, _M_c = 14},
[EMAIL PROTECTED],
  [EMAIL PROTECTED], __tm=0x0)
    at
/home/dave/gnu/gcc-4.2/objdir/hppa-linux/libstdc++-v3/include/bits/locale_facets.tcc:2163
#5  0x000343cc in std::time_get<wchar_t, std::istreambuf_iterator<wchar_t,
std::char_traits<wchar_t> > >::get_date (this=0x101f80, __beg=
 {<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x101518, _M_c =
704643144}, __end=
 {<std::iterator<std::input_iterator_tag,wchar_t,long long
int,wchar_t*,wchar_t&>> = {<No data fields>}, _M_sbuf = 0x897f, _M_c = 14},
[EMAIL PROTECTED],
 [EMAIL PROTECTED], __tm=0x0)
    at
/home/dave/gnu/gcc-4.2/objdir/hppa-linux/libstdc++-v3/include/bits/locale_facets.h:3147
#6  0x00010680 in test01 ()
    at
/home/dave/gnu/gcc-4.2/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc:54
#7  0x00010810 in main ()
    at
/home/dave/gnu/gcc-4.2/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc:63

The failure to narrow the character causes __err to get set here:
/home/dave/gnu/gcc-4.2/objdir/hppa-linux/libstdc++-v3/include/bits/locale
_facets.tcc:2055.

This causes __tmperr to get set in 'Y' case.  This causes __err to
get set again here:
/home/dave/gnu/gcc-4.2/objdir/hppa-linux/libstdc++-v3/include/bits/locale
_facets.tcc:2017.

This causes the VERIFY failure.

Is the EOF result expected for the wctob call?

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31413

Reply via email to