Hi,

In addition to what Breno added, When tried to debug seeing a Segmentation 
fault with the following scenarios.

Testing random mt-hot search: 100 threads 5 conns (5 x 100) loops...
./progs/slapd-mtread -H ldap://localhost:9011/ -D 
cn=Manager,dc=example,dc=com -w secret -e dc=example,dc=com -f 
(objectclass=*) -c 5 -m 100 -L 5 -l 100


Testing random mt-hot search: 5 threads (1 x 10000) loops...
./progs/slapd-mtread -H ldap://localhost:9011/ -D 
cn=Manager,dc=example,dc=com -w secret -e dc=example,dc=com -f 
(objectclass=*) -m 5 -L 1 -l 10000

It's been observed that there are 
NO array index out of bounds
NO issue with the data in the array
worked fine with filter "(objectclass=*)" and single thread.

Segmentation fault occurs when filter is "(objectclass=*)" and multi 
threaded (m=5 or 100).

>From gdb 

Core was generated by 
`/root/openldap-2.4.44+dfsg/debian/build/tests/progs/.libs/slapd-mtread'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strlen_power8 () at ../sysdeps/powerpc/powerpc64/power8/strlen.S:43
43      ../sysdeps/powerpc/powerpc64/power8/strlen.S: No such file or 
directory.
[Current thread is 1 (Thread 0x3ffea4fff1a0 (LWP 14114))]
(gdb) bt
#0  __strlen_power8 () at ../sysdeps/powerpc/powerpc64/power8/strlen.S:43
#1  0x00003fff9ada9110 in _IO_vfprintf_internal (s=0x3ffea4ff22a0, 
format=0x486671b8 "Read(%d): entry=\"%s\".\n", ap=0x3ffea4ff2488 "R") at 
vfprintf.c:1637
#2  0x00003fff9ae764b4 in ___vsnprintf_chk (s=0x3ffea4ff24c8 "Read(1): 
entry=\"0 cnt: 1 (retried 0) (\220\070)", maxlen=<optimized out>, 
flags=<optimized out>,
    slen=<optimized out>, format=0x486671b8 "Read(%d): entry=\"%s\".\n", 
args=0x3ffea4ff2478 "\001") at vsnprintf_chk.c:63
#3  0x00003fff9ae763b8 in ___snprintf_chk (s=<optimized out>, 
maxlen=<optimized out>, flags=<optimized out>, slen=<optimized out>, 
format=<optimized out>)
    at snprintf_chk.c:34
#4  0x0000000048663eb0 in snprintf (__fmt=0x486671b8 "Read(%d): 
entry=\"%s\".\n", __n=8192, __s=0x3ffea4ff24c8 "Read(1): entry=\"0 cnt: 1 
(retried 0) (\220\070)")
    at /usr/include/powerpc64le-linux-gnu/bits/stdio2.h:64
#5  do_read (ld=0x3ffea8001a30, entry=0x20 <error: Cannot access memory at 
address 0x20>, attrs=0x48680058 <srchattrs>, noattrs=<optimized out>,
    maxloop=<optimized out>, maxretries=<optimized out>, force=<optimized 
out>, idx=<optimized out>, chaserefs=<optimized out>, delay=<optimized 
out>,
    nobind=<optimized out>) at ../../../../tests/progs/slapd-mtread.c:791
#6  0x00000000486648b0 in do_random (nobind=<optimized out>, 
delay=<optimized out>, chaserefs=<optimized out>, idx=<optimized out>, 
force=0, maxretries=0,
    innerloop=100, noattrs=0, srchattrs=0x48680058 <srchattrs>, 
filter=<optimized out>, sbase=0x1002c2d0260 "dc=example,dc=com", 
ld=0x3ffea8001a30)
    at ../../../../tests/progs/slapd-mtread.c:684
#7  do_onethread (arg=<optimized out>) at 
../../../../tests/progs/slapd-mtread.c:445
#8  0x00003fff9af180dc in start_thread (arg=0x3ffea4fff1a0) at 
pthread_create.c:335
#9  0x00003fff9ae61508 in clone () at 
../sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S:85
(gdb) i r
r0             0x0      0
r1             0x3ffea4ff1c70   70362922425456
r2             0x3fff9af07300   70367048659712
r3             0x20     32
r4             0x20     32
r5             0xffffffffffffffff       18446744073709551615
r6             0x0      0
r7             0x0      0
r8             0xffffffffffffffff       18446744073709551615
r9             0x20     32
r10            0x0      0
r11            0x0      0
r12            0x3fff9adfbc40   70367047564352
r13            0x3ffea5006900   70362922510592
r14            0x0      0
r15            0x3ffea4ff20d8   70362922426584
r16            0x0      0
r17            0x3fff9ada8758   70367047223128
r18            0x0      0
r19            0x73     115
r20            0x7fffffff       2147483647
r21            0x0      0
r22            0x1      1
r23            0x486671bd       1214673341
r24            0x3fff9aefc348   70367048614728
r25            0x3ffea4ff2488   70362922427528
r26            0xbd0    3024
r27            0x0      0
r28            0x486671b8       1214673336
r29            0x10     16
r30            0x3ffea4ff22a0   70362922427040
r31            0x3ffea4ff1c70   70362922425456
pc             0x3fff9adfbc5c   0x3fff9adfbc5c <__strlen_power8+28>
msr            0x800000010280f033       9223372041191747635
cr             0x44004422       1140868130
lr             0x3fff9ada9110   0x3fff9ada9110 
<_IO_vfprintf_internal+7936>
ctr            0x3fff9adfbc40   70367047564352
xer            0x20000000       536870912
orig_r3        0x3fff9af1b900   70367048743168
trap           0x300    768


>From dmesg:
slapd-mtread[13678]: unhandled signal 11 at 3d63642c656c7068 nip 
00003fff7cb6bc5c lr 00003fff7cb19110 code 30003
(or)
slapd-mtread[14114]: unhandled signal 11 at 0000000000000020 nip 
00003fff9adfbc5c lr 00003fff9ada9110 code 30001

Reply via email to