[Bug libstdc++/11838] boost::lexical_cast segfault

pinskia at physics dot uc dot edu gcc-bugzilla@gcc.gnu.org
Thu Aug 7 00:34:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-07 00:34 -------
>From looking at the code:
  template <class charT, class traits>
  inline
  std::basic_ostream<charT, traits>&
  operator<<(std::basic_ostream<charT, traits>& os, const greg_month& m)
  {
    typedef boost::date_time::ostream_month_formatter<greg_base_facet, charT> 
greg_month_formatter;
    std::locale locale = os.getloc();
    if (std::has_facet<greg_base_facet>(locale)) {
      const greg_base_facet& f = std::use_facet<greg_base_facet>(locale);
      greg_month_formatter::format_month(m, os, f);

    }
    else {
      os << std::setw(2) << std::setfill('0') << m;   //this line
    }

    return os;
  }

The problem there is stack overflow that is causing the seg fault but that is because the 
line marked this line is calling the same function over and over.  I do not know if this is a 
boost problem or libstdc++ problem (becuase I do not like locals at all and I do not know 
them).



More information about the Gcc-bugs mailing list