Bug 2045195 - amanda: FTBFS in Fedora rawhide/f36: hexencode-test fails
Summary: amanda: FTBFS in Fedora rawhide/f36: hexencode-test fails
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: amanda
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jason Tibbitts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F36FTBFS F37FTBFS 2094386
TreeView+ depends on / blocked
 
Reported: 2022-01-25 16:06 UTC by Fedora Release Engineering
Modified: 2022-07-08 17:41 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-07-08 17:41:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
build.log (32.00 KB, text/plain)
2022-01-25 16:06 UTC, Fedora Release Engineering
no flags Details
root.log (32.00 KB, text/plain)
2022-01-25 16:06 UTC, Fedora Release Engineering
no flags Details
state.log (966 bytes, text/plain)
2022-01-25 16:06 UTC, Fedora Release Engineering
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 1008447 0 None None None 2022-04-07 09:52:54 UTC
Github zmanda amanda issues 167 0 None open Issue in hexdecode_string() 2022-04-07 09:43:10 UTC

Description Fedora Release Engineering 2022-01-25 16:06:20 UTC
amanda failed to build from source in Fedora rawhide/f36

https://koji.fedoraproject.org/koji/taskinfo?taskID=81769691


For details on the mass rebuild see:

https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Please fix amanda at your earliest convenience and set the bug's status to
ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks,
amanda will be orphaned. Before branching of Fedora 37,
amanda will be retired, if it still fails to build.

For more details on the FTBFS policy, please visit:
https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/

Comment 1 Fedora Release Engineering 2022-01-25 16:06:24 UTC
Created attachment 1853638 [details]
build.log

file build.log too big, will only attach last 32768 bytes

Comment 2 Fedora Release Engineering 2022-01-25 16:06:27 UTC
Created attachment 1853639 [details]
root.log

file root.log too big, will only attach last 32768 bytes

Comment 3 Fedora Release Engineering 2022-01-25 16:06:28 UTC
Created attachment 1853640 [details]
state.log

Comment 4 Ben Cotton 2022-02-08 21:04:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 5 Petr Pisar 2022-03-01 08:03:30 UTC
make[5]: Entering directory '/builddir/build/BUILD/amanda-3.5.1/common-src'
PASS: amflock-test
PASS: event-test
PASS: amsemaphore-test
PASS: crc32-test
PASS: quoting-test
PASS: ipc-binary-test
FAIL: hexencode-test
PASS: fileheader-test
PASS: match-test

Comment 6 Petr Pisar 2022-03-01 08:05:53 UTC
The first failing build root points to <https://koschei.fedoraproject.org/build/11849296>. Though, I'm not sure it's the same failure.

Comment 7 Michal Josef Spacek 2022-04-06 20:30:23 UTC
Error output is this:
 PASS test_encode (total: 0.000056)

(process:73137): GLib-ERROR **: 14:58:00.084: adding 18446744073709551615 to string would overflow
 PASS test_roundtrip (total: 0.000070)
 PASS test_roundtrip_rand (total: 0.001036)

Same error in debian build log: http://qa-logs.debian.net/2022/03/26/amanda_3.5.1-8_unstable.log

Exact error is in common-src/hexencode-test.c on line 78
 ...
 typedef struct {char *in; char *out; gboolean expect_err; } dec_vec;
 static gboolean
 test_decode(void)
 {
     static const dec_vec test_strs[] = {
         {"hi", "hi", FALSE},
         {"hi%21", "hi!", FALSE},
         {"%25", "%", FALSE},
         {"%2a", "*", FALSE},
         {"%2A", "*", FALSE},
         {"%0a", "\n", FALSE},
         {"%0A", "\n", FALSE},
         {"%0ahi%0a", "\nhi\n", FALSE},
         {"%", "", TRUE},
      // ^^^^^^^^^^^^^^^^
         {"%2", "", TRUE},
         {"h%", "", TRUE},
         {"%0h", "", TRUE},
         {"%h0", "", TRUE},
         {"%00", "", TRUE}
     };
 ...

Comment 8 Petr Pisar 2022-04-07 08:03:24 UTC
That's an exception from glib2 and glib2-devel was upgraded from 2.70.2-4.fc36 to 2.71.0-1.fc36. So the failure can be triggered by glib2.

However, there is also a bug in the testing function:

    ret = TRUE;
    for (i = 0; i < num; i++) {
        tmp = hexdecode_string(test_strs[i].in, &err);
->      if (!tmp || !g_str_equal(test_strs[i].out, tmp) ||
            (!!err != test_strs[i].expect_err)) {
            ret = FALSE;
            tu_dbg("decode failure:\n")
            tu_dbg("input:     \"%s\"\n", test_strs[i].in);
            tu_dbg("output:    \"%s\"\n", tmp? tmp : "(null)");
            tu_dbg("expected:  \"%s\"\n", test_strs[i].out);
            tu_dbg("error msg: %s\n", err? err->message : "(none)");
        }
        g_clear_error(&err);
        g_free(tmp);

    }
    return ret;

hexdecode_string() is documented to return NULL in case of an error. The test "%" is expected to fail, hence it should return NULL. If it does, then a condition (!tmp) in the testing function will falsely report a test failure.

But the most importat bug is in hexdecode_string():

    size_t orig_len, new_len, i;
    [...]
    new_len = orig_len = strlen(str);
    for (i = 0; i < orig_len; i++) {
        if (str[i] == '%') {
->          new_len -= 2;
        }
    }

In case of "%", strlen("%") sets new_len=1. (str[0] == '%') is true, new_len underflows to (size_t)-1.

Comment 9 Peter Bieringer 2022-07-06 21:05:42 UTC
potential fix: https://github.com/zmanda/amanda/pull/176
also reported here: https://bugzilla.redhat.com/show_bug.cgi?id=2104645

Comment 10 Jason Tibbitts 2022-07-08 17:41:13 UTC
I imported that fix.  The package has been built in rawhide and appears to have been pushed out to the mirrors.


Note You need to log in before you can comment on or make changes to this bug.