#50057 Uninitialized auto variable in hashtable_new scope
Closed: fixed 2 years ago Opened 2 years ago by slev.

Freeipa 4.3.3 server installation fails on x86 machine with:

dirsrv@IPATEST-TEST.service: Main process exited, code=killed, status=11/SEGV
dirsrv@IPATEST-TEST.service: Failed with result 'signal'.

Stack trace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xaa110b40 (LWP 10580)]
0xb76be8cf in PL_HashTableLookupConst (ht=0x0, key=0x91ae6c0) at plhash.c:349
349         keyHash = (*ht->keyHash)(key);
(gdb) bt
#0  0xffffffff in PL_HashTableLookupConst (ht=0x0, key=0x91ae6c0) at plhash.c:349
#1  0xffffffff in ancestors_cache_lookup (ndn=0x91ae6c0 "cn=sudo,cn=hbacservices,cn=hbac,dc=ipatest,dc=test", config=0xaa10f9b8) at ldap/servers/plugins/memberof/memberof.c:3034
#2  0xffffffff in memberof_call_foreach_dn (sdn=sdn@entry=0x9015c60, config=config@entry=0xaa10f9b8, types=0x91aabe0, callback=0xb5001db0 <memberof_get_groups_callback>, callback_data=0xaa10f7c8, cached=0xaa10f7b0, use_grp_cache=1, pb=0x0)
    at ldap/servers/plugins/memberof/memberof.c:735
#3  0xffffffff in memberof_get_groups_r (config=config@entry=0xaa10f9b8, member_sdn=member_sdn@entry=0x9015c60, data=data@entry=0xaa10f848) at ldap/servers/plugins/memberof/memberof.c:2240
#4  0xffffffff in memberof_get_groups (member_sdn=0x9015c60, config=0xaa10f9b8)
    at ldap/servers/plugins/memberof/memberof.c:2031
#5  0xffffffff in memberof_fix_memberof_callback (e=0x9015c60, callback_data=0xaa10f9b8)
    at ldap/servers/plugins/memberof/memberof.c:3144
#6  0xffffffff in memberof_modop_one_replace_r (pb=pb@entry=0x8bdf120, config=config@entry=0xaa10f9b8, mod_op=0, group_sdn=0x918ad40, op_this_sdn=0x918ad40, replace_with_sdn=0x0, op_to_sdn=0x918dc20, stack=0x0) at ldap/servers/plugins/memberof/memberof.c:1698
#7  0xffffffff in memberof_modop_one_r (stack=<optimized out>, op_to_sdn=<optimized out>, op_this_sdn=<optimized out>, group_sdn=<optimized out>, mod_op=<optimized out>, config=<optimized out>, pb=<optimized out>) at ldap/servers/plugins/memberof/memberof.c:1461
#8  0xffffffff in memberof_mod_attr_list_r (pb=pb@entry=0x8bdf120, config=config@entry=0xaa10f9b8, mod=mod@entry=0, group_sdn=0x918ad40, op_this_sdn=0x918ad40, attr=0x919b680, stack=0x0)
    at ldap/servers/plugins/memberof/memberof.c:1919
#9  0xffffffff in memberof_mod_attr_list (attr=<optimized out>, group_sdn=0x918ad40, mod=0, config=0xaa10f9b8, pb=0x8bdf120) at ldap/servers/plugins/memberof/memberof.c:1867
#10 0xffffffff in memberof_add_attr_list (attr=<optimized out>, group_sdn=0x918ad40, config=0xaa10f9b8, pb=0x8bdf120) at ldap/servers/plugins/memberof/memberof.c:1945
#11 0xffffffff in memberof_postop_add (pb=0x8bdf120)
    at ldap/servers/plugins/memberof/memberof.c:1322
#12 0xffffffff in plugin_call_func (list=0x8b501a0, operation=operation@entry=560, pb=pb@entry=0x8bdf120, call_one=0) at ldap/servers/slapd/plugin.c:2028
#13 0xffffffff in plugin_call_list (pb=0x8bdf120, operation=560, list=<optimized out>)
    at ldap/servers/slapd/plugin.c:1972
#14 0xffffffff in plugin_call_plugins (pb=0x8bdf120, whichfunction=560)
    at ldap/servers/slapd/plugin.c:442
#15 0xffffffff in ldbm_back_add (pb=0x8bdf120) at ldap/servers/slapd/back-ldbm/ldbm_add.c:1197
#16 0xffffffff in op_shared_add (pb=pb@entry=0x8bdf120) at ldap/servers/slapd/add.c:679
#17 0xffffffff in do_add (pb=0x8bdf120) at ldap/servers/slapd/add.c:236
#18 0x0805d826 in connection_dispatch_operation (pb=0x8bdf120, op=0x8bea500, conn=<optimized out>) at ldap/servers/slapd/connection.c:610
#19 0x0805d826 in connection_threadmain () at ldap/servers/slapd/connection.c:1785
#20 0xffffffff in _pt_root (arg=0x905e6c0) at ptthread.c:201
#21 0xffffffff in start_thread (arg=0xaa110b40) at pthread_create.c:333

After some debugging "usetxn" variable in "hashtable_new" during IPA installation:

ERR - hashtable_new - usetxn: -1216540037
ERR - hashtable_new - usetxn: -1216540037
ERR - hashtable_new - usetxn: -1266642944
ERR - hashtable_new - usetxn: -1266642944
ERR - hashtable_new - usetxn: -1266642944
ERR - hashtable_new - usetxn: -1266642944
ERR - hashtable_new - usetxn: -1266642944
ERR - hashtable_new - usetxn: -1266642944
ERR - hashtable_new - usetxn: 0
ERR - hashtable_new - usetxn: 0

Expected value: 1.
Same debugging info for x86_64:

ERR - hashtable_new - usetxn: 1611601280
ERR - hashtable_new - usetxn: 32874496
ERR - hashtable_new - usetxn: 1603208576
ERR - hashtable_new - usetxn: 32841728
ERR - hashtable_new - usetxn: 1594815872
ERR - hashtable_new - usetxn: 23035904
ERR - hashtable_new - usetxn: 1586423168
ERR - hashtable_new - usetxn: 22552576
ERR - hashtable_new - usetxn: 1527673424
ERR - hashtable_new - usetxn: 35782656
ERR - hashtable_new - usetxn: 1544458832
ERR - hashtable_new - usetxn: 35913728

FreeIPA server installation passed.

"usetxn" acts as uninitialized auto variable, but it have to be a parameter.

I know that 389-ds dropped support for 32bit arch,
but the same code present in 1.4.x branch and may fire someday.

Metadata Update from @mreynolds:
- Issue assigned to mreynolds

2 years ago

Thanks for the PR Slev!


f2ff28e..b646e4d master -> master

commit 851fcf8 -> 389-ds-base-1.3.9

f13039b..87aed55 389-ds-base-1.3.8 -> 389-ds-base-1.3.8

7e83f2a..1b193a1 389-ds-base-1.3.7 -> 389-ds-base-1.3.7

Metadata Update from @mreynolds:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None
- Issue status updated to: Open (was: Closed)

2 years ago

Metadata Update from @mreynolds:
- Issue set to the milestone: 1.3.8

2 years ago

Metadata Update from @mreynolds:
- Issue close_status updated to: fixed
- Issue set to the milestone: None (was: 1.3.8)
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.