From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C35F81F406 for ; Fri, 27 Oct 2023 01:41:07 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=CTjkWqFV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=rBKjt1lz; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 17DDD80D69; Fri, 27 Oct 2023 01:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1698370859; bh=YkQCQ4zCVjuBt5YnS7F7j2cXcYuKBB24UAxAyU9KJ/o=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=CTjkWqFVXVD9tpvlsouiyAOZp0PRhbuNWen9n8vfRP85a7TjB0OK8wL6XnMQHGmer Pd1HoKVbviaq6szRCQo0oE0SFMv3Scqu1gtGfLcBJdNt2I+26gspdsBFDnDp0JxO7m Ec45HsyANszOlBo1KawkEYp9vtavDrW+n+Q0ltJE= Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 5A03680CD0 for ; Fri, 27 Oct 2023 01:40:56 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=rBKjt1lz; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=JlVLk8NyWYDc+7MwX0dxtFOPAbhr3LZrkmCc+pyZluQ=; b=rBKjt1lzZdDJ5fl8q3LbahiNemCEqkR5kHsxP4viHZ1nBIPi/l6IlZfsCZCYMe7x+HnI p9X2bf/+dvFgfWRdWlNl0xaaF+vdZnzn0i+kEJCGZvH/izsiGs+MxNjCoEgIHWfgYAlcbk 8EY/9w32TwotuXFeJqjhWbkrRMRHSgpZHnXQcEgByYtADK0Iub9US3hxX1TbxuGhF4uYTo a2E+amJXayn2Z5fM4dwg+p6PcKvdG+3pB33VO9oswjGT98Qw4fWsKN2nhhGKNzCpb/YoZK 7t2dRYJbrknfELgrpU+AlUykbkRJH8aQBm6KrZF22qFuLokm/wLnIRY3fRM6qaFg== Received: by filterdrecv-655bd866f5-cs4cb with SMTP id filterdrecv-655bd866f5-cs4cb-1-653B1526-17 2023-10-27 01:40:54.720161498 +0000 UTC m=+802796.202627712 Received: from herokuapp.com (unknown) by geopod-ismtpd-2 (SG) with ESMTP id qb-YIWgCSzWjjMtkdLSq0g for ; Fri, 27 Oct 2023 01:40:54.675 +0000 (UTC) Date: Fri, 27 Oct 2023 01:40:54 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 18886 X-Redmine-Issue-Author: ioquatix X-Redmine-Issue-Assignee: ko1 X-Redmine-Sender: jeremyevans0 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 91725 X-SG-EID: =?us-ascii?Q?zy3UxWTRryXcrjCh7SV39ZkShJ1PHkEOmoUEekBgd8G8RAJk=2FsUOlbLwuWEoNU?= =?us-ascii?Q?BxG3BBFmcsr21OPpQwa7zNRSwswJm1szgMd841w?= =?us-ascii?Q?HPqc4NjbnZhvwHe3p7U8j5Ca8H2ma9Kb33XZEXf?= =?us-ascii?Q?qe09Ay3Z+O0UM2fO2HW=2FUqInERBavYDCd6h6KWE?= =?us-ascii?Q?nYVF1Vgt88w=2F49g02Zl6ui7PTMN6IwaUwu1paWX?= =?us-ascii?Q?n61uwjQZs811f7YNIkHH=2FV1sD=2F66Cn5pTbOKHIl?= =?us-ascii?Q?nSaKRFwWxuia7kCGpA+tA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: UNVDPZPGMYME4TSAXBBFLGUHPX4DBKQN X-Message-ID-Hash: UNVDPZPGMYME4TSAXBBFLGUHPX4DBKQN X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:115184] [Ruby master Bug#18886] Struct aref and aset don't trigger any tracepoints. List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "jeremyevans0 (Jeremy Evans) via ruby-core" Cc: "jeremyevans0 (Jeremy Evans)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #18886 has been updated by jeremyevans0 (Jeremy Evans). I submitted a pull request to fix this: https://github.com/ruby/ruby/pull/8782 ---------------------------------------- Bug #18886: Struct aref and aset don't trigger any tracepoints. https://bugs.ruby-lang.org/issues/18886#change-105099 * Author: ioquatix (Samuel Williams) * Status: Open * Priority: Normal * Assignee: ko1 (Koichi Sasada) * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Given the following program, `thing.name` and `thing.shape` don't trigger `c_call` trace points (or any trace points actually). ```ruby pp RUBY_VERSION trace_point = TracePoint.new(:line, :call, :c_call, :a_call) do |trace| puts trace.event if trace.event == :call # Ruby doesn't always mark call-sites in sub-expressions, so we use this approach to compute a call site and mark it: if location = caller_locations(2, 1).first and path = location.path puts "> #{path}:#{location.lineno}:#{trace.event}" end end if path = trace.path puts "= #{path}:#{trace.lineno}:#{trace.event}" end end trace_point.enable # This will trigger call trace points class Thing def name :cat end def shape :square end end thing = Thing.new # Thing = Struct.new(:name, :shape) # thing = Thing.new(:cat, :rectangle) [ name: thing.name, shape: thing.shape, ] ``` ## Current HEAD ``` = ../test.rb:30:line: = ../test.rb:30:c_call:new = ../test.rb:30:c_call:inherited = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:const_added = ../test.rb:31:line: = ../test.rb:31:c_call:new = ../test.rb:31:c_call:initialize = ../test.rb:34:line: ``` ## Proposed PR ``` = ../test.rb:30:line: = ../test.rb:30:c_call:new = ../test.rb:30:c_call:inherited = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:singleton_method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:method_added = ../test.rb:30:c_call:const_added = ../test.rb:31:line: = ../test.rb:31:c_call:new = ../test.rb:31:c_call:initialize = ../test.rb:34:line: = ../test.rb:34:c_call:name = ../test.rb:35:c_call:shape ``` The reason is the internal implementation of struct doesn't have trace point instrumentation in `vm_call_opt_struct_aset` or `vm_call_opt_struct_aref`. Proposed fix: https://github.com/ruby/ruby/pull/6071 but this would need a review, maybe @jeremyevans0 and @ko1 can help. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/