From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27176 invoked by alias); 25 Jan 2019 21:20:18 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 27153 invoked by uid 89); 25 Jan 2019 21:20:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=our X-Spam-Status: No, score=-27.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx0a-00082601.pphosted.com Received: from mx0b-00082601.pphosted.com (HELO mx0a-00082601.pphosted.com) (67.231.153.30) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Jan 2019 21:20:16 +0000 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.27/8.16.0.27) with SMTP id x0PLJJPU027917 for ; Fri, 25 Jan 2019 13:20:15 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=MFs20kPs8FAwjc2z6Qgz/lbS7qYSrY2sp6pqxuji/zM=; b=lqEuiqtXqBq8qdc+96K/A7RyirQUxegmQMnTp4pCMVpMe+afshGG8EpWnRJgdVJdQcBq EKNwMgQTFQtzb24zC/HOcBiX+azGBRShUz35zfQSWVplvoAEaW/iIlmcKUW7Bhvk3JFe 01IIjNZndMaQ2qbXxZ7qoknr1UeQah6UvJ0= Received: from mail.thefacebook.com ([199.201.64.23]) by m0089730.ppops.net with ESMTP id 2q89988664-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 25 Jan 2019 13:20:15 -0800 Received: from mx-out.facebook.com (2620:10d:c081:10::13) by mail.thefacebook.com (2620:10d:c081:35::126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1531.3; Fri, 25 Jan 2019 13:20:13 -0800 Received: by devbig003.ftw2.facebook.com (Postfix, from userid 128203) id 0A87937021F5; Fri, 25 Jan 2019 13:20:10 -0800 (PST) Smtp-Origin-Hostprefix: devbig From: Yonghong Song Smtp-Origin-Hostname: devbig003.ftw2.facebook.com To: , CC: Smtp-Origin-Cluster: ftw2c04 Subject: [PATCH elfutils 1/2] [libdwfl] parse inode in /proc/pid/maps correctly Date: Fri, 25 Jan 2019 21:20:00 -0000 Message-ID: <20190125212009.2775258-2-yhs@fb.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125212009.2775258-1-yhs@fb.com> References: <20190125212009.2775258-1-yhs@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-25_13:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-SW-Source: 2019-q1/txt/msg00089.txt.bz2 The inode number in /proc/pid/maps is displayed as "unsigned long" type. In one of our x64 system, we have inode number exceeding valid "long" type range, which caused the following test failure: FAIL: dwfl-bug-fd-leak FAIL: run-backtrace-dwarf.sh FAIL: vdsosyms The offending map entry: 7f269246b000-7f269246c000 rw-p 0002e000 00:50 10224326387095067468 /home/... This patch changed sscanf inode number type from PRIi64 to PRIu64 and fixed the problem. Signed-off-by: Yonghong Song --- libdwfl/linux-proc-maps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c index c4438c0f..719cba68 100644 --- a/libdwfl/linux-proc-maps.c +++ b/libdwfl/linux-proc-maps.c @@ -217,7 +217,7 @@ proc_maps_report (Dwfl *dwfl, FILE *f, GElf_Addr sysinfo_ehdr, pid_t pid) uint64_t ino; int nread = -1; if (sscanf (line, "%" PRIx64 "-%" PRIx64 " %*s %" PRIx64 - " %x:%x %" PRIi64 " %n", + " %x:%x %" PRIu64 " %n", &start, &end, &offset, &dmajor, &dminor, &ino, &nread) < 6 || nread <= 0) { -- 2.17.1