Tests failing on CentOS 6

Timo Sirainen timo at sirainen.com
Mon Aug 17 12:17:45 EEST 2020


On 15. Aug 2020, at 14.18, Peter <peter at pajamian.dhs.org> wrote:
> 
> Getting this when attempting to build 2.3.11.3 on CentOS 6:
> 
> test-mail-cache.c:176: Assert failed: strcmp(str_c(str),"123\nfoo\n456\nbar\n")
>        "" != "123
> foo
> 456
> bar
> "
> test-mail-cache.c:176: Assert failed: strcmp(str_c(str),"123\nfoo\n456\nbar\n")
>        "" != "123
> foo
> 456
> bar
> "
> mail cache uncommitted lookups ....................................... : FAILED
> 
> Full make check output is at https://paste.centos.org/view/b48d38a9
> 
> I can provide full build logs if you want, but that's a 4M file so I'll provide it upon request.
> 
> For now I'm going ot have to bypass the make check stage of the build for CentOS 6, but I worry that the failed check could be indicative of something critical.

Looks like it's a gcc bug. It's not initializing the end_of_lines field in the unit test. Since it's in the unit test only, it's not harmful. Of course, the same gcc bug could be hitting some important places in the code.. but that's not a new issue. Only this unit test is really new and exposing this issue.

The problem goes away with:

diff --git a/src/lib-index/test-mail-cache.c b/src/lib-index/test-mail-cache.c
index e4e5503f6..4734904e8 100644
--- a/src/lib-index/test-mail-cache.c
+++ b/src/lib-index/test-mail-cache.c
@@ -130,11 +130,13 @@ static void test_mail_cache_fields(void)
        struct test_header_data header_data1 = {
                .line1 = 15,
                .line2 = 30,
+               .end_of_lines = 0,
                .headers = "foo\nbar\n",
        };
        struct test_header_data header_data2 = {
                .line1 = 10,
                .line2 = 20,
+               .end_of_lines = 0,
                .headers = "123\n456\n",
        };
        mail_cache_add(cache_trans, 1, cache_fields[TEST_FIELD_HEADER1].idx,


More information about the dovecot mailing list