------- You are receiving this mail because: -------
You are on the CC list for the bug.
http://bugs.exim.org/show_bug.cgi?id=1430
--- Comment #15 from Tony Reix <tony.reix@???> 2014-01-16 09:48:33 ---
Hi Zoltan
Within 8.34 version, I've commented:
#define SLJIT_INDIRECT_CALL 1
in file:
~/PCRE/pcre-8.34/sljit$ vi sljitConfigInternal.h
Result now is:
re> /ab+c/
data> abbc
Program received signal SIGSEGV, Segmentation fault.
0x00000000101db8bc in ?? ()
tony@tony1:~/PCRE/pcre-8.34$ ./pcre_jit_test
Running JIT regression tests
target CPU of SLJIT compiler: PowerPC 64bit (big endian + unaligned)
in 8 bit mode with UTF-8 enabled and ucp enabled:
in 16 bit mode with UTF-16 enabled and ucp enabled:
in 32 bit mode with UTF-32 enabled and ucp enabled:
Illegal instruction (core dumped)
(gdb) s
9541 return convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x10092658 <jit_machine_stack_exec+176>: addi r9,r31,-32672
(gdb) si
0x000000001009265c 9541 return
convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x1009265c <jit_machine_stack_exec+180>: ld r9,32720(r9)
(gdb) si
0x0000000010092660 9541 return
convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x10092660 <jit_machine_stack_exec+184>: addi r10,r31,-32672
(gdb) si
0x0000000010092664 9541 return
convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x10092664 <jit_machine_stack_exec+188>: ld r3,32712(r10)
(gdb) si
0x0000000010092668 9541 return
convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x10092668 <jit_machine_stack_exec+192>: std r2,24(r1)
(gdb) si
0x000000001009266c 9541 return
convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x1009266c <jit_machine_stack_exec+196>: mr r12,r9
(gdb) si
0x0000000010092670 9541 return
convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x10092670 <jit_machine_stack_exec+200>: mtctr r12
(gdb) si
0x0000000010092674 9541 return
convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x10092674 <jit_machine_stack_exec+204>: bctrl
(gdb) si
0x00003fffb7dcf010 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf010: mflr r0
(gdb) x/20x 0x3fffb7dcf010
0x3fffb7dcf010: 0x7c0802a6 0xfbe1fff8 0xfbc1fff0 0xfba1ffe8
0x3fffb7dcf020: 0xfb81ffe0 0xfb61ffd8 0xfb41ffd0 0xf8010008
0x3fffb7dcf030: 0x3be00000 0x7c7e1b78 0xf821ff71 0xe91e0010
0x3fffb7dcf040: 0x3868ffff 0xf86100a8 0xf8610098 0x7fdbf378
0x3fffb7dcf050: 0x7fc3f378 0xebc30008 0xeba30018 0xe8a30000
(gdb) x/20x 0x000000001009265c
0x1009265c <jit_machine_stack_exec+180>: 0xe9297fd0 0x395f8060
0xe86a7fc8 0xf8410018
0x1009266c <jit_machine_stack_exec+196>: 0x7d2c4b78 0x7d8903a6
0x4e800421 0xe8410018
0x1009267c <jit_machine_stack_exec+212>: 0x7c691b78 0x7d234b78
0x3d3f0001 0xe9498058
0x1009268c <jit_machine_stack_exec+228>: 0xe92d8ff0 0x7faa4840
0x39400000 0x39200000
0x1009269c <jit_machine_stack_exec+244>: 0x419e000c 0x4bf6ea41
0xe8410018 0xe8210000
0x0000000010092650 <+168>: addi r9,r31,-32672
0x0000000010092654 <+172>: std r10,32720(r9)
0x0000000010092658 <+176>: addi r9,r31,-32672
0x000000001009265c <+180>: ld r9,32720(r9)
0x0000000010092660 <+184>: addi r10,r31,-32672
0x0000000010092664 <+188>: ld r3,32712(r10)
0x0000000010092668 <+192>: std r2,24(r1)
0x000000001009266c <+196>: mr r12,r9
0x0000000010092670 <+200>: mtctr r12
0x0000000010092674 <+204>: bctrl
Now, the program crashes far from these assembler code.
re> /ab+c/
data> abbc
Breakpoint 1, jit_machine_stack_exec (arguments=0x3fffffffced0,
executable_func=0x3fffb7dcf010) at pcre_jit_compile.c:9527
9527 {
1: x/i $pc
=> 0x100925dc <jit_machine_stack_exec+52>: addis r9,r31,1
(gdb) s 6
9540 convert_executable_func.executable_func = executable_func;
1: x/i $pc
=> 0x10092648 <jit_machine_stack_exec+160>: addi r9,r31,-32672
(gdb) s
9541 return convert_executable_func.call_executable_func(arguments);
1: x/i $pc
=> 0x10092658 <jit_machine_stack_exec+176>: addi r9,r31,-32672
(gdb) si 120
0x00003fffb7dcf18c in ?? ()
1: x/i $pc
=> 0x3fffb7dcf18c: mr r3,r27
(gdb) si
0x00003fffb7dcf190 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf190: lwa r4,72(r3)
(gdb) si
0x00003fffb7dcf194 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf194: ld r8,32(r3)
(gdb) si
0x00003fffb7dcf198 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf198: addi r5,r8,-4
(gdb) si
0x00003fffb7dcf19c in ?? ()
1: x/i $pc
=> 0x3fffb7dcf19c: ld r3,16(r3)
(gdb) si
0x00003fffb7dcf1a0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1a0: addi r30,r1,160
(gdb) si
0x00003fffb7dcf1a4 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1a4: cmpd r4,r31
(gdb) si
0x00003fffb7dcf1a8 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1a8: beq 0x3fffb7dcf1c8
(gdb) si
0x00003fffb7dcf1ac in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1ac: ld r8,0(r30)
(gdb) si
0x00003fffb7dcf1b0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1b0: subf r29,r3,r8
(gdb) si
0x00003fffb7dcf1b4 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1b4: addi r30,r30,8
(gdb) si
0x00003fffb7dcf1b8 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1b8: stwu r29,4(r5)
(gdb) si
0x00003fffb7dcf1bc in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1bc: li r9,1
(gdb) si
0x00003fffb7dcf1c0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1c0: subfco. r4,r9,r4
(gdb) si
0x00003fffb7dcf1c4 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1c4: bne 0x3fffb7dcf1ac
(gdb) si
0x00003fffb7dcf1ac in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1ac: ld r8,0(r30)
(gdb) si
0x00003fffb7dcf1b0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1b0: subf r29,r3,r8
(gdb) si
0x00003fffb7dcf1b4 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1b4: addi r30,r30,8
(gdb) si
0x00003fffb7dcf1b8 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1b8: stwu r29,4(r5)
(gdb) si
0x00003fffb7dcf1bc in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1bc: li r9,1
(gdb) si
0x00003fffb7dcf1c0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1c0: subfco. r4,r9,r4
(gdb) si
0x00003fffb7dcf1c4 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1c4: bne 0x3fffb7dcf1ac
(gdb) si
0x00003fffb7dcf1c8 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1c8: li r3,1
(gdb) si
0x00003fffb7dcf1cc in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1cc: addi r1,r1,144
(gdb) si
0x00003fffb7dcf1d0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1d0: ld r0,8(r1)
(gdb) si
0x00003fffb7dcf1d4 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1d4: ld r26,-48(r1)
(gdb) si
0x00003fffb7dcf1d8 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1d8: ld r27,-40(r1)
(gdb) si
0x00003fffb7dcf1dc in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1dc: ld r28,-32(r1)
(gdb) si
0x00003fffb7dcf1e0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1e0: ld r29,-24(r1)
(gdb) si
0x00003fffb7dcf1e4 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1e4: ld r30,-16(r1)
(gdb) si
0x00003fffb7dcf1e8 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1e8: ld r31,-8(r1)
(gdb) si
0x00003fffb7dcf1ec in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1ec: mtlr r0
(gdb) si
0x00003fffb7dcf1f0 in ?? ()
1: x/i $pc
=> 0x3fffb7dcf1f0: blr
(gdb) si
0x00000000101db8bc in ?? ()
1: x/i $pc
=> 0x101db8bc: ori r2,r27,25185
(gdb) si
Program received signal SIGSEGV, Segmentation fault.
0x00000000101db8bc in ?? ()
1: x/i $pc
=> 0x101db8bc: ori r2,r27,25185
(gdb) info registers
r0 0x101db8bf 270383295
r1 0x3fffffff4df0 70368744132080
r2 0x101c2970 270281072
r3 0x1 1
r4 0x0 0
r5 0x101d36d4 270350036
r6 0x0 0
r7 0x101db8bf 270383295
r8 0x101db8c0 270383296
r9 0x1 1
r10 0x3ffffffece50 70368744099408
r11 0x101d38c0 270350528
r12 0x3fffb7dcf010 70367533920272
r13 0x3fffb7ff9730 70367536191280
r14 0x0 0
r15 0x0 0
r16 0x0 0
r17 0x0 0
r18 0x0 0
r19 0x0 0
r20 0x0 0
r21 0x0 0
r22 0x0 0
r23 0x0 0
r24 0x0 0
r25 0x0 0
r26 0x0 0
r27 0x3fffb7ffde10 70367536209424
r28 0x3fffb7ffe150 70367536210256
r29 0x3fffb7ffd940 70367536208192
r30 0x0 0
r31 0x3fffffff4df0 70368744132080
pc 0x101db8bc 0x101db8bc
msr 0x800000001000d433 9223372037123265587
cr 0x22000482 570426498
lr 0x101db8bf 0x101db8bf
ctr 0x3fffb7dcf010 70367533920272
xer 0x20000000 536870912
orig_r3 0xc00000000000a558 -4611686018427345576
trap 0x400 1024
===================================== 8.31 ==========================
Within 8.31 version, it does not compile:
tony@tony1:~/PCRE/pcre3-8.31/sljit$ diff sljitConfigInternal.h
sljitConfigInternal.h.ORIGIN
341c341
< //#define SLJIT_INDIRECT_CALL 1
---
> #define SLJIT_INDIRECT_CALL 1
$ export CFLAGS="-O0 -g -Wall" ; export LDFLAGS="-g" ; ./configure
--enable-shared=no --enable-pcre16 --enable-unicode-properties --enable-jit
........
pcre-8.31 configuration summary:
Install prefix .................. : /usr/local
C preprocessor .................. : gcc -E
C compiler ...................... : gcc
C++ preprocessor ................ : g++ -E
C++ compiler .................... : g++
Linker .......................... : /usr/bin/ld
C preprocessor flags ............ :
C compiler flags ................ : -O0 -g -Wall
C++ compiler flags .............. : -O2
Linker flags .................... : -g
Extra libraries ................. :
Build 8 bit pcre library ........ : yes
Build 16 bit pcre library ....... : yes
Build C++ library ............... : yes
Enable JIT compiling support .... : yes
Enable UTF-8/16 support ......... : yes
Unicode properties .............. : yes
Newline char/sequence ........... : lf
\R matches only ANYCRLF ......... : no
EBCDIC coding ................... : no
Rebuild char tables ............. : no
Use stack recursion ............. : yes
POSIX mem threshold ............. : 10
Internal link size .............. : 2
Match limit ..................... : 10000000
Match limit recursion ........... : MATCH_LIMIT
Build shared libs ............... : no
Build static libs ............... : yes
Use JIT in pcregrep ............. : yes
Buffer size for pcregrep ........ : 20480
Link pcregrep with libz ......... : no
Link pcregrep with libbz2 ....... : no
Link pcretest with libedit ...... : no
Link pcretest with libreadline .. : no
$ make
.......
CC pcre_jit_compile.lo
In file included from sljit/sljitLir.c:1251:0,
from pcre_jit_compile.c:62:
sljit/sljitNativePPC_common.c: In function 'sljit_generate_code':
sljit/sljitNativePPC_common.c:241:53: error: invalid application of 'sizeof' to
incomplete type 'struct sljit_function_context'
compiler->size += (compiler->size & 0x1) + (sizeof(struct
sljit_function_context) / sizeof(sljit_ins));
^
sljit/sljitNativePPC_common.c:364:2: warning: implicit declaration of function
'sljit_set_function_context' [-Wimplicit-function-declaration]
sljit_set_function_context(NULL, (struct sljit_function_context*)code_ptr,
(sljit_w)code, sljit_generate_code);
^
In file included from sljit/sljitNativePPC_common.c:417:0,
from sljit/sljitLir.c:1251,
from pcre_jit_compile.c:62:
sljit/sljitNativePPC_64.c: At top level:
sljit/sljitNativePPC_64.c:419:82: warning: 'struct sljit_function_context'
declared inside parameter list [enabled by default]
SLJIT_API_FUNC_ATTRIBUTE void sljit_set_function_context(void** func_ptr,
struct sljit_function_context* context, sljit_w addr, void* func)
^
sljit/sljitNativePPC_64.c:419:82: warning: its scope is only this definition or
declaration, which is probably not what you want [enabled by default]
sljit/sljitNativePPC_64.c:419:31: warning: conflicting types for
'sljit_set_function_context' [enabled by default]
SLJIT_API_FUNC_ATTRIBUTE void sljit_set_function_context(void** func_ptr,
struct sljit_function_context* context, sljit_w addr, void* func)
^
sljit/sljitNativePPC_64.c:419:31: error: static declaration of
'sljit_set_function_context' follows non-static declaration
In file included from sljit/sljitLir.c:1251:0,
from pcre_jit_compile.c:62:
sljit/sljitNativePPC_common.c:364:2: note: previous implicit declaration of
'sljit_set_function_context' was here
sljit_set_function_context(NULL, (struct sljit_function_context*)code_ptr,
(sljit_w)code, sljit_generate_code);
^
In file included from sljit/sljitNativePPC_common.c:417:0,
from sljit/sljitLir.c:1251,
from pcre_jit_compile.c:62:
sljit/sljitNativePPC_64.c: In function 'sljit_set_function_context':
sljit/sljitNativePPC_64.c:425:9: error: dereferencing pointer to incomplete
type
context->addr = addr ? addr : ptrs[0];
^
sljit/sljitNativePPC_64.c:426:9: error: dereferencing pointer to incomplete
type
context->r2 = ptrs[1];
^
sljit/sljitNativePPC_64.c:427:9: error: dereferencing pointer to incomplete
type
context->r11 = ptrs[2];
^
make[1]: *** [pcre_jit_compile.lo] Error 1
make[1]: Leaving directory `/home/tony/PCRE/pcre3-8.31'
make: *** [all] Error 2
--
Configure bugmail:
http://bugs.exim.org/userprefs.cgi?tab=email