Code Monkey home page Code Monkey logo

Comments (11)

arr2036 avatar arr2036 commented on August 15, 2024
gdb --args <call to ldapperf>
bt

from ldapperf.

cwaldbieser avatar cwaldbieser commented on August 15, 2024

I have the back trace for you. I replaced any sensitive info with $NAME, but otherwise left it intact.

[waldbiec@odin ldapperf]$ gdb --args ./ldapperf -d -b $BASE_DN -s sub -S -H $LDAP_URL -D $BIND_DN -w $PASSWORD -f '(cn=pumpkin)' -t 1 -l 10
GNU gdb (GDB) Fedora (7.3.50.20110722-16.fc16)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/waldbiec/projects/git-survey/ldapperf/ldapperf...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/waldbiec/projects/git-survey/ldapperf/ldapperf -d -b $BASE_DN -s sub -S -H $LDAP_URL -D $BIND_DN -w $PASSWORD -f \(cn=pumpkin\) -t 1 -l 10
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Performing 10 search(es) total, with 1 threads, with persistent connections
[New Thread 0x7ffff773c700 (LWP 29365)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff773c700 (LWP 29365)]
0x0000000000402044 in lp_query_perform ()
(gdb) bt
#0  0x0000000000402044 in lp_query_perform ()
#1  0x00000000004021fc in enter_thread ()
#2  0x000000376b807d90 in start_thread (arg=0x7ffff773c700) at pthread_create.c:309
#3  0x000000376b0f119d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
(gdb) 

from ldapperf.

arr2036 avatar arr2036 commented on August 15, 2024

Edit Makefile to pass -g3 to cc, no debugging symbols so bt doesn't show mutch

from ldapperf.

quanah avatar quanah commented on August 15, 2024

Here is the backtrace with -g -O0

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef7fe700 (LWP 8060)]
0x00000000004022e9 in lp_query_perform (thread=0x6061d0, ld=0x7fffe00008c0, subst=0x0) at ldapperf.c:439
439     ldapperf.c: No such file or directory.
(gdb) bt full
#0  0x00000000004022e9 in lp_query_perform (thread=0x6061d0, ld=0x7fffe00008c0, subst=0x0) at ldapperf.c:439
        ber = 0x7fffe000a0c0
        i = 6
        rc = 0
        entry_count = 1
        attribute = 0x7fffe0008e50 "objectClass"
        dn = 0x7fffe000a070 ""
        values = 0x7fffe0008e90
        search_result = 0x7fffe0009e40
        entry = 0x7fffe0009e40
        filter_p = 0x7fffffffe782 "(uid=user.1334)"
        base_dn_p = 0x7fffffffe74e "ou=people,dc=zre-ldap001,dc=eng,dc=zimbra,dc=com"
        __PRETTY_FUNCTION__ = "lp_query_perform"
#1  0x000000000040249f in enter_thread (arg=0x6061d0) at ldapperf.c:480
        subst = 0x0
        i = 0
        ld = 0x7fffe00008c0
        thread = 0x6061d0
        elapsed = {tv_sec = 0, tv_usec = 0}
#2  0x00007ffff7961182 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
No symbol table info available.
#3  0x00007ffff747cfbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

from ldapperf.

quanah avatar quanah commented on August 15, 2024

Looks to be this for loop:

 for (i = 0; values[i]->bv_val != NULL; i++) {
    TDEBUG("\t%s: %.*s", attribute, (int)values[i]->bv_len,
                    values[i]->bv_val);
 }

from ldapperf.

quanah avatar quanah commented on August 15, 2024

Hm, this code doesn't seem to account for there being multiple values for the attribute.

See the related code in libldap/test.c

from ldapperf.

arr2036 avatar arr2036 commented on August 15, 2024

yes, looks like there's not a NULL terminating element, whereas there was in ldap_get_values, easy to fix.

from ldapperf.

quanah avatar quanah commented on August 15, 2024

http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=libraries/libldap/test.c;h=bf092caf04cd49bbc663666033e523cde61fceb9;hb=HEAD around line 775

from ldapperf.

arr2036 avatar arr2036 commented on August 15, 2024

ah berval pointer is NULL, not field :(

from ldapperf.

quanah avatar quanah commented on August 15, 2024

I can confirm the fix solved the issue for me:

build@zre-ubuntu14-64:~$ ./ldapperf -H ldap://zre-ldap001.eng.zimbra.com:389/ -D cn=config -w zimbra -s one -b ou=people,dc=zre-ldap001,dc=eng,dc=zimbra,dc=com -f "(uid=user.1334)" -l 5000 -t 70 -S -d
Performing 350000 search(es) total, with 70 threads, with persistent connections
Statistics:
Total time (seconds) : 21.372230
Successful searches : 350000
Successful searches/s : 16376.391233
Search failures : 0
Session init errors : 0
Bind failures : 0

from ldapperf.

arr2036 avatar arr2036 commented on August 15, 2024

Great, thanks for confirming!

from ldapperf.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.