From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: hx Newsgroups: gmane.emacs.devel Subject: changed dlopen flags in dynlib.c, gccemacs crash Date: Wed, 8 Dec 2021 14:01:29 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003b6f5705d29c39fd" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3755"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 08 07:03:54 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 1muq3W-0000kW-55 for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Dec 2021 07:03:54 +0100 Original-Received: from localhost ([::1]:37294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muq3U-0000dQ-Aj for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Dec 2021 01:03:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muq1R-0007j0-Jy for emacs-devel@gnu.org; Wed, 08 Dec 2021 01:01:47 -0500 Original-Received: from [2607:f8b0:4864:20::f2d] (port=33341 helo=mail-qv1-xf2d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muq1P-0005ha-EW for emacs-devel@gnu.org; Wed, 08 Dec 2021 01:01:45 -0500 Original-Received: by mail-qv1-xf2d.google.com with SMTP id bu11so1513756qvb.0 for ; Tue, 07 Dec 2021 22:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=6Yeaji8Ntzku1a92G+/ZdzwPOwLbKkSRTZMm9CgprLc=; b=kmgT4y3CNhOiBXCovkkzNpQqJl8U8WXFd9SYWC/OYOy77sxXLbAZh3RQsANnQI4cQd yaRQHVlfZWmxMZ9x8G8d7sJZoOYdl57R1PefgnfTvWK8LrMhCUY3k0bLbAxfiv4xRu+0 6ptMv/R28CeEbrUNRrrRYUEqfNY55YDJ0NdTBYQ5UxWrAMdRWV8qQs+YRqZmjsge/q4v lTwtl2NiFsKb3gM43xu620YK0gs+fNwUkRaiB3CL3vvvb8Fvw+8nStxgq8dB5ZMZ346a rDBw3tpCDR4UYrLDiGmdxdgaxPBzMAlKRdkmtPEQyd9M9ce+2OBF9zPHrdQkRggpTQFU +FuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6Yeaji8Ntzku1a92G+/ZdzwPOwLbKkSRTZMm9CgprLc=; b=CAyq+EPzIZcQRwV+QzOaDRqxTPZAhHH/bE68VlCoiWZE4zHPOJrP6HtM+AQGMps3gv 6hoFSxbJpVAe5z3Sgk0bn+SZ5T0PwaC3cdQszItsBzZ/IslZBXhHCo65Y48yk5FyfRTZ BjaIxiVYElQIM5Hs4GNiMLT6uS/p9o6o7jHFmIGwr8H2zH4qfofPHjrrqUz1x+Yp5DXi pvlM7pN3psLAMffpCpo/dPlTsmkUSRvVIWP1oznv+xe8+GiOD6C+udT1Ciob9r+XiM3B cGnDUxrBr0EqQjYd8QIHsZPtbR93S1ArZCoCN92ISdsz3MaYedhjGlMcNUmTLDY56+xJ 0Oow== X-Gm-Message-State: AOAM530KD/IEijNMgKm/5yLsBYTPfsgrn6y4wnekFVaqeWvXLVFB7YxG 2sjQGwpw6wLnUzTwvYKIRG9Vpqq6iP2bjGzD2WEOMJ9wylA= X-Google-Smtp-Source: ABdhPJyt9+6SPh3GstEKaddhYlywRwfvkF2M/4X57HVYQU19iXU4Q7BrC9bE05Rp7xtVuW845gBNoDNz73CN1FIFimI= X-Received: by 2002:a05:6214:4007:: with SMTP id kd7mr4891383qvb.52.1638943300480; Tue, 07 Dec 2021 22:01:40 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f2d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2d; envelope-from=silent2600@gmail.com; helo=mail-qv1-xf2d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:281319 Archived-At: --0000000000003b6f5705d29c39fd Content-Type: text/plain; charset="UTF-8" Hi, I changed the flags of dlopen in dynlib.c: dynlib_handle_ptr dynlib_open (const char *path) { // return dlopen (path, RTLD_LAZY); return dlopen (path, RTLD_LAZY|RTLD_GLOBAL); } then my dynamic module can load other .so in emacs-27. but it make gccemacs-28 crash: $ /usr/src/emacs/src/emacs -nw -q Fatal error 11: Segmentation fault Backtrace: /usr/src/emacs/src/emacs(+0x1c4c13)[0x558a8d05fc13] /usr/src/emacs/src/emacs(+0x199a0e)[0x558a8d034a0e] /usr/src/emacs/src/emacs(+0x1c44d8)[0x558a8d05f4d8] /usr/src/emacs/src/emacs(+0x1c44ad)[0x558a8d05f4ad] /usr/src/emacs/src/emacs(+0x1c4513)[0x558a8d05f513] /usr/src/emacs/src/emacs(+0x1c46ab)[0x558a8d05f6ab] /lib/x86_64-linux-gnu/libpthread.so.0(+0x14140)[0x7f3bba1a4140] /usr/src/emacs/src/emacs(+0x2b60b6)[0x558a8d1510b6] /home/silent/.emacs.d/eln-cache/28.0.90-8dcada16/cconv-3b1f1f98-cca24f72.eln(top_level_run+0x87)[0x7f3bb37045a7] /usr/src/emacs/src/emacs(+0x2b5d18)[0x558a8d150d18] /usr/src/emacs/src/emacs(+0x2b6830)[0x558a8d151830] --0000000000003b6f5705d29c39fd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I changed the flags of dlopen in dy= nlib.c:

dynlib_handle_ptr
dynlib_open (const ch= ar *path)
{
=C2=A0 // return dlopen (path, RTLD_LAZY); =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
= =C2=A0 return dlopen (path, RTLD_LAZY|RTLD_GLOBAL);
}

= then my dynamic module can load other .so in emacs-27.

=
but it make gccemacs-28 crash:

$ /usr/src/emacs/src/emacs -nw -= q
Fatal error 11: Segmentation fault
Backtrace:
/usr/src/emacs/src= /emacs(+0x1c4c13)[0x558a8d05fc13]
/usr/src/emacs/src/emacs(+0x199a0e)[0x= 558a8d034a0e]
/usr/src/emacs/src/emacs(+0x1c44d8)[0x558a8d05f4d8]
/us= r/src/emacs/src/emacs(+0x1c44ad)[0x558a8d05f4ad]
/usr/src/emacs/src/emac= s(+0x1c4513)[0x558a8d05f513]
/usr/src/emacs/src/emacs(+0x1c46ab)[0x558a8= d05f6ab]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x14140)[0x7f3bba1a4140]=
/usr/src/emacs/src/emacs(+0x2b60b6)[0x558a8d1510b6]
/home/silent/.em= acs.d/eln-cache/28.0.90-8dcada16/cconv-3b1f1f98-cca24f72.eln(top_level_run+= 0x87)[0x7f3bb37045a7]
/usr/src/emacs/src/emacs(+0x2b5d18)[0x558a8d150d18= ]
/usr/src/emacs/src/emacs(+0x2b6830)[0x558a8d151830]
--0000000000003b6f5705d29c39fd--