#554 389 segfaults when doing modrdn with new parent that does not exist
Closed: wontfix Opened by pj101.

While trying to move an entry under a new non-existing parent, 389DS crashes.

I've tested it with 1.2.10.24 (x86_64) on EL5 (x86_64). The DS was compiled from git sources with debug options.

The entry "ou=Enseignement,ou=Groupes,dc=id,dc=polytechnique,dc=edu" was supposed to be moved to "ou=Enseignement,ou=Nowhere,dc=id,dc=polytechnique,dc=edu", the parent "ou=Nowhere,dc=id,dc=polytechnique,dc=edu" does not exist.

The ldif file for this modification:

version: 1

dn: ou=Enseignement,ou=Groupes,dc=id,dc=polytechnique,dc=edu
changetype: modrdn
newrdn: ou=Enseignement
deleteoldrdn: 0
newsuperior: ou=Nowhere,dc=id,dc=polytechnique,dc=edu


The server crashes. The result of "bt full":

0 0x00002ae9a481f2aa in id2entry_add_ext (be=0x70d1050, e=0x0, txn=0x4c971cd0, encrypt=1) at ldap/servers/slapd/back-ldbm/id2entry.c:75

    inst = 0x70d0a90
    db = 0x71e6940
    db_txn = 0x0
    data = {data = 0x0, size = 118302352, ulen = 0, dlen = 167013936, doff = 0, flags = 168785152}
    key = {data = 0x9abebb0, size = 118019904, ulen = 0, dlen = 1284971728, doff = 0, flags = 2655152859}
    len = 0
    rc = 0
    temp_id = "\000u\017\n"
    encrypted_entry = 0x0
    entrydn = 0x0

1 0x00002ae9a48536bd in modify_update_all (be=0x70d1050, pb=0x9abebb0, mc=0x4c971c40, txn=0x4c971cd0) at ldap/servers/slapd/back-ldbm/ldbm_modify.c:160

    operation = 0x9f6d060
    is_ruv = 0
    retval = 0
    function_name = 0x2ae9a4883f3f "modify_update_all"

