Bug 13575 - make test fails on ldb 1.3.4 due to missing NULL terminator in tests
make test fails on ldb 1.3.4 due to missing NULL terminator in tests
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB
4.8.4
All All
: P5 major
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-15 20:32 UTC by David Mulder
Modified: 2018-08-24 09:58 UTC (History)
2 users (show)

See Also:


Attachments
proposed patch for ldb 1.3 (Samba 4.8) (25.02 KB, patch)
2018-08-15 21:46 UTC, Andrew Bartlett
dbagnall: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Mulder 2018-08-15 20:32:32 UTC
The failure is the same in 1.3.5. It doesn't happen on every platform or every distro version (works in openSUSE tw, but fails in leap 15). Package versions all seem to be the same, so I haven't found what is different.

[ RUN      ] test_ldb_add_unique_value_to_unique_index
Could not run the test - check test fixtures
[  ERROR   ] test_ldb_add_unique_value_to_unique_index
[ RUN      ] test_ldb_add_duplicate_value_to_unique_index
Could not run the test - check test fixtures
[  ERROR   ] test_ldb_add_duplicate_value_to_unique_index
[ RUN      ] test_ldb_add_to_index_duplicates_allowed
Could not run the test - check test fixtures
[  ERROR   ] test_ldb_add_to_index_duplicates_allowed
[ RUN      ] test_ldb_add_to_index_unique_values_required
Could not run the test - check test fixtures
[  ERROR   ] test_ldb_add_to_index_unique_values_required
[ RUN      ] test_ldb_unique_index_duplicate_logging
Could not run the test - check test fixtures
[  ERROR   ] test_ldb_unique_index_duplicate_logging
[ RUN      ] test_ldb_duplicate_dn_logging
Could not run the test - check test fixtures
[  ERROR   ] test_ldb_duplicate_dn_logging
[ RUN      ] test_ldb_guid_index_duplicate_dn_logging
[       OK ] test_ldb_guid_index_duplicate_dn_logging
[ RUN      ] test_ldb_unique_index_duplicate_with_guid
[       OK ] test_ldb_unique_index_duplicate_with_guid
[==========] 52 test(s) run.
[  PASSED  ] 46 test(s).
Makefile:15: recipe for target 'test' failed

This failure was introduced by the patch "ldb: Add tests for when we should expect a full scan" for bug 13448. The logic change with disable_full_db_scan introduces the failure (not the added tests).
Comment 1 David Mulder 2018-08-15 20:33:12 UTC
Blocks 4.8.4 security release.
Comment 2 Andrew Bartlett 2018-08-15 20:40:46 UTC
Can you please investigate with gdb on a failing platform?
Comment 3 David Mulder 2018-08-15 20:46:49 UTC
(In reply to Andrew Bartlett from comment #2)
Yes, I'm working on that.
Comment 4 Andrew Bartlett 2018-08-15 21:14:10 UTC
Reproduced:

valgrind bin/ldb_tdb_mod_op_test

[ RUN      ] test_ldb_add_unique_value_to_unique_index
==30094== Conditional jump or move depends on uninitialised value(s)
==30094==    at 0x527AB29: ldb_options_find (ldb_options.c:59)
==30094==    by 0x9AE2A44: ltdb_connect (ldb_tdb.c:2003)
==30094==    by 0x526918A: ldb_module_connect_backend (ldb_modules.c:217)
==30094==    by 0x528858A: ldb_connect (ldb.c:260)
==30094==    by 0x113450: ldb_unique_index_test_setup (ldb_mod_op_test.c:3325)
==30094==    by 0x505B0AB: cmocka_run_one_test_or_fixture (cmocka.c:2621)
==30094==    by 0x505B285: cmocka_run_one_tests (cmocka.c:2706)
==30094==    by 0x505B6F0: _cmocka_run_group_tests (cmocka.c:2839)
==30094==    by 0x115156: main (ldb_mod_op_test.c:4037)
==30094== 
==30094== Use of uninitialised value of size 8
==30094==    at 0x4C2F640: __strncmp_sse42 (vg_replace_strmem.c:645)
==30094==    by 0x527AA4E: ldb_options_find (ldb_options.c:60)
==30094==    by 0x9AE2A44: ltdb_connect (ldb_tdb.c:2003)
==30094==    by 0x526918A: ldb_module_connect_backend (ldb_modules.c:217)
==30094==    by 0x528858A: ldb_connect (ldb.c:260)
==30094==    by 0x113450: ldb_unique_index_test_setup (ldb_mod_op_test.c:3325)
==30094==    by 0x505B0AB: cmocka_run_one_test_or_fixture (cmocka.c:2621)
==30094==    by 0x505B285: cmocka_run_one_tests (cmocka.c:2706)
==30094==    by 0x505B6F0: _cmocka_run_group_tests (cmocka.c:2839)
==30094==    by 0x115156: main (ldb_mod_op_test.c:4037)
==30094==
Comment 5 Andrew Bartlett 2018-08-15 21:18:27 UTC
f8b368c9f0c2a34b6d15303a9d6facd762e1a517 was not backported.  Sorry!
Comment 6 David Mulder 2018-08-15 21:36:00 UTC
Awesome. I also see the segfault now. Thanks!
Comment 7 Andrew Bartlett 2018-08-15 21:46:51 UTC
Created attachment 14423 [details]
proposed patch for ldb 1.3 (Samba 4.8)

Make test now runs, including ldb_mod_op_test under valgrind.
Comment 8 Douglas Bagnall 2018-08-15 21:51:20 UTC
Karolin,
I think this needs to go in the next 4.8.
Comment 9 Karolin Seeger 2018-08-16 08:52:28 UTC
(In reply to Douglas Bagnall from comment #8)
Pushed to autobuild-v4-8-test.
Comment 10 Karolin Seeger 2018-08-24 09:58:07 UTC
Pushed to v4-8-test.
Closing out bug report.
Thanks!