From owner-svn-src-head@freebsd.org Thu May 21 17:01:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A369B2DE3F9; Thu, 21 May 2020 17:01:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SbVw6ps3z41Qt; Thu, 21 May 2020 17:01:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id a23so6074065qto.1; Thu, 21 May 2020 10:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YrZ/xlc2m8ejjRTlJX3nv5gPbrfyK2uvwg5Z+HBmBz8=; b=fio+83qPivCTeET29WjgbzGU32aI9oWj6bT+ijVETvj7nVAkws7PgwY62/KxyxGGDG 5V9FuuuI1/sjFZCfvC8w2e1PgnL1U5eonyK1mf+wyjAvASkmByselfUIgxhxbthiks/f lziYOYOvs5LD80olARTDYsqazdcwZCAAEgmAazjGzLKKP5mpwgtsVKcqsbqgwgBB0arx VohEKX/1IIOXar2zDrhlNtk8aauD8IUwHqb9v2oV+GHEwuA6qHh59crWUiZjgiZi9fl8 0jDLJe0VDnbvKUsYTag7oJPrtWIowqg5i0GWXe9u1xHY4Czrkdr9WqdlInov6XHFqqiX 7iuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=YrZ/xlc2m8ejjRTlJX3nv5gPbrfyK2uvwg5Z+HBmBz8=; b=RC414EnTs0dbemcjpHv7PXQsFSw6tSQNRhlagmOZaQQNMpPZl1YITWohZ7J4NEv0L2 HMkn04PY0DHXUzEiksWBMdEEbujAiZmTroGP5sxuMgoDpU0Z1d+vGUGTUXewZXXduMtU XsfOjb81DO5XMW17XI1wTrXpsP92u1S5x0gXRdlBHjsTol6Dqnplp02Svl+kyTXXSvPx Xo2sbZpS8EW6jJr3s018kD17/krpkMNnO4J3XVB2Mlz3D8i5rTstzpk/PgRTLsn+znx6 Ev/m7gVjdRyA3JuE4epKLxJ79frPfJblAJ42hF5Xu/PG9DJIvYwtSThyLHXbt8Q1V0A6 BjAg== X-Gm-Message-State: AOAM532HE6EZZrHvH18O7Ubz1rcJ5K3Aw/FlxBY3u7dv/WREQBXUQKLz Jt838ixrn+IIPi7dViRRP78= X-Google-Smtp-Source: ABdhPJzVg42PRPQOfJlaQvEorAy//JmnQk/yzBXTmGboa7C67a4Le8btklyWADLCIF8Lk4M5f6y7oA== X-Received: by 2002:ac8:47c4:: with SMTP id d4mr11944539qtr.110.1590080487837; Thu, 21 May 2020 10:01:27 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id r14sm3627558qke.62.2020.05.21.10.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 10:01:26 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 13:01:24 -0400 From: Mark Johnston To: Konstantin Belousov Cc: John Baldwin , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521170124.GE85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521165646.GF64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49SbVw6ps3z41Qt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fio+83qP; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.32 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.66)[-0.663]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.41)[-0.408]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.55)[-0.548]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 17:01:29 -0000 On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > > On 5/21/20 8:12 AM, Mark Johnston wrote: > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > >>>> > > >>>> Author: kib > > >>>> Date: Wed May 20 22:08:26 2020 > > >>>> New Revision: 361303 > > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > > >>>> > > >>>> Log: > > >>>> Change the samantic of struct link_map l_addr member. > > >>>> > > >>>> It previously returned the object map base address, while all other > > >>>> ELF operating systems return load offset, i.e. the difference between > > >>>> map base and the link base. > > >>>> > > >>>> Explain the meaning of the field in the man page. > > >>>> > > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > > >>>> > > >>>> PR: 246561 > > >>>> Requested by: Damjan Jovanovic > > >>>> Reviewed by: emaste, jhb, cem (previous version) > > >>>> Sponsored by: The FreeBSD Foundation > > >>>> MFC after: 1 week > > >>>> Differential revision: https://reviews.freebsd.org/D24918 > > >>>> > > >>>> Modified: > > >>>> head/lib/libc/gen/dlinfo.3 > > >>>> head/libexec/rtld-elf/rtld.c > > >>>> head/sys/sys/link_elf.h > > >>> > > >>> Hi, > > >>> > > >>> After this commit, some ports fail to build with signal 11. > > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > > >>> Disabling the DTRACE option makes it able to build again. > > >>> > > >> I see, thank you for reporting. > > >> > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > > >> that l_addr is the base, not relocbase. > > >> > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > > > It appears it has been the same since DTrace was imported. illumos > > > still has similar code. > > > > > > Note that drti.o is linked into any executable and shlib that defines > > > static probes, so the ABI change affects more than just dtrace(1). > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > > preserve the old behaviour for the old value? > > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > > (absolute address) or relocbase (relative address). In the discussion > > in the phabricator I had assumed that all other OS's treated l_addr as > > the relative offset (relocbase). Does the code for illumos assume an > > absolute address or does it assume a relative address in l_addr? > > It is rather clear, since the dtrace code was pristine, that Solaris > provides the mapbase. I do not have Solaris/Illumos box anymore > (for quite some time), so I cannot check directly. > > My current PoV is that l_addr semantic must be restored, and relocbase > provided by newly added member. > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? Isn't the problem when perl is *not* linked as PIE? In this case relocbase is 0, so the ELF header access becomes a NULL pointer dereference.