2 0x00002ae9a4856695 in ldbm_back_modrdn (pb=0x9abebb0) at ldap/servers/slapd/back-ldbm/ldbm_modrdn.c:821

    be = 0x70d1050
    inst = 0x70d0a90
    li = 0x708d740
    e = 0xa010bf0
    ec = 0x9f32980
    ec_in_cache = 1
    txn = {back_txn_txn = 0xa25fd50}
    parent_txn = 0x0
    retval = 0
    msg = 0x2ae99e4182bb "UH\211\345SH\203\354xH\211}\270H\211u\260H\211U\250H\211M\240H\215\005\022\r\004"
    postentry = 0x0
    errbuf = 0x0
    disk_full = 0
    retry_count = 0
    ldap_result_code = 0
    ldap_result_message = 0x0
    ldap_result_matcheddn = 0x0
    parententry = 0x9f46e30
    newparententry = 0x0
    existingentry = 0x0
    parent_modify_context = {new_entry_in_cache = 0, old_entry = 0x9f46e30, new_entry = 0xa0f7500, smods = 0xa0ec700, attr_encrypt = 1}
    newparent_modify_context = {new_entry_in_cache = 0, old_entry = 0x0, new_entry = 0x0, smods = 0x0, attr_encrypt = 1}
    ruv_c = {new_entry_in_cache = 0, old_entry = 0x0, new_entry = 0x0, smods = 0x0, attr_encrypt = 0}
    ruv_c_init = 0
    is_ruv = 0
    children = 0xa0f4380
    child_entries = 0xa25a810
    child_dns = 0xa25aa90
    sdn = 0x9f6ed40
    dn_newdn = {flag = 14 '\016', udn = 0x9f6cd10 "ou=Enseignement,ou=Nowhere,dc=id,dc=polytechnique,dc=edu", dn = 0x9f429b0 "ou=Enseignement,ou=Nowhere,dc=id,dc=polytechnique,dc=edu", 
      ndn = 0x9f436b0 "ou=enseignement,ou=nowhere,dc=id,dc=polytechnique,dc=edu", ndn_len = 56}
    dn_newrdn = {flag = 0 '\000', udn = 0x0, dn = 0x9ec0ca0 "ou=Enseignement", ndn = 0x0, ndn_len = 15}
    dn_newsuperiordn = 0x9f3e310
    dn_parentdn = {flag = 6 '\006', udn = 0x0, dn = 0xa0e76c0 "ou=Groupes,dc=id,dc=polytechnique,dc=edu", ndn = 0x9ac1570 "ou=groupes,dc=id,dc=polytechnique,dc=edu", ndn_len = 40}
    rc = 0
    isroot = 0
    mods = 0x9f395b0
    smods_operation_wsi = {mods = 0x9f395b0, num_elements = 4, num_mods = 3, iterator = 3, free_mods = 0}
    smods_generated = {mods = 0x9f32ab0, num_elements = 5, num_mods = 1, iterator = 0, free_mods = 1}
    smods_generated_wsi = {mods = 0xa0ff9a0, num_elements = 5, num_mods = 0, iterator = 0, free_mods = 1}
    operation = 0x9f6d060
    dblock_acquired = 1
    is_replicated_operation = 0
    is_fixup_operation = 0
    new_addr = {udn = 0x0, uniqueid = 0x0, sdn = 0x4c971bd0}
    old_addr = 0x9f6d130
    oldparent_addr = {udn = 0x0, uniqueid = 0x0, sdn = 0x4c971b70}
    newsuperior_addr = 0x9f6d168
    ebuf = " \373\226L\000\000\000\000\001\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\260\227L\000\000\000\000;\026\247\016;\000\000\000\001\000\000\000\000\000\000\000p\377\366\t\000\000\000\000p\377\366\t\000\000\000\000\205?\236\351*\000\000 \373\226L\000\000\000\000\020o\377\t\000\000\000\000 \373\226L\000\000\000\000\061N=\236\351*\000\000\000\000\000\000\000\000\000\000p\377\366\t\000\000\000\000\320\033\227L\000\000\000\000\177t<\236\351*\000\000\020\374\226L\000\000\000\000\333jB\236\351*\000\000\000\000\000\000\000\000\000\000\060\v\370\006\000\000\000\000\240\323\367\006\000\000\000\000\260\376\366\t\000\000\000\000\220\373\226L\000\000\000\000\v\322:\236\351*\000\000\000\000\000\000\001\000\000\000`\322\367\006", '\000' <repeats 12 times>, "`\322\367\006\000\000\000\000\260\373\226L\000\000\000\000\264\321:\236\351*\000\000\000\000\000\000\000\000\000\000"...
    opcsn = 0x0

