libjit
[Top][All Lists]
Advanced

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

Re: [Libjit] [Dotgnu-libjit] Function cannot return constant


From: Alexey Galakhov
Subject: Re: [Libjit] [Dotgnu-libjit] Function cannot return constant
Date: Wed, 27 Feb 2013 18:45:55 +0600
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Hi Aleksey,

I investigated the issue. It is caused by some kind of memory corruption
due to inconsistent calls to the following:

_jit_cache_get_function(jit_cache_t cache, void *func_info)
_jit_cache_get_function_start(jit_memory_context_t memctx, void *func_info)
_jit_cache_get_function_end(jit_memory_context_t memctx, void *func_info)

In jit-dump.c, jit_function_t is passed to these functions instead of
jit_cache_node_t. For example, in jit_dump_function():

void *end  = _jit_memory_get_function_end(func->context, func);

I suggest using jit_cache_node_t instead of void* to protect against
such problems. Why not use compiler's type checks?

Regards,
Alex

On 02/27/2013 03:12 AM, Aleksey Demakov wrote:
> Hi Alexey,
> 
> Thanks for the report.
> 
> In the last couple of days I was moving the libjit stuff to
> a new location. Please use address@hidden mailing list
> from now on. Also please use the new git repository.
> 
> As I am done with preparing the new infrastructure I
> will look into your reports.
> 
> Regards,
> Aleksey
> 
> On Tue, Feb 26, 2013 at 7:25 PM, Alexey Galakhov <address@hidden> wrote:
>> Hello,
>>
>> I found a bug that was just triggered by the constant folding but really
>> introduced in rev. 568424e (Restore the ability to allocate memory for
>> recompiled functions). If a function tries to return a constant like this
>>
>> jit_value_t a = jit_value_create_nint_constant(func, jit_type_int, 2);
>> jit_insn_return(func, a);
>>
>> an empty x86 code will be produced after compile. Previous versions
>> resulted in correct code. I haven't found the exact reason yet, sorry.
>> Can you please take a look?
>>
>> Regards,
>> Alex
>>
>> _______________________________________________
>> Dotgnu-libjit mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/dotgnu-libjit


-- 
Алексей Галахов
разработчик, Екатеринбург
тел. 8710
address@hidden



reply via email to

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