Re: [pcre-dev] Win32 JIT Access Violation - bisect results

Αρχική Σελίδα
Delete this message
Συντάκτης: Ralf Junker
Ημερομηνία:  
Προς: pcre-dev@exim.org
Παλιά Θέματα: Re: [pcre-dev] Win32 JIT Access Violation
Αντικείμενο: Re: [pcre-dev] Win32 JIT Access Violation - bisect results
Here is the result of the bisect:

SVN 1137 fail
SVN 1136 compiler error, fixed in 1137
SVN 1135 pass

config.h changes required, as outlined in my previous message:

#define SUPPORT_JIT 1
#define NEWLINE_DEFAULT 3

Command line:

pcre2test.exe -jit -q -8 test.txt

At SVN 1137, the AV triggers in sljitExecAllocator.c line 348:

     while (free_block) {
         next_free_block = free_block->next;
         if (!free_block->header.prev_size && /* <-- AV here! */
                 AS_BLOCK_HEADER(free_block, free_block->size)->size == 1) {
             total_size -= free_block->size;
             sljit_remove_free_block(free_block);
             free_chunk(free_block, free_block->size + sizeof(struct
block_header));
         }
         free_block = next_free_block;
     }


Call Stack:

:00423078 sljit_free_unused_memory_exec()
:0044E565 pcre2_jit_free_unused_memory_8(gcontext=:01F54730)
:00473EF3 main(argc=2, argv=:01F8A680)
:004812e7 ; __startup

I realize this is not the same AV as originally reported, but I think it
is related. It feels like uninitialized memory access or buffer overrun.

I hope you can make use of this information. Feel free to ask fore more.

Many thanks,

Ralf

PS: Please release whenever you and Philip feel is the right time.

On 19.11.2019 08:48, Zoltán Herczeg wrote:

> I suspect something is wrong with code generation. Maybe the total size
> of the buffer is incorrect. The four bytes after addr=:001DFFFE affects
> two pages, and I suspect something is wrong with the page starting from
> 001E0000 (not allocated or not writable).
>
> Anyway I suspect Philip wants to release PCRE2 as soon as possible, so
> if you don't mind we could track this down after the release.

# This set of tests is not Perl-compatible. It checks on special features
# of PCRE2's API, error diagnostics, and the compiled code of some patterns.
# It also checks the non-Perl syntax that PCRE2 supports (Python, .NET,
# Oniguruma). There are also some tests where PCRE2 and Perl differ,
# either because PCRE2 can't be compatible, or there is a possible Perl
# bug.

# NOTE: This is a non-UTF set of tests. When UTF support is needed, use
# test 5.

#forbid_utf
#newline_default lf any anycrlf

/{'{01{2{{3{{456{{7{'{89{A{BC{D/auto_callout