3 0x00002ae99e3f51b9 in op_shared_rename (pb=0x9abebb0, passin_args=0) at ldap/servers/slapd/modrdn.c:667

    rc = 1
    dn = 0xa010ef0 "ou=Enseignement,ou=Groupes,dc=id,dc=polytechnique,dc=edu"
    newrdn = 0x9ec0ca0 "ou=Enseignement"
    newdn = 0x9f6cdb0 "ou=Enseignement,ou=Nowhere,dc=id,dc=polytechnique,dc=edu"
    newsuperior = 0x9ff6f10 "ou=Nowhere,dc=id,dc=polytechnique,dc=edu"
    rdns = 0x9f6cd60
    deloldrdn = 0
    be = 0x70d1050
    origsdn = 0x4c979f90
    smods = {mods = 0x0, num_elements = 0, num_mods = 0, iterator = 0, free_mods = 0}
    dnbuf = '\000' <repeats 6656 times>, "\020\232\227L\000\000\000\000\320v\313\t\000\000\000\000\003", '\000' <repeats 15 times>"\240, \316\316\t", '\000' <repeats 13 times>"\233, \227L\000\000\000\000\020\231\227L\000\000\000\000S\351\367\006\000\000\000\000#\232\227L\000\000\000\000\205\352\315? \356\335\345\000\000\000\000\000\000\000\000 \231\227L\000\000\000\000\217\317:\236\351*\000\000P\351\367\006\000\000\000\000 \232\227L\000\000\000\000p\231\227L\000\000\000\000p\000\000\000\000\000\000\000H*\325\016;\000\000\000\260\231\227L\000\000\000\000P\351\367\006\000\000\000\000Q\000\000\000\000\000\000\000A\000\000\000\000\000\000\000\001", '\000' <repeats 39 times>, "\003\000\000\000\000\000\000\000B\206\247\016;\000\000\000\001\000\000\000\000\000\000\000\333jB\236\351*\000\000\360\231\227L\000\000\000\000\060\v\370\006\n\000\000\000\263\270\367\006\000\000\000\000\363"...
    newrdnbuf = '\000' <repeats 6736 times>"\220, \237\227L\000\000\000\000\220y\227L\000\000\000\000\203\071C\000\000\000\000\000\002\000\000\000\000\000\000\000\220y\227L\000\000\000\000\002\000\000\000\000\000\000\000\220\237\227L\000\000\000\000\023\266\214\236\351*\000\000\002\000\000\000\000\000\000\000\220y\227L\000\000\000\000\004\000\000\000\000\000\000\000O\210\214\236\351*", '\000' <repeats 20 times>, "\002\210\000\000\000\202\220\237\227L\000\000\000\000\203\071C\000\000\000\000\000\203\071C", '\000' <repeats 13 times>, "P\215\214\236\351*", '\000' <repeats 42 times>"\340, )\325\016;\000\000\000\000*\325\016;\000\000\000\000*\325\016;", '\000' <repeats 11 times>, "8*\325\016;", '\000' <repeats 43 times>"\340, )\325\016;\000\000\000\004\000\000\000\000\000\000\000\211\002\000\000\000\000\000\000\340)\325\016;\000\000\000"...
    newsuperiorbuf = '\000' <repeats 1000 times>"\336, \021!\021;", '\000' <repeats 19 times>"\343, D\227L", '\000' <repeats 28 times>"\200, \224E\236\351*", '\000' <repeats 18 times>, "PE\227L\000\000\000\000\177\224E\236\351*\000\000\304\024!\021;", '\000' <repeats 27 times>"\260, V\227L", '\000' <repeats 92 times>, "?\"\021;\000\000\000\006\b\000\000\000\000\000\000\360V\001\000\000\000\000\000\001\000\000\000\000\000\000\000\200\201\000\000\205\001\000\000\205\001", '\000' <repeats 14 times>, "\n\031\000\000\000\000\000\000\000\020\000\000\000\000\000\000\020\000\000\000\000\000\000\000\342!\360P", '\000' <repeats 12 times>, "y\"\360P\000\000\000\000\377\377\377\377\000\000\000\000y?\017;", '\000' <repeats 11 times>, "o\000\000\000\000\000\000\000"...
    internal_op = 0
    repl_op = 0
    lastmod = 1
    operation = 0x9f6d060
    referral = 0x0
    errorbuf = '\000' <repeats 2489 times>, "\020\000\000\000\000\000\000\300\f\001\n\000\000\000\000\337\003\000\000\000\000\000\000P+\227L\000\000\000\000w\372\245\016;\000\000\000\001\b\000\000\000\000\000\000\360\313\001\000\000\000\000\000\001\000\000\000\000\000\000\000\244\201", '\000' <repeats 22 times>, "\031\004\000\000\000\000\000\000\000\020\000\000\000\000\000\000\b\000\000\000\000\000\000\000y\"\360P", '\000' <repeats 12 times>, "/\vOK", '\000' <repeats 12 times>, "/\vOK", '\000' <repeats 28 times>, ")^\254\016;", '\000' <repeats 11 times>, "\031\004\000\000\000\000\000\000\000\240\002\254\252*\000\000\00

