emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changed dlopen flags in dynlib.c, gccemacs crash


From: Andrea Corallo
Subject: Re: changed dlopen flags in dynlib.c, gccemacs crash
Date: Thu, 09 Dec 2021 20:47:57 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrea Corallo <akrl@sdf.org>
>> Cc: hx <silent2600@gmail.com>, 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.

Yep

> 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.

I'm just speculating *but*: `comp--register-lambda' it's called directly
from the eln synthetized code that is run when the .eln is loaded.

The arguments of `comp--register-lambda' are immediates that are set
into the eln not long before, and this process (in 'load_comp_unit')
indeed requires symbol resolution (through our `dynlib_sym').

My guess is that something goes wrong in that area (but as mentioned
I've no proof of that).

  Andrea



reply via email to

[Prev in Thread] Current Thread [Next in Thread]