From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: The poor quality of Emacs's backtraces Date: Mon, 17 Jul 2023 17:52:12 +0200 Message-ID: <5382C438-D871-4C79-820C-DCA17C59CBCA@gmail.com> References: <3D901B62-4826-4783-B684-968E6890E75A@gmail.com> <6CB5E709-8F5A-4015-9F2C-337A87916C66@gmail.com> <909FC7C1-5473-4746-97E4-B067E6C2B271@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36432"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 17 18:12:41 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qLQq0-0009GX-O2 for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jul 2023 18:12:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLQpc-0005wK-7m; Mon, 17 Jul 2023 12:12:16 -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 1qLQWJ-0006Nu-17 for emacs-devel@gnu.org; Mon, 17 Jul 2023 11:52:19 -0400 Original-Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qLQWH-0002AN-Ch for emacs-devel@gnu.org; Mon, 17 Jul 2023 11:52:18 -0400 Original-Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f95bf5c493so7362141e87.3 for ; Mon, 17 Jul 2023 08:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689609134; x=1692201134; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=dTNb8SXbs0fDqfrmhHZlG+gFMlZk7dh4tcl6Usk/K+I=; b=Xb31YABC6np0mW6jIHtA0ri2wPuy1WOsc2CpBbrLEQp+cwp30h/SLgUregXFv865e2 sCPdI32dnfTlGkQgMi/MX3CzdVHU6/bj4YX70S1WIcdJt7S0SOIkVEtMWGcuJJxK7wYG e2B/DOYTcpOcakYpIJMb7LLrW9ZQVaYDbrVQN2kG97AZZD2LKZCwNdA1nlvYRn/L/WWA e09EEEJeQobu/rJn+ZZcZ6B+2uzn8Yt0U7mdEiqQ1Xv+g0P05/intV3lEee+3A7wTcN8 2SbeUj92aMGNITqGINaoe63ha9/r2Nl0V9GNvhNhd3zT2gr4GgTWu8dNYxiggHW+aQ5O yUbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689609134; x=1692201134; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dTNb8SXbs0fDqfrmhHZlG+gFMlZk7dh4tcl6Usk/K+I=; b=WknJLvtdtKr/S9lziDzkaoO8XGtEZX61RexgPYIg03Gk8zm41IGX09GeTwyyOJ1HBP 00KJ2NEbBC69Sk8C3Qdq84aadZJcNkP0p8G1GRTE0nhULmL7t8Jnqw+Q3HWpXWX+gT7e 677sMPDkd1yrTIklLWBdB/L8xCGzx6Fw28PI75Y+s54G1yVPtnUXiVLtFkJuxwzV3jv0 Z85wE6r0Wa0HDTu9lq+BQM2YrluU6REseXK57pB3SrkBqaL7jyoAa5wJHqnSj2SRIu7w lhjaipJ+eLI27BWYgoGSBb/ypmbA+W1b1GgOzoDT0FJvq6VCGGdKyrUvAFoIITUV6+YW KQoQ== X-Gm-Message-State: ABy/qLad1XNkXe7t6g0qqjtgQsnUJeIUD3ZoDqFMCCEx77v5YQwvlCJh bJwc8dtD8j0/Vls2/HoYNyFBIVGjgnQ= X-Google-Smtp-Source: APBJJlEfEfir5Yr/byajqd8XcfCHRbnnRPUmFix01XArytcEnlHHOnLFQIm6MPta5xZTa/fZVKnYSA== X-Received: by 2002:a2e:86c2:0:b0:2b6:ccd6:3ec2 with SMTP id n2-20020a2e86c2000000b002b6ccd63ec2mr8583346ljj.36.1689609133991; Mon, 17 Jul 2023 08:52:13 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id n24-20020a2e86d8000000b002b6cde9f325sm3600794ljj.105.2023.07.17.08.52.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2023 08:52:13 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 17 Jul 2023 12:12:10 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307934 Archived-At: 14 juli 2023 kl. 22.51 skrev Alan Mackenzie : > Aren't we always careful? I wasn't intending to make anything slower > (except, marginally, the handling of errors). Your intent is not in doubt, but the execution path is so sensitive that = seemingly minor changes often have outsized effect on performance. (This = cuts both ways: there have also been optimisation opportunities in what = appeared to be reasonably efficient code.) Bug#64613 has been opened for this effort, and I intend to continue it = shortly. I'm certainly open for ideas about how to solve the problem = efficiently and effectively. > I have working code implementing the putting of this extra information > into backtraces. Writing code is the easy part. What I'm wary about is rushing a solution = -- your solution -- to a problem that hasn't yet been studied in = sufficient depth, and with no regard to the costs involved: not just = performance but also the fact that other people, myself included, will = be the ones to maintain the feature for all foreseeable future. The problem is compounded by our current suboptimal representation of = closures: instead of the typical =E2=9F=A8function, environment=E2=9F=A9 = tuple, we represent them as copies of the function object with = closed-over variables allocated separately and hacked into the (also = copied) constant vector. Making that copied function object even bigger = is the opposite of what we want to do. There is also the question of what information should be there if any = were to be added. For example, source location could arguably be more = useful than function name. But more importantly, since you said yourself that you would have been = satisfied with a backtrace that included the faulting operation, and we = agree that this is something we want in any case, wouldn't it make sense = to begin there? The risk is much lower and it won't saddle us with = irreversible maintenance costs.