Hello (debian-mipsel and ngircd upstream),
my latest upload of ngircd (24-2) a few days ago failed to build on
mips64el, and on that architecture only. Checking the build log[0] and
additional tests on the Debian porter box "eller" showed the cause is
in the "test-mode" test of the test suite. More precisely, the
| send "mode #usermode +a nick\r"
[ mode-test.e:57 ]
does not return a string containing "482", thus this test is considered
failing, and so the entire build. Same for the "+q" test that follows
once the above "+a" test is disabled.
The related code is in irc-mode.c:723:
case 'q': /* Owner */
case 'a': /* Channel admin */
if(!is_oper && !is_machine && !is_owner && !is_admin) {
connected = IRC_WriteErrClient(Origin,
ERR_CHANOPPRIVTOOLOW_MSG,
Client_ID(Origin),
Channel_Name(Channel));
goto chan_exit;
}
where ERR_CHANOPPRIVTOOLOW_MSG contains the expected "482" string
constant.
After adding debug print statements:
case 'a': /* Channel admin */
+Log(LOG_ALERT, "is_oper = %d", is_oper);
+Log(LOG_ALERT, "is_machine = %d", is_machine);
+Log(LOG_ALERT, "is_owner = %d", is_owner);
+Log(LOG_ALERT, "is_admin = %d", is_admin);
if(!is_oper && !is_machine && !is_owner && !is_admin) {
and running the test manually, i.e.
cd src/testsuite
strace -s 2048 -f -tt -o ~/strace.log sh -c './start-server1 ; ./mode-test ; ./stop-server1'
I find for both architectures the same value set (all zero). The strace
log, trimmed for readability
[amd64]
read(7, "mode #usermode +a nick\r\n", 2048) = 24
write(1, "[599904:1 7] is_oper = 0\n", 28) = 28
write(1, "[599904:1 7] is_machine = 0\n", 31) = 31
write(1, "[599904:1 7] is_owner = 0\n", 29) = 29
write(1, "[599904:1 7] is_admin = 0\n", 29) = 29
write(7, ":ngircd.test.server 482 nick #usermode :Your privileges are too low\r\n", 69 <unfinished ...>
[mips64el]
read(7, "mode #usermode +a nick\r\n", 2048) = 24
write(1, "[23415:1 8] is_oper = 0\n", 27) = 27
write(1, "[23415:1 8] is_machine = 0\n", 30) = 30
write(1, "[23415:1 8] is_owner = 0\n", 28) = 28
write(1, "[23415:1 8] is_admin = 0\n", 28) = 28
write(7, ":nick!~user@127.0.0.1 MODE #usermode +a nick\r\n", 46) = 46
strongly suggests the code on mips64el does *not* follow the if()
statement although all preconditions are met.
The previous upload of ngircd 24-1 back in January was built using
gcc-6 and showed no problems, also there are no changes between -1 and
-2 that would even remotely explain this behaviour.
Ultimately, after rebuilding on mips64el using -O0 the test suite
passes. Although it's usually premature to assume it: This smells like
a compiler bug.
Could anyone shed some light on this? Or perhaps extract the relevant
parts for a small reproducer?
Christoph
[0] https://buildd.debian.org/status/fetch.php?pkg=ngircd&arch=mips64el&ver=24-2&stamp=1503078437&raw=0
Attachment:
signature.asc
Description: Digital signature