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 10:37:49 +0200 Message-ID: <83lf0uuqaq.fsf@gnu.org> References: <83tufjw848.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9727"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: hx , Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 09 09:38:43 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 1mvEwt-0002LL-6C for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 09:38:43 +0100 Original-Received: from localhost ([::1]:48638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvEwr-0001Zv-Iv for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Dec 2021 03:38:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvEwJ-0000tD-U8 for emacs-devel@gnu.org; Thu, 09 Dec 2021 03:38:07 -0500 Original-Received: from [2001:470:142:3::e] (port=34276 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 1mvEwH-0000li-Q4; Thu, 09 Dec 2021 03:38:07 -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=EoTxNucuzIwYI4OhjhwJUyOLEOm6yY9dTdVREd5/mQE=; b=i4E6+SRrwLnT uyauMZt+RiIN1/S8dve4q51L1dzhsZSTMBKN48PpJX4khipcCNDPawOBAto/M+theDtM85JZFmNSE xIY7uD3e5cfFu9488FXgTDJgHaUqUQrox4ZdRUWUUnOLTAhByytBznLM9sChFg9zhrTCLwgkRVbeZ /T4z2kkoECw4i6gpxiCrmLimjHfuBcSEUJu4pbTQDrldkOF/GyPkvVVe6vcVOWcaTTkqiyaCIR5rI TrvrTy8kMsYnQuhgjk8VvSiEF3N0gmxs68QXEXDnPQwyVkBsYI5gUtkvidkXPEihx6MZlitoGZKyd ZoXPD2h9Ol7DwKvkOuWhrQ==; Original-Received: from [87.69.77.57] (port=1685 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 1mvEwH-00030D-FF; Thu, 09 Dec 2021 03:38:05 -0500 In-Reply-To: (message from hx on Thu, 9 Dec 2021 08:51:03 +0800) 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:281461 Archived-At: > From: hx > Date: Thu, 9 Dec 2021 08:51:03 +0800 > Cc: emacs-devel > > remove the directory (28.0.90-xxx) from ~/.emacs.d/eln-cache/, > start emacs with -nw -q, it will crash after a few seconds without any operation. > after that, it will crash immediately when I start it with the same parameters. It doesn't crash when I try reproducing it, so something is missing from the recipe. Is this with an unmodified Emacs 28.0.90, or is it with your change in dynlib.c? Anyway, does the patch below help? 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. diff --git a/src/comp.c b/src/comp.c index 43feac6..42eb0af 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5191,6 +5191,8 @@ DEFUN ("comp--register-lambda", Fcomp__register_lambda, Scomp__register_lambda, Lisp_Object maxarg, Lisp_Object type, Lisp_Object rest, Lisp_Object comp_u) { + CHECK_CONS (rest); + Lisp_Object doc_idx = FIRST (rest); Lisp_Object intspec = SECOND (rest); struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (comp_u);