NetBSD Problem Report #60763

From zakinko@snowrabbit.org  Tue Sep 22 08:40:03 2026
Return-Path: <zakinko@snowrabbit.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 21BE41A923B
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 22 Sep 2026 08:40:03 +0000 (UTC)
Message-Id: <20260922084000.3CDEDC92AC@bambi.snowrabbit.org>
Date: Tue, 22 Sep 2026 17:40:00 +0900 (JST)
From: zakinko@snowrabbit.org
Reply-To: zakinko@snowrabbit.org
To: gnats-bugs@NetBSD.org
Cc: zakinko@snowrabbit.org
Subject: lang/ruby34: does not link with the ruby-rjit option on NetBSD (rjit_c.o missing from DTRACE_DEPENDENT_OBJS)
X-Send-Pr-Version: 3.95
X-From4GNATS: "zakinko@snowrabbit.org via gnats" <gnats-admin@NetBSD.org>

>Number:         60763
>Category:       pkg
>Synopsis:       lang/ruby34: does not link with the ruby-rjit option on NetBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    taca
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 22 08:45:00 +0000 2026
>Closed-Date:    Fri Nov 06 03:23:20 +0000 2026
>Last-Modified:  Fri Nov 06 03:23:20 +0000 2026
>Originator:     Showta Ishizaki
>Release:        NetBSD 11.0, pkgsrc trunk as of 2026-09-22
>Organization:
>Environment:
System: NetBSD 11.0 amd64
Architecture: x86_64
Machine: amd64
>Description:
	With PKG_OPTIONS.ruby34=ruby-rjit (instead of the default
	ruby-yjit), ruby34-3.4.10nb2 stops while linking miniruby:

	  ld: rjit_c.o: relocation R_X86_64_PLT32 against absolute symbol
	  `__dtraceenabled_ruby___cmethod__return' in section `.text' is disallowed

	rjit_c.c calls RUBY_DTRACE_CMETHOD_RETURN_HOOK, but rjit_c.o is
	not in DTRACE_DEPENDENT_OBJS in template/Makefile.in.  On NetBSD
	configure picks "dtrace needs post processing... rebuild", so
	"dtrace -G" rewrites only the objects in that list; rjit_c.o
	keeps the absolute placeholder symbols and ld refuses them.

	The default yjit build is not affected: rjit_c.c is compiled
	under #if USE_RJIT and is empty there.  Upstream fixed the same
	thing for yjit.o in 2022 (https://bugs.ruby-lang.org/issues/18480)
	and rjit_c.o was left out.  The ruby_3_4 branch still has it;
	master no longer has rjit_c.c, so this is a 3.4-only patch.

	The change is one line in the existing
	patches/patch-template_Makefile.in; the other two hunks are
	unchanged, only their offsets moved because the file was
	regenerated against 3.4.10.  I rebuilt with ruby-rjit
	on NetBSD 11.0/amd64: "processing probes in object files" runs,
	miniruby links, and

	  $ ruby34 -e 'puts RubyVM.const_defined?(:RJIT)'
	  true

>How-To-Repeat:
	  # cd /usr/pkgsrc/lang/ruby34
	  # make PKG_OPTIONS.ruby34=ruby-rjit build

	Fails at "linking miniruby" with the ld message above.

>Fix:
	patch -p0 from the top of pkgsrc.

	diff -ruN -x CVS -x work /usr/pkgsrc/lang/ruby34/Makefile lang/ruby34/Makefile
	--- /usr/pkgsrc/lang/ruby34/Makefile	2026-09-18 05:47:20.827063127 +0000
	+++ lang/ruby34/Makefile	2026-09-22 06:46:11.364176907 +0000
	@@ -2,7 +2,7 @@

	 DISTNAME=	${RUBY_DISTNAME}
	 PKGNAME=	${RUBY_PKGPREFIX}-${RUBY_VERSION}
	-PKGREVISION=	2
	+PKGREVISION=	3
	 CATEGORIES=	lang ruby
	 MASTER_SITES=	${MASTER_SITE_RUBY}

	diff -ruN -x CVS -x work /usr/pkgsrc/lang/ruby34/distinfo lang/ruby34/distinfo
	--- /usr/pkgsrc/lang/ruby34/distinfo	2026-09-18 05:47:20.831730759 +0000
	+++ lang/ruby34/distinfo	2026-09-22 06:46:11.686227894 +0000
	@@ -19,7 +19,7 @@
	 SHA1 (patch-lib_rubygems_installer.rb) = 4ef74b4f79837a929e81bcd0e7eba9061a442304
	 SHA1 (patch-lib_rubygems_platform.rb) = bde36a8fc1ba2fbf4d6fb8829bc116fb4d09b404
	 SHA1 (patch-lib_rubygems_specification.rb) = a3154185ef89fb33e699dd54b19a8e274f3275e0
	-SHA1 (patch-template_Makefile.in) = 3cf5d612ef725dc64d6a90d377b191a29ebfdf17
	+SHA1 (patch-template_Makefile.in) = 6138ccea7ac17dbb31a70d123700350154ffc503
	 SHA1 (patch-test_rubygems_test__gem.rb) = 32f7c7d7f8a024c045d78c2bce93944fc3113d04
	 SHA1 (patch-thread__pthread.c) = 7c1231933a2d6ce9d56891ab512371841697fbca
	 SHA1 (patch-tool_ifchange) = 1803bb6a1836e232dcabcf38f11c9881dbf726ea
	diff -ruN -x CVS -x work /usr/pkgsrc/lang/ruby34/patches/patch-template_Makefile.in lang/ruby34/patches/patch-template_Makefile.in
	--- /usr/pkgsrc/lang/ruby34/patches/patch-template_Makefile.in	2026-09-06 15:13:58.000000000 +0000
	+++ lang/ruby34/patches/patch-template_Makefile.in	2026-09-22 06:46:11.359395014 +0000
	@@ -8,9 +8,27 @@

	 https://bugs.ruby-lang.org/issues/22059

	+rjit_c.c has a DTrace hook (RUBY_DTRACE_CMETHOD_RETURN_HOOK) but its
	+object was not in DTRACE_DEPENDENT_OBJS, so on a DTRACE_REBUILD=yes
	+system such as NetBSD "dtrace -G" never processed it and linking
	+miniruby failed with --enable-rjit:
	+
	+  ld: rjit_c.o: relocation R_X86_64_PLT32 against absolute symbol
	+  `__dtraceenabled_ruby___cmethod__return' in section `.text' is disallowed
	+
	+Same fix as upstream made for yjit.o (https://bugs.ruby-lang.org/issues/18480).
	+
	 --- template/Makefile.in.orig	2026-05-07 20:25:14.644318083 +0000
	 +++ template/Makefile.in
	-@@ -523,7 +523,7 @@ probes.stamp: $(DTRACE_REBUILD_OBJS)
	+@@ -203,6 +203,7 @@
	+ 			string.$(OBJEXT) \
	+ 			symbol.$(OBJEXT) \
	+ 			vm.$(OBJEXT) \
	++			rjit_c.$(OBJEXT) \
	+ 			$(YJIT_OBJ)
	+ 
	+ THREAD_MODEL  = @THREAD_MODEL@
	+@@ -513,7 +514,7 @@

	  probes.stamp: $(DTRACE_REBUILD_OBJS)
	  	$(Q) if test -f $@ -o -f probes.$(OBJEXT); then \
	@@ -19,7 +37,7 @@
	  	  $(ECHO0) "rebuilding objects which were modified by \"dtrace -G\""; \
	  	  $(MAKE) $(DTRACE_REBUILD_OBJS); \
	  	fi
	-@@ -537,7 +537,7 @@ probes.$(OBJEXT): $(srcdir)/probes.d $(DTRACE_REBUILD:
	+@@ -527,7 +528,7 @@

	  # DTrace static library hacks described here:
	  # https://marc.info/?l=opensolaris-dtrace-discuss&m=114761203110734&w=4

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->taca
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Tue, 22 Sep 2026 08:51:08 +0000
Responsible-Changed-Why:
Over to maintainer


State-Changed-From-To: open->feedback
State-Changed-By: taca@NetBSD.org
State-Changed-When: Tue, 22 Sep 2026 09:30:50 +0000
State-Changed-Why:
Patch is applied except PKGREVISION bump.



From: "Takahiro Kambe" <taca@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60763 CVS commit: pkgsrc/lang/ruby34
Date: Tue, 22 Sep 2026 09:29:37 +0000

 Module Name:	pkgsrc
 Committed By:	taca
 Date:		Tue Sep 22 09:29:37 UTC 2026

 Modified Files:
 	pkgsrc/lang/ruby34: distinfo
 	pkgsrc/lang/ruby34/patches: patch-template_Makefile.in

 Log Message:
 lang/ruby34: Fix ruby-rjit option

 Fix build problem with ruby-rjit PKG_OPTIONS provided by PR pkg/60763.

 No PKGREVISION bump since it is simply build problem.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/lang/ruby34/distinfo
 cvs rdiff -u -r1.1 -r1.2 \
     pkgsrc/lang/ruby34/patches/patch-template_Makefile.in

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60763 CVS commit: [pkgsrc-2026Q3] pkgsrc/lang
Date: Tue, 20 Oct 2026 23:07:19 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Tue Oct 20 23:07:19 UTC 2026

 Modified Files:
 	pkgsrc/lang/ruby [pkgsrc-2026Q3]: rubyversion.mk
 	pkgsrc/lang/ruby34 [pkgsrc-2026Q3]: Makefile distinfo
 	pkgsrc/lang/ruby34/patches [pkgsrc-2026Q3]: patch-template_Makefile.in
 Removed Files:
 	pkgsrc/lang/ruby34/patches [pkgsrc-2026Q3]: patch-lib_resolv.rb

 Log Message:
 Pullup ticket #7276 - requested by taca
 lang/ruby34: Security fix

 Revisions pulled up:
 - lang/ruby/rubyversion.mk                                      1.332
 - lang/ruby34/Makefile                                          1.13
 - lang/ruby34/distinfo                                          1.19-1.20
 - lang/ruby34/patches/patch-lib_resolv.rb                       deleted
 - lang/ruby34/patches/patch-template_Makefile.in                1.2

 ---
    Module Name:	pkgsrc
    Committed By:	taca
    Date:		Tue Sep 22 09:29:37 UTC 2026

    Modified Files:
    	pkgsrc/lang/ruby34: distinfo
    	pkgsrc/lang/ruby34/patches: patch-template_Makefile.in

    Log Message:
    lang/ruby34: Fix ruby-rjit option

    Fix build problem with ruby-rjit PKG_OPTIONS provided by PR pkg/60763.

    No PKGREVISION bump since it is simply build problem.

 ---
    Module Name:	pkgsrc
    Committed By:	taca
    Date:		Thu Sep 24 15:28:57 UTC 2026

    Modified Files:
    	pkgsrc/lang/ruby: rubyversion.mk
    	pkgsrc/lang/ruby34: Makefile distinfo
    Removed Files:
    	pkgsrc/lang/ruby34/patches: patch-lib_resolv.rb

    Log Message:
    lang/ruby34: update to 3.4.11

    3.4.11 (2026-09-23)

    * Bug #22196: Heap-use-after-free in fiber_switch with transfer-termina=
    ted
      async tasks on 3.4.10
    * Guard fiber target across fiber_store. by samuel-williams-shopify =B7=
     Pull
      Request #17951
    * Bug #21842: Encoding of rb_interned_str
    * Bug #22126: Stack underflow for partial DCE and loops
    * Bug #22124: void value missed in parse.y
    * Bug #22183: parse.y interpolation inside lambda literal
    * Bug #22099: Keyword-only method silently accepts a positional argumen=
    t
    * Bug #22133: Ruby's default SIGINT handling ignores Thread.handle_inte=
    rrupt
      masking.
    * Bug #22189: Enumerator::Lazy#to_enum does not accept method names as =
    strings
    * Bug #22191: Signal.trap(:EXIT) exception only shown if at_exit also r=
    aises
    * Bug #22198: win32: heap overflow in Kernel#system
    * Bug #20958: fix ENV.keys encoding on windows
    * Bug #11438: native_thread_init_stack() get machine.stack_start unequa=
    l to
      thread's stack start address, x86 win32
    * Bug #22218: Line TracePoint misses executed loop condition after a gu=
    ard
    * Bug #22223: Socket.tcp with connect_timeout returns a phantom "connec=
    ted"
      socket for a refused connection on macOS 27 (kernel answers EISCONN o=
    n
      connect retry; SO_ERROR never consulted)
    * Bug #22290: Adding instance variables to anonymous object may bloat a=
    ll
      future classes
    * Bug #22269: Coverage.line_stub clobbers already-collected coverage da=
    ta
    * Bug #22257: Prepending a module to an already-included module leaves =
    stale
      super caches
    * Handle spurious wakeups in Thread#join. by samuel-williams-shopify =B7=
     Pull
      Request #13532
    * Bug #22311: Build crashes on macOS 26 with the macOS 27 SDK because
      pipe2() and dup3() are unavailable
    * Bug #22259: Arrays sharding a buffer segfault when concatenating with=
     each
      other
    * Bug #22264: Warning missing from parse.y hash literals
    * Bug #22303: EncodingError from interpolating symbol crashes whole pro=
    cess
    * Bug #22315: heap-use-after-free in String unpack with a block that mu=
    tates
      the receiver
    * Bug #22318: heap uaf triggered in array.flatten
    * Bug #22319: heap buffer overflow triggered by array's zip function
    * Bug #22322: AddressSanitizer: use-after-poison in econv_description
      /ruby-src/build/../transcode.c
    * Bug #22321: Assertion Failed:
      rb_vm_search_method_slowpath:RB_TYPE_2_P(klass, RUBY_T_CLASS,
      RUBY_T_ICLASS): klass: T_MODULE
    * Bug #22334: Assertion Failed: VM_ENV_FLAGS:FIXNUM_P(flags)
    * Bug #22336: IO:Buffer Heap uaf
    * Bug #9932: Permutation - Segment fault
    * Bug #22330: heap uaf from string.encode()
    * Bug #22340: Win32: File.stat succeeds on symbolic-link loops on Windo=
    ws
    * Bug #22335: Stack corruption with >31 keyword args and refined Intege=
    r#=3D=3D
    * Bug #22338: [Backport] win32: create directory symlinks for relative
      directory targets


 To generate a diff of this commit:
 cvs rdiff -u -r1.331 -r1.331.2.1 pkgsrc/lang/ruby/rubyversion.mk
 cvs rdiff -u -r1.12 -r1.12.2.1 pkgsrc/lang/ruby34/Makefile
 cvs rdiff -u -r1.18 -r1.18.2.1 pkgsrc/lang/ruby34/distinfo
 cvs rdiff -u -r1.3 -r0 pkgsrc/lang/ruby34/patches/patch-lib_resolv.rb
 cvs rdiff -u -r1.1 -r1.1.2.1 \
     pkgsrc/lang/ruby34/patches/patch-template_Makefile.in

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: zakinko@snowrabbit.org
To: gnats-bugs@NetBSD.org
Cc: taca@NetBSD.org, zakinko@snowrabbit.org
Subject: Re: pkg/60763: lang/ruby34: does not link with the ruby-rjit option on NetBSD
Date: Thu,  5 Nov 2026 15:13:20 +0900 (JST)

 Thank you for applying this, and I am sorry for the late reply.

 I built lang/ruby34 3.4.12 with ruby-rjit on NetBSD 11.0/amd64, and
 miniruby links now. In the work directory, after paxctl +m on the
 binary, `--rjit` runs and RubyVM::RJIT.enabled? returns true.

 This PR can be closed.

State-Changed-From-To: feedback->closed
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Fri, 06 Nov 2026 03:23:20 +0000
State-Changed-Why:
Issue resolved, submitter good to close. Thanks for the PR.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.