21_strings/insert.cc on the mainline

Phil Edwards pedwards@disaster.jaj.com
Mon Apr 16 13:32:00 GMT 2001


It's been passing on the branch and failing on the trunk, at least since
the 10th.  The test itself hasn't changed.

The failure is in this block of code:

  str03 = str01;
  csz01 = str03.size();
  csz02 = str02.size();
  str03.insert(13, str02, 0, 12);
  VERIFY( str03 == "rodeo beach, baker beach,marin" );

At the start of the block, after the assignmnet, str03 is

    rodeo beach, marin

After the insertion, str03 is (incorrectly)

    rodeo beach, Xmarin

where X is a single random garbage-memory byte, never the same from run
to run.  The insertion is supposed to take place starting at position X,
as can be seen from the expected results in the VERIFY statement.

I can see nothing obvious in the ChangeLogs; it doesn't look like anyone's
altered the std::string code lately.  Any ideas while I start firing up gdb?


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.



More information about the Libstdc++ mailing list