From patchwork Mon Oct 26 23:40:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1388209 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Ohgtvf26; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKrzN1FNyz9sRK for ; Tue, 27 Oct 2020 10:44:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CBE5D8251C; Tue, 27 Oct 2020 00:41:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ohgtvf26"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D5D638248B; Tue, 27 Oct 2020 00:40:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D20C78248B for ; Tue, 27 Oct 2020 00:40:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id q25so12995944ioh.4 for ; Mon, 26 Oct 2020 16:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GvQzhIohiqhxaWEF30ns5MshIoqHubap+Uhhdrn1Kj4=; b=Ohgtvf26/V29VK9e2zNBq+L7GP9AuE7XppB69iGkiOD6VHzuu1TocmE0/Bf80GeR6R SNBp8Yv7htdI3aUCZyWsSYqcGvItli6GW7yqddxhkh8AWb4ZryTHtSdQGESZTwCmnbWh oElj8faZRluoqD/W2CZelgArx6S/ZxTL8Wqcw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GvQzhIohiqhxaWEF30ns5MshIoqHubap+Uhhdrn1Kj4=; b=eEz/TV1XyfCHpxGdug6YrOdqtJB9CWpYY7oEW+L2vQ4KEXvqxFn1GIhZxRYcS0Isc1 qf4+yLjH1fUsjmfjDBJiU6T6eQ4xRBySjtnpSTR4Sffev4JuQB2HnldKADI4m7yMHbte jk6djrPvxuTQUbgcnB6xIgPCeyZJKEJVnUEPlEHlWH/TfNJ+O8B0zkBUy3Davm8Icplu IlylWYur4pTMDPEeqchHBAM/yU8AxeIJzt9BmuW81gSWppEQ3el03zs8SIkVx9d1Pr1F IYSSKwYrdtq9XY0x4tkI3xN/jBzfUOtzBS5Cu9qKYBVIBpgbZwFe5VkXI6C8rdWztbHJ m6/w== X-Gm-Message-State: AOAM532/XHZtQ+KUUzQNZjg5w11a9qQXNP8fHrOSS5tgDD0+Z9NJALOe r17btnoQPhqEsRZv3j0H3BnEgFZ/BxILSR6K X-Google-Smtp-Source: ABdhPJxrPlkigGJxELq3maZ5ThWtQTHlavUsmKJ4rqo7MD8bW0vPgz3LFc/J609aasOl7lfsFu7WSQ== X-Received: by 2002:a05:6602:2e91:: with SMTP id m17mr7274958iow.185.1603755635527; Mon, 26 Oct 2020 16:40:35 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id e17sm7066857ile.60.2020.10.26.16.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 16:40:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Alper Nebi Yasak , Simon Glass Subject: [PATCH v2 07/28] binman: Expand the error message for breaching a section Date: Mon, 26 Oct 2020 17:40:05 -0600 Message-Id: <20201026234026.1903778-8-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026234026.1903778-1-sjg@chromium.org> References: <20201026234026.1903778-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add in a few more details to this error message to make it easier to see what is going on. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/etype/section.py | 10 ++++++---- tools/binman/ftest.py | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 327750461eb..a3e37c33c1b 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -220,10 +220,12 @@ class Entry_section(Entry): if (entry.offset < self._skip_at_start or entry.offset + entry.size > self._skip_at_start + self.size): - entry.Raise("Offset %#x (%d) is outside the section starting " - "at %#x (%d)" % - (entry.offset, entry.offset, self._skip_at_start, - self._skip_at_start)) + entry.Raise('Offset %#x (%d) size %#x (%d) is outside the ' + "section '%s' starting at %#x (%d) " + 'of size %#x (%d)' % + (entry.offset, entry.offset, entry.size, entry.size, + self._node.path, self._skip_at_start, + self._skip_at_start, self.size, self.size)) if entry.offset < offset and entry.size: entry.Raise("Offset %#x (%d) overlaps with previous entry '%s' " "ending at %#x (%d)" % diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index adc16038d99..4f7e22612cc 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -970,8 +970,9 @@ class TestFunctional(unittest.TestCase): """Test that the end-at-4gb property checks for offset boundaries""" with self.assertRaises(ValueError) as e: self._DoTestFile('028_pack_4gb_outside.dts') - self.assertIn("Node '/binman/u-boot': Offset 0x0 (0) is outside " - "the section starting at 0xffffffe0 (4294967264)", + self.assertIn("Node '/binman/u-boot': Offset 0x0 (0) size 0x4 (4) " + "is outside the section '/binman' starting at " + '0xffffffe0 (4294967264) of size 0x20 (32)', str(e.exception)) def testPackX86Rom(self):