0\020\000\000\000\000\000\000\300\f\001\n\000\000\000\000\034\003\000\000\000\000\000\000\375\240\002\254\252*\000\000\337\003\000\000\000\000\000\000"...
err = 0
proxydn = 0x0
proxystr = 0x0
proxy_err = 0
errtext = 0x0
sdn = 0x9f6ed40
newsuperiorsdn = 0x9f3e310

4 0x00002ae99e3f444c in do_modrdn (pb=0x9abebb0) at ldap/servers/slapd/modrdn.c:268

    operation = 0x9f6d060
    ber = 0x9f6d1f0
    rawdn = 0xa010ef0 "ou=Enseignement,ou=Groupes,dc=id,dc=polytechnique,dc=edu"
    rawnewsuperior = 0xa0e3fe0 "ou=Nowhere,dc=id,dc=polytechnique,dc=edu"
    dn = 0x9f04b00 "ou=Enseignement,ou=Groupes,dc=id,dc=polytechnique,dc=edu"
    newsuperior = 0xa0e7750 "ou=Nowhere,dc=id,dc=polytechnique,dc=edu"
    rawnewrdn = 0x0
    newrdn = 0xa0f1b90 "ou=Enseignement"
    err = 0
    deloldrdn = 0
    len = 40
    newdn = 0x9f05fc0 "ou=Enseignement,ou=groupes,dc=id,dc=polytechnique,dc=edu"
    parent = 0xa0e9d40 "ou=groupes,dc=id,dc=polytechnique,dc=edu"
    sdn = {flag = 14 '\016', udn = 0xa010ef0 "ou=Enseignement,ou=Groupes,dc=id,dc=polytechnique,dc=edu", dn = 0x9f04b00 "ou=Enseignement,ou=Groupes,dc=id,dc=polytechnique,dc=edu", 
      ndn = 0x9f6cea0 "ou=enseignement,ou=groupes,dc=id,dc=polytechnique,dc=edu", ndn_len = 56}
    snewdn = {flag = 6 '\006', udn = 0x0, dn = 0x9f05fc0 "ou=Enseignement,ou=groupes,dc=id,dc=polytechnique,dc=edu", ndn = 0x9f6d7e0 "ou=enseignement,ou=groupes,dc=id,dc=polytechnique,dc=edu", 
      ndn_len = 56}
    snewsuperior = 0x9f4c4f0

5 0x0000000000413857 in connection_dispatch_operation (conn=0x2aaaaaab6810, op=0x9f6d060, pb=0x9abebb0) at ldap/servers/slapd/connection.c:586

    minssf = 0
    minssf_exclude_rootdse = 0

6 0x0000000000414fc2 in connection_threadmain () at ldap/servers/slapd/connection.c:2336

    is_timedout = 0
    curtime = 1357914754
    pb = 0x9abebb0
    interval = 10000
    conn = 0x2aaaaaab6810
    op = 0x9f6d060
    tag = 108
    need_wakeup = 0
    thread_turbo_flag = 1
    ret = 0
    more_data = 0
    replication_connection = 0
    doshutdown = 0

7 0x0000003b112287ed in ?? () from /usr/lib64/libnspr4.so

No symbol table info available.

8 0x0000003b0fa0677d in start_thread () from /lib64/libpthread.so.0

No symbol table info available.

9 0x0000003b0ead3c1d in clone () from /lib64/libc.so.6

No symbol table info available.

Andrey IVANOV


Hi Andrey,

Sorry, we fixed the same bug on 1.2.11 and newer, but not on 1.2.10... :(

https://fedorahosted.org/389/ticket/520

Ok, thank you, Noriko, the fix patch is quite simple - i'll just backport it ;)

Metadata Update from @pj101:
- Issue assigned to rmeggins
- Issue set to the milestone: N/A

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/554

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

Metadata