Subject: Re: bug#51688: ELC+ELN international/emoji.elc crashes

From: Andrea Corallo <[email-masked]>
Date: Wed, 17 Nov 2021 16:27:44 +0000

Andreas Schwab <[email-masked]> writes:

> On Nov 17 2021, Andrea Corallo wrote:
>
>> Andreas Schwab <[email-masked]> writes:
>>
>>> On Nov 17 2021, Andrea Corallo wrote:
>>>
>>>> If the crash is on the libgccjit side IMO it indicates it's a libgccjit
>>>> bug.
>>>
>>> It can easily be a wrong use of it, too.
>>
>> Agree, but it should not crash.
>
> If you pass it invalid data (like use-after-free), it may not be able to
> avoid a crash.

That is true.  OTOH the API of libgccjit AFAIK is made to copy any
region of memory passed to it during the libgccjit record phase so it's
quite robust in this sense.

Here we are crashing calling from 'comp_compile_ctxt_to_file' therfore
we are in the replay phase and use-after-free should have caused a
problem earlier.

I can't prove my conclusion is correct, but that's what my knowledge and
experience on this system tells me here.

Anyway, if someone has access to a machine were we can reproduce it,
creating a libgccjit reproducer using `comp-libgccjit-reproducer' should
be the way to look at it and test if my idea is correct or not.

Regards

  Andrea