From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sergey Vinokurov Newsgroups: gmane.emacs.bugs Subject: bug#69953: [PATCH] Remove duplicated asserts and checks Date: Thu, 9 May 2024 15:16:05 +0100 Message-ID: References: <9378099f-76e1-45b4-8e4d-0f077cb28307@gmail.com> <86o7b5zafb.fsf@gnu.org> <86jzl1r9mt.fsf@gnu.org> <86r0erw6pu.fsf@gnu.org> <86wmo378hj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17327"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 69953@debbugs.gnu.org To: Eli Zaretskii , p.stephani2@gmail.com, dancol@dancol.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 09 16:17:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s54a5-0004Gj-8d for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 May 2024 16:17:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s54Zb-0004sz-VJ; Thu, 09 May 2024 10:16:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s54ZZ-0004s5-4d for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 10:16:37 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s54ZY-0008Mj-SJ for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 10:16:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s54Zy-0003PB-RR for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 10:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sergey Vinokurov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 May 2024 14:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69953 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch wontfix Original-Received: via spool by 69953-submit@debbugs.gnu.org id=B69953.171526420313062 (code B ref 69953); Thu, 09 May 2024 14:17:02 +0000 Original-Received: (at 69953) by debbugs.gnu.org; 9 May 2024 14:16:43 +0000 Original-Received: from localhost ([127.0.0.1]:55527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s54Zf-0003Oc-3N for submit@debbugs.gnu.org; Thu, 09 May 2024 10:16:43 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:58585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s54Za-0003OQ-Gh for 69953@debbugs.gnu.org; Thu, 09 May 2024 10:16:41 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-34d7d04808bso645093f8f.0 for <69953@debbugs.gnu.org>; Thu, 09 May 2024 07:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715264166; x=1715868966; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=owEJr2CjJj5XB0Uw47ZQhz4Q7PLCOYseckhnF/1gfhw=; b=NrH+unw5qG5JvKw337vytAlWFjQe83CAonYqsZ10o+kygl2Fu6NZ0uOrAP78oEetJ7 ES8gHbJ3pWKWVn9s9jEyejDR7E3X9LG68Lk+kRVJ4qfaeSXRs5TTSY3lKODgD6mpwBKA hE2/V2U4+VFIHgx9NToWJ6LFA8D7CY6uunnZdhnC1rKF+t554yFvYAwy0oTgA2mZNxn/ 6JFBphKUQ6w051qy2U40pbutHK1RaCDSyI2xvqPJp8RiyiWCNlygugApnM0506pqEKYY O7TPRbMyHHuNSXKrSyutlud/XMxIdE4nrlABEOm0fmuC1VvLMAYvd8njGfyRBHXQUBBL QzpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715264166; x=1715868966; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=owEJr2CjJj5XB0Uw47ZQhz4Q7PLCOYseckhnF/1gfhw=; b=TBkfa9N0fHcw+8daBvxYytxz7otPZL6u1OT1+vIs7Sb59Z0IWWkKHbW15Z5T9IyLDi H2/DSd+Yu4BWOm1aJKW/NKzypAFOhcLengdR3Ddaw6aA5FCwIqmo6hEGv7ekboBr26mb mFHOqWxaQwCyYrxue4Dm6PwZs0hiTvGG0EiaHewIyY4k7ADXet7OSPUk4wbHNVaq6uG4 /R4ubXaVqdPGvOm/8M8qG995MhZhjaYjiZe1L8A+xZ3qLviJTKFvKWOwJEFewYKldKep A6dgNxgmOwt8J8BKiqupKI5AY8ISpRJbFXv6B25xKRj1u7R0hrce4GMcavDdv5+Bw7gW fPLw== X-Gm-Message-State: AOJu0YyP5NvW+KaUWv0ObnS+Mg+yaBzbbzyNeu/eX+v3gTdzmAXpBwB5 AvG0GXr7OmuFgWbrZd7x5xqrELtHQQMmSjrZIfyh+XDCrujJZzZ4 X-Google-Smtp-Source: AGHT+IGD5oMyhjyCIJJpYEv61vMTDqtVjJSp/968KsSE9Y7d7MwOvszjqDPbvRuFeS+gJmwq32huiw== X-Received: by 2002:a5d:68c8:0:b0:34a:d1d4:cb3c with SMTP id ffacd0b85a97d-34fca6233aamr5621504f8f.39.1715264166037; Thu, 09 May 2024 07:16:06 -0700 (PDT) Original-Received: from [192.168.1.100] ([152.37.93.248]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502baad0a0sm1846273f8f.74.2024.05.09.07.16.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 May 2024 07:16:05 -0700 (PDT) Content-Language: en-GB In-Reply-To: <86wmo378hj.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284758 Archived-At: On 09/05/2024 08:24, Eli Zaretskii wrote: > tags 69953 wontfix > close 69953 > thanks > >> Cc: serg.foo@gmail.com, 69953@debbugs.gnu.org >> Date: Sat, 27 Apr 2024 11:27:41 +0300 >> From: Eli Zaretskii >> >> Ping! Ping! Philipp and Daniel, any comments? >> >>> Cc: serg.foo@gmail.com, 69953@debbugs.gnu.org >>> Date: Sat, 13 Apr 2024 10:42:50 +0300 >>> From: Eli Zaretskii >>> >>> Ping! Philipp and Daniel, do you have any comments on this? >>> >>>> Cc: Philipp Stephani , 69953@debbugs.gnu.org, >>>> Daniel Colascione >>>> Date: Sat, 23 Mar 2024 09:15:04 +0200 >>>> From: Eli Zaretskii >>>> >>>>> Date: Sat, 23 Mar 2024 03:27:34 +0000 >>>>> From: Sergey Vinokurov >>>>> >>>>> I noticed that emacs-module.c contains duplicate >>>>> module_non_local_exit_check() checks and >>>>> module_assert_thread/module_assert_env asserts, mostly performed at the >>>>> same point in program sequentially. >>>>> >>>>> The module_non_local_exit_check() checks happen in >>>>> MODULE_HANDLE_NONLOCAL_EXIT and MODULE_FUNCTION_BEGIN_NO_CATCH macros. >>>>> The MODULE_HANDLE_NONLOCAL_EXIT is never used by itself, only as part of >>>>> MODULE_FUNCTION_BEGIN which starts with MODULE_FUNCTION_BEGIN_NO_CATCH >>>>> that performs the check. >>>>> >>>>> In addition, there're 6 "Implementation of runtime and environment >>>>> functions" rules outlined where MODULE_HANDLE_NONLOCAL_EXIT should be >>>>> called at step 4 but module_non_local_exit_check() is supposed to have >>>>> already happened at step 3 so documentation does not seem to intend for >>>>> the check to be repeated in MODULE_HANDLE_NONLOCAL_EXIT. >>>>> >>>>> Regarding asserts my observation is that module_non_local_exit_check() >>>>> already contains module_assert_thread and module_assert_env so there's >>>>> no need to do asserts if first thing we do is call >>>>> module_non_local_exit_check. >>>> >>>> Thanks, but why is that a problem? module_assertions is false by >>>> default, and the function to turn on module assertions is not even >>>> documented in the ELisp manual. IOW, this is a debugging aid which >>>> will rarely if at all activated, and if it is, that's on purpose by >>>> the programmer who is investigating some tricky problem. Why is it a >>>> problem to have too many assertions, which might help that programmer >>>> find a bug? >>>> >>>> I added Daniel and Philipp to the discussion, in case they have >>>> comments to this proposal. > > Given the lack of comments, I conclude that there's no interest in > installing this, and I'm therefore closing this bug. I'm interested to get this installed - can I do anything to facilitate?