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 <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/83448f1c Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/83448f1c Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/83448f1c Branch: refs/heads/master Commit: 83448f1c41d3f73ce0c0174c1725c78af3afd0d0 Parents: d03a2d6 Author: Tim Armstrong <[email protected]> Authored: Mon Jul 2 17:08:46 2018 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Tue Jul 3 18:29:31 2018 +0000 ---------------------------------------------------------------------- be/src/util/mem-info.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/83448f1c/be/src/util/mem-info.cc ---------------------------------------------------------------------- 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; }
