Conversation
nm_bufferqueue_unshift_to_delim() takes a size_t *, but the test passed an unsigned long * and printed size_t values with %ld. Both only happen to match on 64 bit Linux; on i386 the test fails to compile with -Werror. Signed-off-by: nook24 <info@nook24.eu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WY8mbGLNkt5eQfc57cTnZ5
runnable_delays held values that do not fit a 32 bit time_t, which fails the -Werror build; those are now skipped. event_timespec_msdiff expected 2^31 seconds to come back exactly, but in milliseconds that saturates a 32 bit long, as timespec_msdiff() is meant to. Signed-off-by: nook24 <info@nook24.eu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WY8mbGLNkt5eQfc57cTnZ5
configure never checked for them, so lib/snprintf.c always compiled its replacements and libnaemon exported them, ahead of libc in the symbol lookup order. They sit on an old vsnprintf() that does not know the z, j and t modifiers and, without HAVE_LONG_LONG, reads %ll as long. nm_asprintf(), nm_log() and nsock_printf() all went through it. On i386 %llu printed garbage, which is why SCHEDULE_HOST_DOWNTIME got an end time of 0 in test_commands. On every platform %z makes it fail, so nm_log() drops the wproc parse error in workers.c and nm_asprintf() would exit(2). Builds with _FORTIFY_SOURCE=2, like the Debian packages, call __vasprintf_chk() instead and never noticed. smb_snprintf() and smb_vsnprintf() are still exported, just unused. Signed-off-by: nook24 <info@nook24.eu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WY8mbGLNkt5eQfc57cTnZ5
The random loops asserted that on overflow the result differs from a + b, but a + b overflows there too, and the builtins store exactly that wrapped value. With a 64 bit long random() never overflows, so the branch only ran on 32 bit, where it failed. Compare against the long long result instead, which checks that overflow is detected at all. Signed-off-by: nook24 <info@nook24.eu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WY8mbGLNkt5eQfc57cTnZ5
A 24x7 exclusion looks like it ends at every DST change, so for a timeperiod that is never valid _get_next_valid_time() hops from one change to the next, half a year at a time, until max_depth. With a 32 bit time_t that runs past 2038, midnight + SECS_PER_DAY wraps to 1901 and the search returns that as the next valid time; test_timeperiods failed on i386 because of it. Both searches now stop a day before time_t runs out: nothing valid is found, and a period still valid there stays valid to the end. Signed-off-by: nook24 <info@nook24.eu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WY8mbGLNkt5eQfc57cTnZ5
sni
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Debian 11/12 i386 packages build with
-Werror, butmake checkhas not passed on 32 bit for a while: two tests did not compile, which hid three failures behind them. Two of those were real bugs, not test problems.With this PR
make checkpasses on Debian 11 and 12 i386 and still passes on amd64.Bugs
libnaemon replaced
asprintf()/vasprintf()on every platform.configurenever checked for them, solib/snprintf.calways compiled its replacements, and libnaemon exported them ahead of libc. They are built on an oldvsnprintf()that has noz,jortmodifier and, withoutHAVE_LONG_LONG, reads%llaslong.nm_asprintf(),nm_log()andnsock_printf()all go through it:%llu;%llu0%lld%zdOn i386 this sent
SCHEDULE_HOST_DOWNTIMEwith an end time of 0 intest_commands. On every platform,nm_log()silently drops any message that uses%z, such as the wproc parse error inworkers.c, andnm_asprintf()wouldexit(2)on one. Builds with-D_FORTIFY_SOURCE=2call__vasprintf_chk()and skip the replacement, which is why the Debian packages (hardening=+all) never showed it. Unfortified builds, and NEB modules built without FORTIFY that callasprintf(), are affected. The fix addsasprintfandvasprintftoAC_CHECK_FUNCS.smb_snprintf()/smb_vsnprintf()stay exported so the library ABI does not shrink.Timeperiod searches ran past the end of
time_t. A 24x7 exclusion appears to end at every DST change. For a timeperiod that is never valid,_get_next_valid_time()therefore hops half a year at a time untilmax_depth. With a 32 bittime_tthat goes past 2038,midnight + SECS_PER_DAYwraps to 1901, and the search returns that as the next valid time. That is a check scheduled in 1901, i.e. immediately. Both searches now stop a day beforetime_truns out.Tests
test-bufferqueue: usedunsigned longfor asize_t *and%ldforsize_t. It did not compile on i386.test-event-heap:runnable_delaysheld values that do not fit a 32 bittime_t, so it did not compile.event_timespec_msdiffexpected an exact value wheretimespec_msdiff()correctly saturates a 32 bitlong.test-arith: on overflow it asserteddest != a + b. Buta + boverflows too, and the builtins store exactly that value. With a 64 bitlongthe branch never ran. It now compares against thelong longresult.The first two commits are also part of #547, with the same SHAs, so whichever PR is merged first, the other just drops them.
Not fixed here
t-tap/test_commandsfails now and then on every platform in theSCHEDULE_*_CHECK(S)next_check assertions (about 2 in 40 runs, on amd64 as well as i386). It is unrelated to 32 bit and has been left alone