[ https://issues.apache.org/jira/browse/STDCXX-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496380 ] Liviu Nicoara commented on STDCXX-402: -------------------------------------- Pretty sure. The key in reproducing it seems to be non-zero bytes following the terminal zero in the array received by __rw_strtoull. It seems normal to not be able to reproduce it consistently; I also have experienced "dry" runs because the buffer just happened to have been followed by an area of memory which was previously zeroed. I tried to reproduce it on HP-UX as well but I failed. Crafting my own allocator did not help. I have spent a couple of hours on it and I am sorry I cannot spend more time to shed some more light. All builds on all platforms with all compilers exhibit failures in the same tests in the same place. I would say this is pretty compelling evidence -- coupled with the spurious failures on selected platforms -- that there is a problem. I have my money on __rw_strtoull. :-) Liviu > long long stream extraction fails for strings longer than 9 decimal characters > ------------------------------------------------------------------------------ > > Key: STDCXX-402 > URL: https://issues.apache.org/jira/browse/STDCXX-402 > Project: C++ Standard Library > Issue Type: Bug > Components: 27. Input/Output > Environment: $ uname -a > Linux cyberdyne 2.6.17.8 #9 SMP PREEMPT Wed Nov 22 09:34:35 EST 2006 i686 unknown unknown GNU/Linux > $ gcc -v > Using built-in specs. > Target: i486-slackware-linux > Configured with: ../gcc-src/configure --prefix=/opt/compilers/gcc-4.1.2 --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux --enable-languages=c,c++ > Thread model: posix > gcc version 4.1.2 > Built a 15s version of the library. > Reporter: Liviu Nicoara > > The following test case: > $ cat t.cpp > #include > #include > #include > int > main () > { > long long n = 0; > { > std::stringstream s (std::string ("214748364")); > s >> n; > std::cout << n << "\n"; > } > { > std::stringstream s (std::string ("2147483640")); > s >> n; > std::cout << n << "\n"; > } > return 0; > } > Produces inconsistent (but consistently wrong) results in different runs: > $ ./t > 214748364 > 9223372036854775807 > $ ./t > 214748364 > 214748365089 > $ ./t > 214748364 > 9223372036854775807 > Liviu -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.