From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: changed dlopen flags in dynlib.c, gccemacs crash Date: Thu, 09 Dec 2021 14:08:58 +0200 Message-ID: <834k7iugit.fsf@gnu.org> References: <83tufjw848.fsf@gnu.org> <83lf0uuqaq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25955"; mail-complaints-to="usenet@ciao.gmane.io" Cc: silent2600@gmail.com, emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 13:10:13 2021 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 1mvIFZ-0006ZF-H5 for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 13:10:13 +0100 Original-Received: from localhost ([::1]:51032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvIFY-0000OU-4F for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 07:10:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvIEd-0007hq-TX for emacs-devel@gnu.org; Thu, 09 Dec 2021 07:09:15 -0500 Original-Received: from [2001:470:142:3::e] (port=39480 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvIEd-0007Q6-Ke; Thu, 09 Dec 2021 07:09:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KaS6M+XTXEucem+ScM4JFnIUbIlSciLj/+FW1RxAIVc=; b=SV7xSY2CsM2N 88iiYmygMoz/Fe/3tISO4Fs8/DqMIHPwPJbUbUiV1mHb5e+oKliQB8Iaklq/LYA8VaFQgXCmY3umd tgJZK/LwDhxS4Q1s7BNM4CE68kneZRr/9BxsxRpeSi0565D22oqQEHlwcqrqbzIMvxqSCDupemIMl wYrWFacNHLB7Zd+cp8eQ/7W+dbgWbtlwYPADmaZ50xesG6Isl4ahFzq+Fhy6Oscmm15Enb78FgNW6 Dt+Uib3I99bk49C050MGbo+xmrGQ0rKq3yu/49rMKlkEGxlzr+FavjC2YCjtInzPQJRjBtbPacLTn +s3WqKZJ3oG3SRUsk6JJ4Q==; Original-Received: from [87.69.77.57] (port=2933 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvIEd-00079r-Ck; Thu, 09 Dec 2021 07:09:15 -0500 In-Reply-To: (message from Andrea Corallo on Thu, 09 Dec 2021 10:53:57 +0000) 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" Xref: news.gmane.io gmane.emacs.devel:281483 Archived-At: > From: Andrea Corallo > Cc: hx , emacs-devel@gnu.org > Date: Thu, 09 Dec 2021 10:53:57 +0000 > > > Andrea, any better ideas? I don't understand the reason for the > > crash, as we seem to have defenses against this in Fnative_elisp_load, > > so I'm probably missing something. > > Hello all, > > I'm no expert on 'dlopen' so I'm not sure about the impact of using > RTLD_GLOBAL. But should be noted that .eln files do share a number of > symbol names, I'm wondering if this could be somehow problematic when > using RTLD_GLOBAL, that's my suspect here. Assuming the RTLD_GLOBAL flag was added. But still, the crash is because we assume a Lisp object is a cons cell and take its CDR. So evidently it isn't a cons cell (probably nil), and I don't understand how that could be caused, not even if RTLD_GLOBAL was used.