From nobody Thu Jun 29 12:14:10 2023 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QsHSC3MGxz4kqjD for ; Thu, 29 Jun 2023 12:14:19 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (smtp.digiware.nl [IPv6:2001:4cb8:90:ffff::3]) (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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QsHSC1R3cz41by; Thu, 29 Jun 2023 12:14:19 +0000 (UTC) (envelope-from wjw@digiware.nl) Authentication-Results: mx1.freebsd.org; none Received: from router10g.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 29E714AA51; Thu, 29 Jun 2023 14:14:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=digiware.nl; s=medusa-2017; t=1688040854; bh=bcSzGPbBarQvRQGN+hx+Fv735afROOLtDxv49/RlkAE=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=nuShS+bkyOeowZq1A5SqjjN8Nk33ZC6aXzGcF1u2gLcKaHyvRMY4T1TlTGQIPFVxU XoXDwRUngwnI10z9srgqn+eqXvq1Zxtw3pjuOpmNY1mMDMJjacDavjOiVlXhbS19sT 7B+da9w7asSCYR9TYNyz2K1wwlMLkntcSu/gSWV9haP+OOKw2iW7mu8M0r5xKF4y81 God9AX0A+S6LMIyYK3OlJRBHM447nci/tkXFRm/Ue/96m8u4iOAfYIHctaP0ocveTD 6trHoSeK2Lox6tDhpCJv7jyJoid+4SOIcRuWCPUbTZaWNz/cqF6OEsMZV9a6P936zW 6/aZkgY07q/og== X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by router10g.digiware.nl (router10g.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yoNnxGSwUnBZ; Thu, 29 Jun 2023 14:14:12 +0200 (CEST) Received: from [IPV6:2001:4cb8:3:1:7004:11e2:3726:f035] (unknown [IPv6:2001:4cb8:3:1:7004:11e2:3726:f035]) (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) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id D7F454AA50; Thu, 29 Jun 2023 14:14:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=digiware.nl; s=medusa-2017; t=1688040852; bh=bcSzGPbBarQvRQGN+hx+Fv735afROOLtDxv49/RlkAE=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=uePb/lr7KZRIPonAftyYmzwguWeJXuA/219litdAT8ktrE0y/UHB7ORMpHJkVF3N3 hfCFcXaSDVAz9miKj5SqkM+rAFAqF3Zzhthm2uwkhZizeFLVwBgGejUZrWsBQRRw2t W+hxQR8PR8Kssk1YOXInyCWBQXKU2KYiAKmnA9YXMzdc57Rx9OVXBrkK+covqmMxPQ dzSMaf8KGgZUHYpiB+Ez9BWCoSIvUyx53fZrKw/Chh//VljsqbvED7OqYUzaaYmT8f SNmbemb+diINy2EigGaNHXlZB8N2b6Pp2UBo0RUFsXKLywSG/CLre/eiSB67tvCsF0 gqbu3yC1WI2dQ== Message-ID: <333315bb-4502-f54e-482f-33b914a542f4@digiware.nl> Date: Thu, 29 Jun 2023 14:14:10 +0200 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.12.0 Subject: Re: __cxa_thread_call_dtors: dtr 0x........ from unloaded dso, skipping Content-Language: nl To: Dimitry Andric Cc: "Bjoern A. Zeeb" , current@freebsd.org References: <46pq4r4n-p46r-47nn-r1ss-7r2984891pn7@yvfgf.mnoonqbm.arg> <16A8852E-DEA9-408E-80BC-94322FB2415E@FreeBSD.org> <0A55614E-3577-4933-9CCD-4D723DFA86E8@FreeBSD.org> <08035b3a-7356-efc8-616b-cbf46c1904e7@digiware.nl> <9e0a27a0-acb3-d30c-14db-ea59042d435b@digiware.nl> <363E70BD-DD8C-4038-B11C-536FD604B233@FreeBSD.org> From: Willem Jan Withagen In-Reply-To: <363E70BD-DD8C-4038-B11C-536FD604B233@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QsHSC1R3cz41by X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:28878, ipnet:2001:4cb8::/29, country:NL] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 29-6-2023 14:01, Dimitry Andric wrote: > Actually I had that in my Ceph-ports as well, and chose to ignore it.... > Looked into the difference between FreeBSD and Linux. > Linux prevents that message by counting the number of loads, and only unloads > when the counter hits zero. FreeBSD just seems to unload, and report illegal access. >>> There is no "loading" and "unloading" going on, since this is about a >>> static executable. What happened was that __cxa_thread_call_dtors() was >>> giving a misleading message, because _rtld_addr_phdr() always returned >>> 0. Kostik has now made it so _rtld_addr_phdr() does the right thing for >>> static executables. >> So the "feature" I described is still in there? >> Any chance of that getting fixed? > I'm not sure which "feature" you mean. The only thing that is happening > in this particular case is that a static executable uses threads, and > when those threads exit, their destructors should be called. > > If you are talking about dynamic executables, then something entirely > different may be going on. And there might certainly be bugs in there. Oke, you are right. This about dynamic loadable libraries. What happens is dat several libraries are loaded multiple times by code either in the main program and/or other libraries... And on shutdown all those loads are matched with unloads. Needless to say that that can create a mess, if only when  a library was already unloaded by another part of the code/library, and then _exit() wants to unload that library because it has registered itself to be unload at end_of_running. So most of my time, the exec space was not overwritten (since we are shutting down) but still the unloader reports that there are illegal accesses to already unloaded code. In most of the cases with Ceph, this is the auto generated destroy code for all kinds of C++ objects. Like I wrote: Linux works around this, by reference counting how many loads were done. And by unloading the counter is decreased, getting the real unload only when the counter hits zero. I was looking into how to fix this, but then got distracted by $work, so I never really got into anything that looks like a fix. --WjW