<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>10148</bug_id>
          
          <creation_ts>2006-10-17 09:57:59 +0400</creation_ts>
          <short_desc>Проблема при использовании стековых переменных</short_desc>
          <delta_ts>2006-12-04 00:14:49 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>gcc4.1-c++</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>10144</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ilia Korolyov">korol82</reporter>
          <assigned_to name="Dmitry V. Levin">ldv</assigned_to>
          <cc>glebfm</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41408</commentid>
    <comment_count>0</comment_count>
    <who name="Ilia Korolyov">korol82</who>
    <bug_when>2006-10-17 09:58:00 +0400</bug_when>
    <thetext>Актуальный сизиф. gcc 4.1.1 20060928 (ALT Linux, build 4.1.1-alt9)
Есть следующий код


int main( int argc, char** argv )
{
        try
        {
                boost::regex
re(&quot;(\\w+):\\/\\/(([^:]+?)(:(.+))?@)?([^:\\/]+)(:(\\d+))?((\\/.+?)*)(\\?(.+?))?(#(.+))?&quot;);
                boost::match_results&lt;std::string::const_iterator&gt; what;

                std::string
first(&quot;http://breeze@abc.ru/banner.jsp?keywords=%CC%E5%E3%E0%F4%EE%ED&amp;id=1&amp;ip=1.1.1.1&amp;version=1#123&quot;);


                boost::regex::locale_type loc(&quot;ru_RU.cp1251&quot;);
//              re.imbue( loc );

                for( int i=0; i&lt;5; ++i )
                {
                        if(
!boost::regex_match(boost::algorithm::trim_copy(first), what, re) ) continue;
                        cerr &lt;&lt; &quot;res =  &quot; &lt;&lt; what[12].str() &lt;&lt; endl;

                        string tmp = boost::algorithm::trim_copy(first);
                        if( !boost::regex_match(tmp, what, re) ) continue;
                        cerr &lt;&lt; &quot;res2 =  &quot; &lt;&lt; what[12].str() &lt;&lt; endl;
                }

                re.imbue( loc );
        }
        catch (std::exception&amp; ex)
        {
                cerr &lt;&lt; &quot;UGLY STANDART ERROR: &quot; &lt;&lt; ex.what() &lt;&lt; endl;
                return -1;
        }
        catch(...)
        {
                cerr &lt;&lt; &quot;UGLY ERROR: UNHANDLED EXCEPTION&quot; &lt;&lt; endl;
                return -1;
        }

        return 0;
}

Данные код просто парсит URL при помощи boost::regex, есть две проблемы:
1. Строки &quot;res=...&quot; и &quot;res2=...&quot; должны быть одинаковыми, реально получается

res =  keywords=%CC%E5%E3%E0%F4%EE%ED&amp;iи╟Aь╥╟Aь╥.1&amp;version=1
res2 =  keywords=%CC%E5%E3%E0%F4%EE%ED&amp;id=1&amp;ip=1.1.1.1&amp;version=1

т.е. в строке &quot;res=...&quot; присутствует явный мусор

Подобное поведение встречается не только при работе с boost, но и с
произвольными объектами в случае, когда результат функции не сохраняется явно в
какой-то переменной, а непосредственно передаётся в другую функцию


PS Возможно я обратился не по адресу - подскажите, куда следует обратиться
Steps to Reproduce:
make &amp;&amp; run</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42696</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2006-12-04 00:14:44 +0300</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 10144 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>