<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Analyzer: locale_facets.tcc false positive "Assigned value is garbage or undefined""
   href="https://bugs.llvm.org/show_bug.cgi?id=32235">32235</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Analyzer: locale_facets.tcc false positive "Assigned value is garbage or undefined"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marshallk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Getting buffer overrun analysis errors like this one for simple ostream log
statements such as this one: "DPLOG(ERROR) << "Unable to terminate process " <<
process_;"

LLVM version: clang version 5.0.0 (trunk 296321)
Platform: Linux; target: Linux
Code:
<a href="https://cs.chromium.org/chromium/src/base/process/process_posix.cc?rcl=2749492d345c9b4fe350a9b94ed34dd5170c4f81&l=352">https://cs.chromium.org/chromium/src/base/process/process_posix.cc?rcl=2749492d345c9b4fe350a9b94ed34dd5170c4f81&l=352</a>

[67/20605] CXX obj/base/base/process_posix.o
In file included from ../../base/process/process_posix.cc:5:
In file included from ../../base/process/process.h:10:
In file included from ../../base/process/process_handle.h:12:
In file included from ../../base/files/file_path.h:113:
In file included from ../../base/containers/hash_tables.h:13:
In file included from ../../base/hash.h:16:
In file included from ../../base/logging.h:12:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/sstream:39:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/istream:40:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ios:45:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_ios.h:39:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.h:2608:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ios:45:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_ios.h:39:
In file included from
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.h:2608:
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1258:9:
warning: Assigned value is garbage or undefined
        *__s++ = *__first++;
               ^
../../base/process/process_posix.cc:309:17: note: Assuming the condition is
false
  bool result = kill(process_, SIGTERM) == 0;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/process/process_posix.cc:310:14: note: Left side of '&&' is false
  if (result && wait) {
             ^
../../base/process/process_posix.cc:351:3: note: Taking true branch
  if (!result)
  ^
../../base/process/process_posix.cc:352:5: note: Assuming the condition is
false
    DPLOG(ERROR) << "Unable to terminate process " << process_;
    ^~~~~~~~~~~~
../../base/logging.h:777:3: note: expanded from macro 'DPLOG'
  LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/logging.h:402:3: note: expanded from macro 'LAZY_STREAM'
  !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  ^~~~~~~~~~~~
../../base/process/process_posix.cc:352:5: note: '?' condition is false
../../base/logging.h:777:3: note: expanded from macro 'DPLOG'
  LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
  ^
../../base/logging.h:402:3: note: expanded from macro 'LAZY_STREAM'
  !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
  ^
../../base/process/process_posix.cc:352:5: note: Calling
'basic_ostream::operator<<'
    DPLOG(ERROR) << "Unable to terminate process " << process_;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../base/logging.h:777:3: note: expanded from macro 'DPLOG'
  LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity))
  ^
../../base/logging.h:402:62: note: expanded from macro 'LAZY_STREAM'
  !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream)
                                                             ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/ostream.tcc:113:11:
note: Assuming '__fmt' is not equal to 'oct'
      if (__fmt == ios_base::oct || __fmt == ios_base::hex)
          ^~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/ostream.tcc:113:11:
note: Left side of '||' is false
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/ostream.tcc:113:37:
note: Assuming '__fmt' is not equal to 'hex'
      if (__fmt == ios_base::oct || __fmt == ios_base::hex)
                                    ^~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/ostream.tcc:113:7:
note: Taking false branch
      if (__fmt == ios_base::oct || __fmt == ios_base::hex)
      ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/ostream.tcc:116:9:
note: Calling 'basic_ostream::_M_insert'
        return _M_insert(static_cast<long>(__n));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/ostream.tcc:69:2:
note: Taking true branch
        if (__cerb)
        ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/ostream.tcc:75:7:
note: Calling 'num_put::put'
                if (__np.put(*this, *this, this->fill(), __v).failed())
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.h:2336:16:
note: Calling 'num_put::do_put'
      { return this->do_put(__s, __f, __fill, __v); }
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.h:2475:16:
note: Calling 'num_put::_M_insert_int'
      { return _M_insert_int(__s, __io, __fill, __v); } 
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:868:22:
note: Assuming '__basefield' is equal to 'oct'
        const bool __dec = (__basefield != ios_base::oct
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:869:8:
note: Left side of '&&' is false
                            && __basefield != ios_base::hex);
                            ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:870:40:
note: Left side of '||' is true
        const __unsigned_type __u = ((__v > 0 || !__dec)
                                              ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:877:6:
note: Assuming the condition is true
        if (__lc->_M_use_grouping)
            ^~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:877:2:
note: Taking true branch
        if (__lc->_M_use_grouping)
        ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:884:6:
note: Calling 'num_put::_M_group_int'
            _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:839:21:
note: Calling '__add_grouping'
      _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1249:14:
note: Assuming the condition is true
      while (__last - __first > __gbeg[__idx]
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1249:14:
note: Left side of '&&' is true
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1250:10:
note: Assuming the condition is true
             && static_cast<signed char>(__gbeg[__idx]) > 0
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1249:14:
note: Left side of '&&' is true
      while (__last - __first > __gbeg[__idx]
             ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1249:7:
note: Loop condition is true.  Entering loop body
      while (__last - __first > __gbeg[__idx]
      ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1254:4:
note: Assuming the condition is false
          __idx < __gsize - 1 ? ++__idx : ++__ctr;
          ^~~~~~~~~~~~~~~~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1254:4:
note: '?' condition is false
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1250:7:
note: Left side of '&&' is false
             && static_cast<signed char>(__gbeg[__idx]) > 0
             ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1257:7:
note: Loop condition is true.  Entering loop body
      while (__first != __last)
      ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1257:7:
note: Loop condition is true.  Entering loop body
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1257:7:
note: Loop condition is true.  Entering loop body
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1257:7:
note: Loop condition is true.  Entering loop body
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/locale_facets.tcc:1258:9:
note: Assigned value is garbage or undefined
        *__s++ = *__first++;
               ^ ~~~~~~~~~~
1 warning generated.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>