Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 62361 invoked from network); 4 Oct 2006 18:55:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Oct 2006 18:55:41 -0000 Received: (qmail 76625 invoked by uid 500); 4 Oct 2006 18:55:41 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 76610 invoked by uid 500); 4 Oct 2006 18:55:40 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 76592 invoked by uid 99); 4 Oct 2006 18:55:40 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Oct 2006 11:55:40 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:34403] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id B6/41-20288-9A304254 for ; Wed, 04 Oct 2006 11:55:37 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D2D2F7142E0 for ; Wed, 4 Oct 2006 11:55:26 -0700 (PDT) Message-ID: <21233961.1159988126861.JavaMail.root@brutus> Date: Wed, 4 Oct 2006 11:55:26 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Commented: (STDCXX-93) time_get crashes when calling get_date ( Visual C++ 8.0 ) In-Reply-To: <804297526.1136170201195.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/STDCXX-93?page=comments#action_12439942 ] Martin Sebor commented on STDCXX-93: ------------------------------------ This is yet another gratuitous conformance violation in the MSVC runtime library. I opened an issue for it (although I doubt they'll fix it, they treat the C/C++ standards as just a bunch of suggestions): https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=218258 > time_get crashes when calling get_date ( Visual C++ 8.0 ) > --------------------------------------------------------- > > Key: STDCXX-93 > URL: http://issues.apache.org/jira/browse/STDCXX-93 > Project: C++ Standard Library > Issue Type: Bug > Components: Examples > Environment: Visual C++ 8.0 > Reporter: Vikas Mehta > Assigned To: Martin Sebor > > Test case: > // Following code snippet is taken from examples\manual\time_get.cpp > // NOTE: A SunPro bug requires time.h preceed locale. PR #26255 > #include // for struct tm > #include // for locale, time_get > #include // for stringstream > #include // for cout, endl > // Print out a tm struct value in one atomic operation > std::ostream& operator<< (std::ostream &os, const std::tm &t) > { > std::stringstream strm; > strm << "Daylight Savings = " << t.tm_isdst > << "\nDay of year = " << t.tm_yday > << "\nDay of week = " << t.tm_wday > << "\nYear = " << t.tm_year > << "\nMonth = " << t.tm_mon > << "\nDay of month = " << t.tm_mday > << "\nHour = " << t.tm_hour > << "\nMinute = " << t.tm_min > << "\nSecond = " << t.tm_sec > << '\n'; > // guard for thread safety and output synchronization > const std::ostream::sentry guard (os); > if (guard) > os.rdbuf ()->sputn (strm.str ().c_str (), strm.str ().size ()); > else > os.setstate (os.failbit); > return os; > } > int main () > { > typedef std::istreambuf_iterator > Iter; > // time struct to parse date into > static std::tm timeb; // zero initialized > // Unused, required by time_get > std::ios_base::iostate state; > // Stream object to read from > std::istringstream ins (""); > // Iterators into the stream object > Iter begin (ins); > Iter end; > // Get a reference to the time_get facet in locale loc. > const std::time_get &tg = > std::use_facet >(std::locale ("C")); > // Display time_base::dateorder value. > std::cout << "time_base::dateorder == " << tg.date_order () << ".\n"; > > // Insert date string into stream. > ins.str ("04/07/69"); > // get_date from the stream and output tm contents. > tg.get_date (begin, end, ins, state, &timeb); > std::cout << "Date: Apr 7 1969\n" << timeb << std::endl; > return 0; > } > Stack Trace: > > msvcr80d.dll!_mbstowcs_l_helper(wchar_t * pwcs=0x008e2b78, const char * s=0x008e6008, unsigned int n=1812, localeinfo_struct * plocinfo=0x0012f740) Line 71 C++ > msvcr80d.dll!_mbstowcs_s_l(unsigned int * pConvertedChars=0x0012f7b0, wchar_t * pwcs=0x008e2b78, unsigned int sizeInWords=1812, const char * s=0x008e6008, unsigned int n=4294967295, localeinfo_struct * plocinfo=0x0012f7d4) Line 259 + 0x30 bytes C++ > msvcr80d.dll!_wcsftime_l_stat(wchar_t * wstring=0x008e2b78, unsigned int maxsize=1812, const wchar_t * wformat=0x00473980, const tm * timeptr=0x0012f858, localeinfo_struct * plocinfo=0x0012f7d4) Line 101 + 0x32 bytes C++ > msvcr80d.dll!_wcsftime_l(wchar_t * wstring=0x008e2b78, unsigned int maxsize=1812, const wchar_t * wformat=0x00473980, const tm * timeptr=0x0012f858, localeinfo_struct * plocinfo=0x00000000) Line 152 + 0x1e bytes C++ > msvcr80d.dll!wcsftime(wchar_t * wstring=0x008e2b78, unsigned int maxsize=1812, const wchar_t * wformat=0x00473980, const tm * timeptr=0x0012f858) Line 162 + 0x17 bytes C++ > time_get.exe!__rw::__rw_get_timepunct(const __rw::__rw_facet * pfacet=0x0049465c, int flags=64, unsigned int inx=0) Line 695 + 0x28 bytes C++ > time_get.exe!__rw::__rw_get_timepunct(const __rw::__rw_facet * pfacet=0x0049465c, int flags=64, const void * * names=0x0012fc40, unsigned int * sizes=0x0012faa8) Line 1115 + 0x11 bytes C++ > time_get.exe!__rw::__rw_get_timepunct(const __rw::__rw_facet * pfacet=0x0049465c, int * data=0x0012fa4c, tm * tmb=0x0012fa78, int * * pmem=0x0012fa6c, const void * * names=0x0012fc40, unsigned int * sizes=0x0012faa8) Line 1452 + 0x23 bytes C++ > time_get.exe!std::time_get > >::do_get(std::istreambuf_iterator > __it={...}, std::istreambuf_iterator > __end={...}, std::ios_base & __fl={...}, __rw::__rw_iostate & __err=-858993460, tm * __tmb=0x00492518, char __fmt='x', char __modifier=0) Line 175 + 0x2c bytes C++ > time_get.exe!std::time_get