You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by bo...@apache.org on 2019/02/27 10:27:27 UTC

[impala] 05/06: IMPALA-7237: handle hex digits in ParseSmaps()

This is an automated email from the ASF dual-hosted git repository.

boroknagyz pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 7b37fdec2fd5f6793da8ca4faf7426d1d66d5cc4
Author: Tim Armstrong <ta...@cloudera.com>
AuthorDate: Mon Jul 2 17:08:46 2018 -0700

    IMPALA-7237: handle hex digits in ParseSmaps()
    
    Testing:
    Manual. Added some temporary logging to print out which branch it took
    with each line and confirmed it took the right branch for a line
    starting with 'f'.
    
    Change-Id: I3dad846dafb25b414bee1858eb63f3eda31d59ac
    Reviewed-on: http://gerrit.cloudera.org:8080/10853
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/util/mem-info.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/be/src/util/mem-info.cc b/be/src/util/mem-info.cc
index 9ffc98d..10ce09f 100644
--- a/be/src/util/mem-info.cc
+++ b/be/src/util/mem-info.cc
@@ -115,9 +115,10 @@ MappedMemInfo MemInfo::ParseSmaps() {
     string line;
     getline(smaps, line);
     if (line.empty()) continue;
-    if (isdigit(line[0])) {
+    if (isdigit(line[0]) || (line[0] >= 'a' && line[0] <= 'f')) {
       // Line is the start of a new mapping, of form:
       // 561ceff9c000-561ceffa1000 rw-p 00000000 00:00 0
+      // We distinguish this case by checking for lower-case hex digits.
       ++result.num_maps;
       continue;
     }