a9054011188cb975a65a7d9767096a0ffdceb366 braney Mon Sep 21 17:34:46 2026 -0700 netSlurpMaxTest: cover the response size ceiling, refs #38359 The fix this defends changes nothing on any page. Its only caller is the hgTablesTest robot, and the failure it prevents is the process exiting from inside carefulAlloc with nothing written to the log, so a unit test is the only test there can be. Four parts. netSlurpFileMax on a plain file, both sides of the boundary, including a ceiling exactly at the file size, which has to read it. The same calls under pushCarefulMemHandler, where carefulTotalAllocated() says whether the abandoned buffer was really freed: a buffer left behind would stay counted against the ceiling and the cap would buy one oversized page and no more. A matched pair of forked children on a file past the allocator ceiling, one read capped and one not, since exit(1) from inside the allocator cannot be seen any other way. And htmlPageSetMaxSize reaching htmlSlurpWithCookies against a server on the loopback interface, because the ceiling travels through a module-wide static and that wiring can rot with no caller changing. Backed the fix out three ways and watched each go red for its own reason. Removing the size check fails 9 of the 18 assertions. Keeping the check and dropping only the dyStringFree fails 3, and only the three that count allocation. Reverting htmlSlurpWithCookies to a plain netSlurpFile fails 2, and only the two that reach through htmlPage. Recorded as sandbox-ab. The registry row carries "-" for the release: the ticket has no target version. diff --git src/lib/tests/makefile src/lib/tests/makefile index 6af34921040..49dcd72cc79 100644 --- src/lib/tests/makefile +++ src/lib/tests/makefile @@ -1,47 +1,54 @@ kentSrc = ../.. include ../../inc/common.mk MYLIBDIR = ../../lib/${MACHTYPE} MYLIBS = ${MYLIBDIR}/jkweb.a BIN_DIR = bin/${MACHTYPE} pipelineTester = ${BIN_DIR}/pipelineTester test: errCatchTest htmlPageTest htmlExpandUrlTest htmlSanitizeTest pipelineTests dyStringTest \ mimeTests base64Tests quotedPTests safeTest hashTest fetchUrlTest gff3Test \ tabixTest vcfTest hacTreeTest mmHashTest testSumDoubles jsonQueryTest \ dnaCodonTest pathSimplifyTest faSpeedReadTest cgiParseTest cgiCookieTest \ - hmacTest + hmacTest netSlurpMaxTest rm -r output fetchUrlTest testSumDoubles @echo tested all mkdirs: ${MKDIR} output ${BIN_DIR} testSumDoubles: testSumDoubles.o ${MYLIBS} @${MKDIR} $(dir $@) ${CC} ${COPT} -o ./testSumDoubles testSumDoubles.o ${MYLIBS} ${L} hmacTest: hmacTest.o ${MYLIBS} mkdirs @${MKDIR} $(dir $@) ${CC} ${COPT} -o ${BIN_DIR}/hmacTest hmacTest.o ${MYLIBS} ${L} ${STRIP} ${BIN_DIR}/hmacTest${EXE} ${BIN_DIR}/hmacTest > output/hmacTest diff expected/hmacTest output/hmacTest +netSlurpMaxTest: netSlurpMaxTest.o ${MYLIBS} mkdirs + @${MKDIR} $(dir $@) + ${CC} ${COPT} -o ${BIN_DIR}/netSlurpMaxTest netSlurpMaxTest.o ${MYLIBS} ${L} + ${STRIP} ${BIN_DIR}/netSlurpMaxTest${EXE} + ${BIN_DIR}/netSlurpMaxTest > output/netSlurpMaxTest + diff expected/netSlurpMaxTest output/netSlurpMaxTest + pathSimplifyTest: pathSimplifyTest.o ${MYLIBS} mkdirs @${MKDIR} $(dir $@) ${CC} ${COPT} -o ${BIN_DIR}/pathSimplifyTest pathSimplifyTest.o ${MYLIBS} ${L} ${STRIP} ${BIN_DIR}/pathSimplifyTest${EXE} ${BIN_DIR}/pathSimplifyTest > output/pathSimplifyTest diff expected/pathSimplifyTest output/pathSimplifyTest faSpeedReadTest: faSpeedReadTest.o ${MYLIBS} mkdirs @${MKDIR} $(dir $@) ${CC} ${COPT} -o ${BIN_DIR}/faSpeedReadTest faSpeedReadTest.o ${MYLIBS} ${L} ${STRIP} ${BIN_DIR}/faSpeedReadTest${EXE} ${BIN_DIR}/faSpeedReadTest > output/faSpeedReadTest diff expected/faSpeedReadTest output/faSpeedReadTest dnaCodonTest: dnaCodonTest.o ${MYLIBS} mkdirs