From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by sourceware.org (Postfix) with ESMTPS id DA280386F829 for ; Mon, 27 Apr 2020 12:08:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DA280386F829 Received: by mail-wm1-x342.google.com with SMTP id k12so10667851wmj.3 for ; Mon, 27 Apr 2020 05:08:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+mG7CdYVYBt6UBsgNFIdQgDDXED1WmmwHzadig8PxVo=; b=mexEx9+HkzRXx85+hSPokfHYdC0XxFItatGMEENzZ6uuFIWr1f7NLSIXApNuXeiz3l +5+2VqranmYlsn46hp4JKZ2ZPj5KRh1O3brDQ/wvttJRfpubZpEzW1Z98vu1hZ2dGjF+ C3EaOTqU/i5ZkEfVXJKcCUsjJk5UKfGIqDLRzaB4zb3UMLjPDfuYLm55qm+RtKo5V2a1 EN2rMPFGhXNpNXbdbh0akybtrVszL7pcLbwayr1jyBT0OqGpCLH6nes4xe6r5jei0h9Y 14DbA1IYYi9r6xHEyUctSCCP2H8re/c5HKgisSv0xaCCr1eusLy0eSJJ5bOZO3K6HcLg 0xHw== X-Gm-Message-State: AGi0PuaGHnE8I2i4Mj9m+Mowd3LyGwn9EGRDB7m3ZXmOKiTyl8A8VqFe XGVa7Z8/Iv5AB1w2+MYEhV+FLA== X-Google-Smtp-Source: APiQypIpOsF9dGVzm5iw+rOiJCUNITLbS0zzHbqWaaONO9gGAtqoeycqupm7D2BUlpXSZpzb0Uja8Q== X-Received: by 2002:a7b:cbc6:: with SMTP id n6mr27706290wmi.155.1587989329650; Mon, 27 Apr 2020 05:08:49 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:e8f7:125b:61e9:733d]) by smtp.gmail.com with ESMTPSA id q10sm19844153wrv.95.2020.04.27.05.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:08:49 -0700 (PDT) Date: Mon, 27 Apr 2020 14:08:48 +0200 From: Matthias Maennich To: Giuliano Procida Cc: libabigail@sourceware.org, dodji@seketeli.org, kernel-team@android.com Subject: Re: [PATCH v3 16/21] abg-tools-utils.cc: Assert generated regexes OK. Message-ID: <20200427120848.GN159704@google.com> References: <20200423154441.170531-1-gprocida@google.com> <20200424092132.150547-1-gprocida@google.com> <20200424092132.150547-17-gprocida@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200424092132.150547-17-gprocida@google.com> X-Spam-Status: No, score=-41.4 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2020 12:08:52 -0000 On Fri, Apr 24, 2020 at 10:21:27AM +0100, Giuliano Procida wrote: >There are a couple of places where regexes are generated interally. ^^^ typo >Assert they compile OK. > >This is just paranoia. There should be no behavioural changes. > > * src/abg-tools-utils.cc (handle_file_entry): Assert > internally-generated regex compiles. > (gen_suppr_spec_from_kernel_abi_whitelists): Assert > internally-generated regex compiles. > >Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich Cheers, Matthias >--- > src/abg-tools-utils.cc | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc >index fe0de750..3af9fc49 100644 >--- a/src/abg-tools-utils.cc >+++ b/src/abg-tools-utils.cc >@@ -1818,6 +1818,7 @@ handle_file_entry(const string& file_path, > // Types that are defined in system headers are usually > // OK to be considered as public types. > regex::regex_t_sptr headers_regex = regex::compile("^/usr/include/"); >+ ABG_ASSERT(headers_regex); > suppr->set_source_location_to_keep_regex(headers_regex); > suppr->set_is_artificial(true); > } >@@ -2008,6 +2009,7 @@ gen_suppr_spec_from_kernel_abi_whitelists > // the function and variable names expressed in the white list. > regex::regex_t_sptr regex = > regex::compile(regex::generate_from_strings(whitelisted_names)); >+ ABG_ASSERT(regex); > > // Build a suppression specification which *keeps* functions > // whose ELF symbols match the regular expression contained >-- >2.26.2.303.gf8c07b1a785-goog >